Adjusting the Teensy MIDI device name

I feel like I might have one more idea on why this could be happening, in the current usbMIDI implementation none of the midi ports have their own names so it relies on Windows to come up with one on its own. So what could be happening is it sees they have the same PID so it just picks one of them to generate a name from for both devices. And now that I mention it I do remember that I gave my ports they’re own names back when I first programmed 3 Teensy 3.6s that are on a Windows 7 machine. I’m pretty sure they don’t have any issues last time I checked, but it’s definitely something else to look into, if anyone wants a place to start with this here’s the thread from 2 years ago: https://forum.pjrc.com/threads/50043-Configurable-usbMIDI-Port-Names I haven’t messed with it since then so it probably would need to be updated.
 
Interestingly, regarding the usb host port of the MIO-10 and it's ability to handle multiple identical class compliant usbMidi devices. In one setup I had several Teensy (3.2 - 4.0) usbMidi devices plugged in via a hub. All worked until I added a T2 usbMidi and to fix it, was not just a matter of unplugging the T2 and restarting the system. The hub needs to be unplugged, then you delete everything in the MIO-10's config, reboot then start over.

Further digging, in another iteration, had several off-the -shelf UsbMidi class compliant devices plugged into the MIO-10's host and added a (don't recall which)Teensy usbMidi to the mix which de-railed it. Have yet to dig deeper into that rabbithole and set up some test scenarios and take screenshots etc. to cover all the various permutations.

Have other work so will be a little while...
 
Well, I tried vjmuzik's idea of naming the ports, and fingers crossed, it seems to work! My host doesn't display those names, but the fact that they are unique seems to cause windows to get the interface names right....

Thanks!!
 
hi, I've tried the suggestions listed in the documentation and the product ID definition, tried deleting devices in Windows Device Manager (Win 10) but the two devices I have keep being renamed in Ableton Live to whichever one was last plugged in. I have one called "footswitch" and one called "solenoid", but they appear as "footswitch#2" and footswitch#3" if footswitch was last plugged in. Each have unique name, manufacturer and serial number ids specified in the name.c file.

This is really confusing for my particular application, which is a live music set up that I want to be able to boot up and run at the flick of a power switch, using a tablet to remotely control a NUC PC. As the 3 devices I am using all use the same name, but do completely different things, they get mixed up in Live which is tricky to fix. Having unique names would be ideal as then I'd know if the correct device was assigned to the correct track in Live.

Any ideas?
 
right so I did what others have suggested in previous posts as an intermediate work around: set up 3 different controllers one as MIDI, one as Serial + MIDI, and the other as Serial+MIDI+Audio. Each come up with their unique names which solves my problem, for now, unless I decide to add another Teensy based device to the mix...
 
@eddevane, how about using a T4.0 with a hub hooked to it's usb host port allowing Windoze to see your individual devices as a single multi-cable device?
 
This used to work for me... having MIDI_Name.c in my project (as attached).
Also attached is the project explorer listing in VS Code
Now (for months, at least) the USB MIDI name showing on my Mac is "Teensy MISI Port 1"

I'd like it to be DigiBrass MIDI as in the .c file.

Teensy 3.2 architecture on a custom board with Teensy boot loader
VS Code: 1.69.2
PlatformIO.ini attached.

Any guidance?

MIDI_Name.c
Code:
// To give your USB MIDI device a unique name, this code must be placed into a .c file (its own tab).  It can not be in a .cpp file or your main sketch (the .ino file).
#include "usb_names.h"

// Edit these lines to create your own name.  The length must match the number of characters in your custom name.
#define MIDI_NAME   {'D','i','g','i','B','r','a','s','s',' ','M','I','D','I'}
#define MIDI_NAME_LEN  14

// 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
};

// #ifdef USE_OTHER_MIDI_NAME_AND_MANUFACTURER
// // To give your project a unique name, this code must be
// // placed into a .c file (its own tab).  It can not be in
// // a .cpp file or your main sketch (the .ino file).

// #include "usb_names.h"

// // Edit these lines to create your own name.  The length must
// // match the number of characters in your custom name.

