Usb Midi device name when using cables

mark.winger

Active member
I have a teensy I am using to display scribble strips for a midi control surface. I have 17 displays all working. However, I am communicating with Mixing Station which uses Mackie MCU protocol which only supports 8 channels. So I need to split the displays on multiple devices.

I am using midi cables as defined on the teensy midi page but I cannot figure out how to change it so that each cable has a different device name. The code works but the names auto generated by the midi library are not midiin0 = cable 0 and they dont seem to enumerate the same every time.

I have used code the change the name on other projects but those were one name for the whole project. How do I change it for each cable? (I am using arduino ide 2.3.4)

Mark
 
Last edited:
I have a teensy I am using to display scribble strips for a midi control surface. I have 17 displays all working. However, I am communicating with Mixing Station which uses Mackie MCU protocol which only supports 8 channels. So I need to split the displays on multiple devices.

I am using midi cables as defined on the teensy midi page but I cannot figure out how to change it so that each cable has a different device name. The code works but the names auto generated by the midi library are not midiin0 = cable 0 and they dont seem to enumerate the same every time.

I have used code the change the name on other projects but those were one name for the whole project. How do I change it for each cable? (I am using arduino ide 2.3.4)

Mark
I'm still working on this problem. I found this link and am trying to get this to work.

https://forum.pjrc.com/index.php?threads/configurable-usbmidi-port-names.50043/

I am working currently with a teensy 3.5. It appears that all the code is in usb_name.h and us_desc.h as dexcribed in the link.
Here is the code of name.c

Code:
#define MIDI_PORT1_NAME {'L','C','D',' ','1'}
#define MIDI_PORT1_NAME_LEN 5

#define MIDI_PORT2_NAME {'L','C','D',' ','2'}
#define MIDI_PORT2_NAME_LEN 5

#define MIDI_PORT3_NAME {'L','C','D',' ','3'}
#define MIDI_PORT3_NAME_LEN 5

#define MIDI_PORT4_NAME {'L','C','D',' ','4'}
#define MIDI_PORT4_NAME_LEN 5

#define MIDI_PORT5_NAME {'L','C','D',' ','5'}
#define MIDI_PORT5_NAME_LEN 5

#define MIDI_PORT6_NAME {'L','C','D',' ','6'}
#define MIDI_PORT6_NAME_LEN 5

#define MIDI_PORT7_NAME {'L','C','D',' ','7'}
#define MIDI_PORT7_NAME_LEN 5

#define MIDI_PORT8_NAME {'L','C','D',' ','8'}
#define MIDI_PORT8_NAME_LEN 5

#define MIDI_PORT9_NAME {'L','C','D',' ','9'}
#define MIDI_PORT9_NAME_LEN 5

#define MIDI_PORT10_NAME {'L','C','D',' ','1' + '0'}
#define MIDI_PORT10_NAME_LEN 7

#define MIDI_PORT11_NAME {'L','C','D',' ','1' + '1'}
#define MIDI_PORT11_NAME_LEN 7

#define MIDI_PORT12_NAME {'L','C','D',' ','1' + '2'}
#define MIDI_PORT12_NAME_LEN 7

#define MIDI_PORT13_NAME {'L','C','D',' ','1'+'3'}
#define MIDI_PORT13_NAME_LEN 7

#define MIDI_PORT14_NAME {'L','C','D',' ','1'+'4'}
#define MIDI_PORT14_NAME_LEN 7

#define MIDI_PORT15_NAME {'L','C','D',' ','1'+'5'}
#define MIDI_PORT15_NAME_LEN 7

#define MIDI_PORT16_NAME {'L','C','D',' ','1'+'6'}
#define MIDI_PORT16_NAME_LEN 7

// ****************************************

// Do not change this part.  This exact format is required by USB.

// ****************************************

struct usb_string_descriptor_struct usb_string_product_name = {
        2 + MIDI_NAME_LEN * 2,
        3,
        MIDI_NAME
};


struct usb_string_descriptor_struct usb_string_manufacturer_name = {
        2 + MIDI_MANUFACTURER_NAME_LEN * 2,
        3,
        MIDI_MANUFACTURER_NAME
};


struct usb_string_descriptor_struct usb_string_serial_number = {
        2 + MIDI_SERIAL_NUMBER_LEN * 2,
        3,
        MIDI_SERIAL_NUMBER
};

// ****************************************
struct usb_string_descriptor_struct usb_string_midi_port1 = {
        2 + MIDI_PORT1_NAME_LEN * 2,
        3,
        MIDI_PORT1_NAME
};


struct usb_string_descriptor_struct usb_string_midi_port2 = {
        2 + MIDI_PORT2_NAME_LEN * 2,
        3,
        MIDI_PORT2_NAME
};


struct usb_string_descriptor_struct usb_string_midi_port3 = {
        2 + MIDI_PORT3_NAME_LEN * 2,
        3,
        MIDI_PORT3_NAME
};



