Can I get names of USB ports/devices?

When I am developing with RtMidi on Mac or Windows, it can give me the names of the MIDI devices I am working with as a text string. I don’t know if it does this by MIDI protocol or by USB, but it does it somehow.

Is it possible to get this information in a OpenWare patch?

Related question: The device firmware knows when a USB device has connected or disconnected (it currently displays a message on the screen). Is it possible for a patch to be notified when this occurs?

I have skimmed the docs but not seen this.
Reasons: A patch might want to detect a specific device has been connected when it connects and send it some kind of MIDI init message (for example turning on lights). A patch might want to display the current MIDI device to the screen.

USB info is not exposed to patches at the moment. But yes, it could be added as there are ways to provide functions pointers to firmware internals that patch code can call as well as send pointers from patch to be called by firmware as callbacks.

Maybe I will file a feature request on Github then.

What about the port-- is the port always 0? Or is USB one number and MIDI-DIN (I don’t know if support for this was ever added) a second number? In my tests, a USB MIDI device is always port 0.

Yes, there are plans to make individual devices addressable by ports the way you describe. I don’t know if Martin started anything related to it, but I’ve heard about adding it in future. Serial MIDI can be used when available (output on Magus, input and output on Genius, etc), but you can’t differentiate USB and serial MIDI yet. Potentially we will add another bus for connecting multiple modules via UART and it can be used for MIDI transfer too.

Okay, thanks. So I can just assume port 0. I just wanted to make sure there wasn’t some kind of feature I was missing that might require me to sometimes talk to port 1 :slight_smile: