Creating my own app for my USB MIDI device

I want to try to create my own application for Nocturn innovation, which is the surface of the USB controller USB. The application software interacts with it to send MIDI messages to software such as Traktor, Ableton, and Cubase.

I know libusb, but as far as I know. I successfully installed it to interact with my device, but stopped there.

Mostly I get the right reading material. USB specifications, MIDI specifications, etc. To be honest, the full USB 2.0 specification looks like it contains a lot of things that I don't need. Just look for something interesting to do now that I have completed my Computer Science degree. My current programming knowledge is C ++ and mostly C #.

Could do with some direction how to get stuck in this task.

change

Refresh to include some information from device manager in Nocturn.

Equipment Identifiers:

USB \ VID_1235 & PID_000A & REV_0009

USB \ VID_1235 & PID_000A

Compatible identifiers:

USB \ Class_FF & SubClass_00 & Prot_00

USB \ Class_FF & SubClass_00

USB \ Class_FF

Device class:

mass media

+4
source share
6 answers

USB MIDI is perhaps one level of abstraction lower than you want. I would suggest finding a good MIDI structure and interacting with the device through MIDI.

For C ++ Juce , this is probably the way to go since you did not specify the target platform or any other specific requirements.

+1
source

If you want to follow the .NET path, the easiest way to start is with the C # MIDI Toolkit code:

http://www.codeproject.com/KB/audio-video/MIDIToolkit.aspx

In it you will find all the basics for opening a device, reading input and writing output. Alternatively, NAudio has several MIDI classes, but they are somewhat incomplete.

As you develop, you will need a reference for the MIDI specification .

The tool you will find is priceless, MIDI-OX . In fact, I suggest that you start MIDI-OX before you start coding and use it to sniff out messages coming from Novation. This will give you an idea of ​​what Novation sends. You can use it in combination with MIDI Yoke (customizable virtual MIDI port) to insert yourself between Novation and Ableton Live (or any other software that you usually use with your Novation) so that you can see all messages normally .

0
source

Done ... It's a joke, but I started with this in Python - I personally need linux support. I teach python myself, but I just dabble in programming.

You can see the main functions https://github.com/dewert/nocturn-linux-midi . The guy who drew his engineering (i.e., a jump that I could not have done myself) does not seem to be doing it anymore. His code is at https://github.com/timoahummel/nocturn-game

I use PyPortMIDI and PyUSB, both of which, I believe, are wrappers for C-equivalents. I think this is fine on Windows, but have not tried it.

What is currently on my github is shit, but it is a proof of concept. I am currently working on this using threads and the correct configuration options.

0
source

The driver for Nocturn makes it appear as a MIDI device, even if it is not a USB-MIDI device at the hardware level. Automap software works completely at the MIDI level, receives MIDI instructions and sends different instructions in response - this is separate from the driver, and not necessary.

Alternatively, look at the https://github.com/timoahummel/nocturn-game example of connecting to it directly via USB with Python. Perhaps you can port this to another language using libusb bindings.

0
source

Old thread, but I just recently started learning this.

I looked at a Python application written by dewert. Interestingly, the data that Nocturn emits is actually MIDI, although it is not registered as a USB MIDI device.

But, looking at the actual data coming from the device, it actually gives out messages about the change of control (controller value 0xB0) for everything. Also, the control commands that are sent to it are also messages about the change of control, although only bytes of data, since Nocturn seems to support the state of work in MIDI (that is, when sending several messages of a change of control, there is no need to repeat the byte of data).

Indeed, looking at the magic data of initialization, this is actually just a bunch of control changes: it starts with 0xb0, and from there the data comes in twice. For example, the last two bytes in the initialization string are 0x7f 0x00, which simply turn off the LED for the rightmost direct access button. (Something subtle happens as a result of sending the initialization, because Nocturn sometimes emits some messages that appear to be some form of timeout events, and this behavior changes depending on whether the initialization string was sent or not. )

Using MIDI-like messages makes sense, since Novation will know the MIDI protocol well, so it would be easier to use it for communication, even if the device is not strictly a MIDI device.

Note that incrementers simply send the values ​​1 or 127, i.e. +1 or -1 step, so even with some trivial matching software this is not very useful as it is. (In fact, if you turn quickly, you can get 3 or 125, for example 125, corresponding to -3.) The only controller that sends a continuous value is a slider that emits an 8-bit value when moved.

0
source

I suppose you want to know about USB classes in general and USB MIDI class in particular. The last best thing you can hope for if you don't have documentation for any proprietary protocol (instead, it is used there).

-1
source

Source: https://habr.com/ru/post/1381201/


All Articles