struct usb_string_descriptor_struct usb_string_midi_port4 = {
        2 + MIDI_PORT4_NAME_LEN * 2,
        3,
        MIDI_PORT4_NAME
};



struct usb_string_descriptor_struct usb_string_midi_port5 = {
        2 + MIDI_PORT5_NAME_LEN * 2,
        3,
        MIDI_PORT5_NAME
};



struct usb_string_descriptor_struct usb_string_midi_port6 = {
        2 + MIDI_PORT6_NAME_LEN * 2,
        3,
        MIDI_PORT6_NAME
};


struct usb_string_descriptor_struct usb_string_midi_port7 = {
        2 + MIDI_PORT7_NAME_LEN * 2,
        3,
        MIDI_PORT7_NAME
};


struct usb_string_descriptor_struct usb_string_midi_port8 = {
        2 + MIDI_PORT8_NAME_LEN * 2,
        3,
        MIDI_PORT8_NAME
};


struct usb_string_descriptor_struct usb_string_midi_port9 = {
        2 + MIDI_PORT9_NAME_LEN * 2,
        3,
        MIDI_PORT9_NAME
};


struct usb_string_descriptor_struct usb_string_midi_port10 = {
        2 + MIDI_PORT10_NAME_LEN * 2,
        3,
        MIDI_PORT10_NAME
};


struct usb_string_descriptor_struct usb_string_midi_port11 = {
        2 + MIDI_PORT11_NAME_LEN * 2,
        3,
        MIDI_PORT11_NAME
};

struct usb_string_descriptor_struct usb_string_midi_port12 = {
        2 + MIDI_PORT12_NAME_LEN * 2,
        3,
        MIDI_PORT12_NAME
};


struct usb_string_descriptor_struct usb_string_midi_port13 = {
        2 + MIDI_PORT13_NAME_LEN * 2,
        3,
        MIDI_PORT13_NAME
};


struct usb_string_descriptor_struct usb_string_midi_port14 = {
        2 + MIDI_PORT14_NAME_LEN * 2,
        3,
        MIDI_PORT14_NAME
};

struct usb_string_descriptor_struct usb_string_midi_port15 = {
        2 + MIDI_PORT15_NAME_LEN * 2,
        3,
        MIDI_PORT15_NAME
};


struct usb_string_descriptor_struct usb_string_midi_port16 = {
        2 + MIDI_PORT16_NAME_LEN * 2,
        3,
        MIDI_PORT16_NAME
};

The resulting names as reported by midiox are:
MIDI INPUTS-
1) scarlett1820 usb
2) MCLD
3) MIDIN2 (MCLD)
4) MIDIN3 (MCLD)
5) MIDIN4 (MCLD)

MIDI OUTPUTS-
1) Microsoft GS Wavetable Synth
2) scarlett1820 usb
3) MCLD
4) MIDIOUT2(MCLD)
5) MIDIOUT3(MCLD)
6) MIDIOUT4(MCLD)
7) MIDI Mapper

Why do all the names reflect only the MIDI_NAME and no port names.

What is even more strange to me is I have a second midi device that is for simple buttons and led. I have that as a single port midi device and use MIDI_NAME BUTTONS. This works showing midi name of BUTTONS for input and ouotput. But if I plug both of these devices into a usb hub, all the names end up being either BUTTONS of MCLD.

for example: if I connect the 4 port lcd device, the names come up as shows above. But then if I plug in the single port device, it's name comes up as another device named MLCD. But if I connect the single device is shows up as BUTTONS. Then add the 4 port device, all the MCLD names show up as BUTTONS.

Any idea what could be wrong?

Mark
 
From my experience I believe that the port names not showing is down to Windows. My Teensy Midi projects that have Port names assigned do not display the Port names on Windows machines, but they do correctly display in Linux (and I assume Macs too).
The Windows format will always be:

MidiDevice
Midiout 2(MidiDevice)
.....
Midiout 16(MidiDevice)


Theres not a lot you can do about it without using a different, or custom Midi driver in Windows. You can check the Port Names in Windows though (to confirm that they are indeed assigned). If you go to ''Device Manager'' and check under ''Software Devices'' they should be listed there under their assigned port name.

Also Windows likes to 'Cache' USB devices, so plugging in two different devices (That have may have different devices names), but I'm guessing the same VID/PID can confuse Windows into thinking it's the same device, and will use the same device name for both devices. Best way I think to avoid this is to always make sure your devices have a unique PID number.

Also a good idea to uninstall old devices through Device Manager (whilst the Device isn't connected, using the 'show hidden' option) to get Windows to reflect any device name changes you may make when you plug the device back in.

HTH
 
Forgot to mention that Microsoft should be releasing an updated Midi Driver soon that will hopefully allow assigned port names to show up in MIDI programs (fingers crossed)

 
Back
Top