How to work with multiple identical MIDI USB devices

My C # application should use several identical USB MIDI interfaces, which all belong to the same manufacturer.

In the device manager, all devices are displayed with the same driver name / CLSID - only PNPDeviceID is different. When I list all the MIDI inputs / outputs (using MIDI-dot-net), they look like this:

  • ACME-MIDI: Port 1
  • 1- ACME-MIDI: port 1
  • 2- ACME-MIDI: Port 1

Unfortunately, these names are not always the same for the same device. The ports of device 1 sometimes appear as "ACME-MIDI: port 1", and sometimes as "1-ACME: port 1" (they change, for example, after a reboot).

I used different methods to find out which name belongs to the device (SetupDi, WMI, Win32_PnPSignedDriver, ...), but I either get the device ID OR the names of the ports that it reports, but I can not find the MIDI port name (ACME-MIDI : Port n) using the device identifier or driver key.

Any suggestions?

Update

I'm still looking for a solution to display the MIDI USB I / O ports on this port (for example, using the Windows API). It seems like it's pretty complicated, so I'm starting the bounty on this.

+4
source share
1 answer

Unfortunately, using only MIDI interfaces, it is not possible to distinguish between devices. You must rely on your name. Fortunately, while the order of the devices can change, it seems to me that this does not happen upon reboot. However, as you have seen, this is possible.

In the past, I did this in my own software, asking the user to press a key or move the control knob on the device to distinguish them.

0
source

All Articles