Problem with getting two Teensys 3.6 recognized as USB MIDI Controllers

Status
Not open for further replies.

heiko

New member
Hello everyone!

First of all I'd like to thank everyone on this forum. You have helped me a lot(!), unknowingly but intensively, throughout my whole project and I'm extremely grateful for that. <3

My setup:
Arduino IDE v1.8.6, Teensyduino v1.43, Windows 7 64bit SP1 with all major updates installed.

My project:
A MIDI Controller that only sends (not receives) MIDI notes to my Computer, being picked up by my DAW: Pro Tools. My project asks for 22 capacitive touch sensors so I went for two Teensys 3.6. They both work independently from each other. I am using USBmidi in both cases and connect them individually directly to my Laptop (micro USB plug on teensy side and type A USB plug on laptop side), both are being powered through their respective USB cables.

The Problem:
Everything is working like a charme. They are being recognized as class compliant USB devices, and they show up in Windows Device Manager, all fine.
But having connected both at the same time, Pro Tools only recognizes the one that was plugged in secondly.

What I've tried so far:
I thought the problem might be that Pro Tools thinks there is only one Teensy plugged in because they both have the same name so I followed Paul's instructions here https://www.pjrc.com/teensy/td_midi.html to customize a midi name. The Device manager recognizes the different names, but again Pro Tools only recognizes the Teensy that was plugged in secondly.
You might be thinking: "This dude is having a Pro Tools related problem so it does not fit this forum" and you are kind of right; I decided to try a different DAW: Ableton Live. Here, both Teensys are being recognized; the first one is called "MyMidi A" but the second one is called "MyMidi A #2" instead of "MyMidi B" (which is what I defined it to be and which is what is shown in Windows Device Manager.

My assumption:
...is that the customized midi names [relating to the term "friendly name" (in Windows) I assume] I defined are not exactly what DAWs use to identify a USB Midi Controller. There must be some signature/serial/something value/number that helps the DAW identify the MIDI device. And still youa re thinking: "We can't help this guy, he is at the wrong forum". And you might be correct. But:
I'm asking myself if the solution to my problem could be to ensure that my two Teensys 3.6 have different "signatures/serial numbers". I went through some of the usbmidi.c and .h files trying to find more hints but I am just not finding anything useful due to too little knowledge on my side. So

My questions are:
Is there a possibility to "individualize" my two Teensys further than customzing the midi name? There must be a value that Ableton Live is able to read-out and Pro Tools isn't to distinguish between my two Teensys. Furthermore: Why is Ableton Live recognizing the second Teensy but instead of giving it my customized name it's choosing the firstly connected Teensy's name appending "#2"? Shouldn't it show my customized name (as Windows Device Manager is properly showing)?

Additional thoughts:
I have read the forum post rules and understand that screenshots, code etc. needs to be provided for people to offer proper help. However, I don't know what I should provide in my case. If you need any screenshots or my code or anything please let me know I will be more than happy to provide anything you need.
Thank you very much in advance for reading my post and helping my in any way.

Much love,
Heiko
 
hey thomasp,

thanks for pointing me to that thread. I've read everything carefully and it sounds very promising. I used the "quick workaround" that oddson suggests (https://forum.pjrc.com/threads/52734-Multiple-midi-devices?p=181349&viewfull=1#post181349) and it seems to be working. Pro Tools is now recognizing both Teensys. I will try to implement the necessary edits of usb_desc.h within the next days and keep you posted how it's going but for now I'm very happy and satisfied. thanks heaps! <3
 
Everybody always suggests to use this “quick and dirty” workaround, when all you have to do is change the serial number of each Teensy device in the same way that you change the midi device name. Coincidently I’ve always used a different serial number between all my Teensy midi devices so I’d never even heard of this being an issue and that’s the only thing I know that I do differently from everyone else.

Edit: I also know this works on Windows 7 as I have three Teensy midi controllers running simultaneously on it with no issue. As long as they have their own unique serial number they will work like they are supposed to.
 
Last edited:
sorry for my late reply.
I finally managed to get ProTools to recognize both Teensys individually, plugged in both at the same time without using the "quick and dirty workaround" but by using the methods thomasp describes in this thread. I am ver ypleased but there's one little thing that keeps bugging me: Now that my two Teensys are working in MIDI mode, they are not being recognized as serial devices by windows any more which is fine until the moment I want to change the code and upload it again. the only way then is to press the button on the teensy and that works, the problem with that is that the teensys are in a position where I can only reach their buttons with a lot(!) of effort and that's just annoying me. So I thought: Why not compile the Teensys as Serial + MIDI instead of "only" MIDI? I tried that but no ProTools doesn't like that anymore; doesn't recognize them (keep in mind that I use thomasp methods so both Teensys have their own PID).
So, thanks to your post vjmuzik I tried what you suggested (although I'm not really sure how to achieve what you are saying):
change the serial number of each Teensy device in the same way that you change the midi device name
My name.c files look like this now:
Teensy A:
// 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 MIDI_NAME {'E','x','P',' ','v','1','.','0',' ','(','W','h','i','t','e',')'}
#define MIDI_NAME_LEN 16

// 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_serial_number = {
12,
3,
{0,0,0,0,0,0,0,0,0,0}
};

Teensy B:
// 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 MIDI_NAME {'E','x','P',' ','v','1','.','0',' ','(','W','h','i','t','e',')'}
#define MIDI_NAME_LEN 16

// 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_serial_number = {
12,
3,
{0,0,0,0,0,0,0,0,0,1}
};

