Is it possible to rename the individual ports in MIDIx4 or MIDIx16 mode?

Status
Not open for further replies.

tom_d

Member
I was wondering if it's possible rename the individual ports in MIDIx4/16 mode. On my Mac they show as "Teensy MIDIx16 Port 1, Teensy MIDIx16 Port 2" etc., but as I am using Teensy as a MIDI router, it would be really nice if they could be named to match the equipment that is on that port.

Based on a glance at the USBMIDI source, I am guessing that the answer is no, and the "Port x" suffixes are assigned by the Mac operating system, but thought it was worth asking in case anyone has any ideas/workarounds!
 
You can use the “usb_string_midi_port1” through “usb_string_midi_port16” constants. By default, the names used are “Port *”, see usb_desc.c#L1686.

You can define these names as shown here, for example:
Code:
#include "usb_names.h"

struct usb_string_descriptor_struct usb_string_midi_port1 = {
        2 + 9 * 2,
        3,
        {'S', 'o', 'm', 'e', ' ', 'n', 'a', 'm', 'e'}
};
The first argument is 2 plus the number of characters times 2 (they're wide characters, so 2 bytes / char, and I assume an additional two bytes for a terminating null).
The second argument is the descriptor type, and should be 3.

I use this Python script to generate these structs more easily.

Pieter
 
Ah fantastic, thanks so much! I would never have thought to search for the string as an array like that :)
 
Would this now also be implemented in 4.x ?

Also, does MIDIx16 mean that when I plug my teensy in my macbook pro, the my DAW logic pro will see like there are 16 different usb midi cables plugged in which can all send in totaal 16 channels of data ?
 
Status
Not open for further replies.
Back
Top