// #define MANUFACTURER_NAME   {'C','-','T','H','R','U'}
// #define MANUFACTURER_NAME_LEN  6
// #define MIDI_NAME   {'A','X','I','S','4','9','W','H',}
// #define MIDI_NAME_LEN  8
// #define SERIAL_NUM {'1','2','3','4','5','6','7','8','9','a','b','c'}
// #define SERIAL_NUM_LEN 12

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

// struct usb_string_descriptor_struct usb_string_manufacturer_name = {
//         2 + MANUFACTURER_NAME_LEN * 2,
//         3,
//         MANUFACTURER_NAME
// };

// struct usb_string_descriptor_struct usb_string_product_name = {
//         2 + MIDI_NAME_LEN * 2,
//         3,
//         MIDI_NAME
// };
// #endif
Code:
[ATTACH=CONFIG]29050._xfImport[/ATTACH]

PlatformIO.INI
Code:
[env:teensy31]
platform = teensy
board = teensy31
framework = arduino
build_flags = -D USB_MIDI_SERIAL -D TEENSY_PLATFORM
lib_deps = 
	robtillaart/RunningMedian@^0.3.0
	sstaub/TeensyID@^1.3.1
	arduino-libraries/Madgwick@^1.2.0
	sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@^1.1.2
	adafruit/Adafruit GFX Library@^1.10.4
	adafruit/Adafruit ST7735 and ST7789 Library@^1.6.0
	adafruit/Adafruit BusIO@^1.7.1
	arduino-libraries/SD@^1.2.4
	ivanseidel/LinkedList@0.0.0-alpha+sha.dac3874d28
lib_extra_dirs = 
	../../dbLibraries
 
Have you deleted the existing device from Audio MIDI Setup after the name change? That is still required on Mac as far as I know.
 
Yes, I've tried that.
Interesting that while deleting all of the cached USB MIDI connections in AudioMIDI setup, I found another called "DigiBrass MIDI".
So it has worked at some point since I got my newer MacBook (~ a year).

- I deleted all MIDI devices in MIDI Studio (except the red IAC Driver) and restarted the device... and it showed as "Teensy MIDI"
- I took the device to our iMac elsewhere in the house, which has never seen the device (and does not have anything in MIDI Studio) and it appears as "Teensy MIDI"

Hmmm...
Any other ideas?

I do have this in my PlatformIO.ini
...
build_flags = -D USB_MIDI_SERIAL
...

I have also tried it with
build_flags = -D USB_MIDI

No change to the behavior to always presenting "Teensy MIDI"
 
Same behavior as before... Resurrecting this thread, hoping for an answer.
I have this code in my PlatformIO project in VS Code - a file called MIDI_Name.c
Code:
// To give your USB MIDI device a unique name, this code must be placed into a .c file (its own tab).  It can not be in a .cpp file or your main sketch (the .ino file).
#include "usb_names.h"

// Edit these lines to create your own name.  The length must match the number of characters in your custom name.
#define MIDI_NAME   {'D','i','g','i','B','r','a','s','s','-','M','I','D','I'}
#define MIDI_NAME_LEN  14

// 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
};

My platformIO.ini file starts with this:
[env:teensy31]
platform = teensy
board = teensy31
framework = arduino
build_flags = -D USB_MIDI_SERIAL -D TEENSY_PLATFORM

My MIDI Studio on the Mac shows this:
MIDI Studio Screenshot.jpg
and I'd like into say DigiBrass-MIDI instead of Teensy MIDI

I've tried:
  • Deleting the Teensy MIDI item from the MIDI Studio
  • Rebooting the Mac

Also, I just confirmed the same behavior with the Arduino IDE v2.1.1, Teensy loader 1.58,
and the unmodified example program at File > Examples > Teensy > USB_MIDI > MIDI_name
noted on this page.

What else might I try?
 
Last edited:
Unplug the device and delete the Teensy MIDI object in the MIDI Studio (just select it and hit delete), then plug the teensy again and should pop up as the new one. For me that worked like a charm when change the MIDI device name and Mac
 
Solved.
I had the midi.c file in a subdirectory within my Platform project in VS Code.
Placing the file in the /src directory solved the problem.
It seems that files in the /src are always included. Files elsewhere, only when referenced by one of the above.
Obvious to most, perhaps. (and now to me)
 
Back
Top