I'm very unsure if changing the last value of
{0,0,0,0,0,0,0,0,0,0}
from 0 to 1 is actually referring to "changing the serial number of my Teensy". In any case, compiling works fine but Windows does not recognize neither of my Teensys giving me an "Unknown Device" error after compiling/when plugging in the Teensy into the USB port/when Windows is trying to load or isntall the driver. So I guess I'm doing something wrong.
Can you please guide me into the right direction vjmuzik?

Thanks again for your help. Much(!) appreciated!
 
sorry for my late reply.
I finally managed to get ProTools to recognize both Teensys individually, plugged in both at the same time without using the "quick and dirty workaround" but by using the methods thomasp describes in this thread. I am ver ypleased but there's one little thing that keeps bugging me: Now that my two Teensys are working in MIDI mode, they are not being recognized as serial devices by windows any more which is fine until the moment I want to change the code and upload it again. the only way then is to press the button on the teensy and that works, the problem with that is that the teensys are in a position where I can only reach their buttons with a lot(!) of effort and that's just annoying me. So I thought: Why not compile the Teensys as Serial + MIDI instead of "only" MIDI? I tried that but no ProTools doesn't like that anymore; doesn't recognize them (keep in mind that I use thomasp methods so both Teensys have their own PID).
So, thanks to your post vjmuzik I tried what you suggested (although I'm not really sure how to achieve what you are saying):
My name.c files look like this now:
Teensy A:


Teensy B:


I'm very unsure if changing the last value of from 0 to 1 is actually referring to "changing the serial number of my Teensy". In any case, compiling works fine but Windows does not recognize neither of my Teensys giving me an "Unknown Device" error after compiling/when plugging in the Teensy into the USB port/when Windows is trying to load or isntall the driver. So I guess I'm doing something wrong.
Can you please guide me into the right direction vjmuzik?

Thanks again for your help. Much(!) appreciated!

Here is what my name.c looks like for my controllers, my serial number structure is different from yours as I wanted to use ASCII characters rather than numbers. Although I am fairly certain I did test just plain numbers at one point as well. The reason why I know changing the serial number works is because as I was building them and changing code every time I tested them on Windows they would appear as if I didn’t change anything because the device was already previously cached. So what I did was went back and changed the serial number to something random and when plugged back into Windows it was setup as a new device. Then when I plugged all the controllers in at once Windows had no problem recognizing each as there own device, so I’m assuming it was the serial number change that allowed that to happen because every time I’ve had them all connected they always had there own serial number. I developed them all on MacOS before I even discovered I could change the serial number and never had the issue that Windows does, as far as I’ve heard Windows is horrible when it comes to drivers and their implementation of generic ones such as usbmidi. But I can confirm that both Windows and Mac show the unique serial number when looking under the usb device information.
Code:
// 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   {'O','p','e','n',' ','L','a','b','s'}
#define MANUFACTURER_NAME_LEN  9
#define MIDI_NAME   {'N','E','K','O'}
#define MIDI_NAME_LEN  4
#define SERIAL_NUM {'E','n','c','o','d','e','r','P','a','n','e','l'}
#define SERIAL_NUM_LEN 12
#define MIDI_PORT1_NAME {'E','n','c','o','d','e','r',' ','P','a','n','e','l'}
#define MIDI_PORT1_NAME_LEN 13

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


struct usb_string_descriptor_struct usb_string_serial_number = {
        2 + SERIAL_NUM_LEN * 2,
        3,
        SERIAL_NUM
};


struct usb_string_descriptor_struct usb_string_midi_port1 = {
        2 + MIDI_PORT1_NAME_LEN * 2,
        3,
        MIDI_PORT1_NAME
};
 
Status
Not open for further replies.
Back
Top