multiple usb teensy MIDI

Hello there - my first post, so please be patient.

Got interested in teensy last year, for DIY midi controllers. I've no background in electronics or programming, but enjoy experimenting. Been using MIDI sequencers for a number of years, though. I'm a fairly tactile person, dissatisfied with the feel and layout of midi controllers I've used, so thought I'd have a go at building my own, to control the software/plugins that I use the most. How hard can it be ? :) Metal cases, metal knobs, prominent visual indicators, something that feels sturdy.

Ran through the tutorials, and I've got a few little projects up and running, based around breadboards in project boxes:

a controller for peavey revalver, with 8 cheap button rotary encoders, 1 higher res optical encoder and a 1602 LCD display via a spi piggyback board. Used a shift register for the buttons, to increase cc values from the encoders at higher rate, as these cheap detent encoders only 20 or 24 counts for a full turn, can't remember which.

a cubase track inspector controller, with 3 rotary encoders with buttons, (for track select, balance, output gain), 1 higher res optical encoder for input level, 9 LED button switches (for record enable, mute, solo, monitor etc) and a 1.44 SPI display. Used two MCP23017 chips for buttons and LED control, resistor ladder chip to protect LEDs.

a kush hammer controller, with 3 button encoders (to select frequency), 3 334 line motor encoders (for cut/boost), 1.44 SPI display, 5 led buttons (bands in/out, bypass etc). 595 and 165 shift registers, resistor ladder for LEDs.

Got a few more projects on the go, but I have a question.

Got them all working individually, and bidirectionally - so, eg, pressing record enable button on box sets record enable in sequencer, and pressing record enable on sequencer illuminates record enable on box, same with encoder values for cc's. Fairly pleased with progress, it's been quite a learning curve for me.

However, when I plug more than one in at once, they don't work in cubase. Three teensy's are visible, and all work correctly at the same time in midiox. All are visible in cubase, but only one will work. Tried using midox as midi merge via loopbe virtual midi port, but didn't work, seemed to be in a very slow feedback loop, downloaded copperlan to try same, but that only shows one teensy present. Hmm.

So, my question is:

is the issue with my coding, or is using more than one teensy usbmidi at the same time not possible using win7 class compliant driver? Tried looking around the forums, but couldn't find anything specific, so thought I'd ask.

I've made a couple of smaller controllers using nano's and midi shields as they were cheap off ebay from China, for inserts, edit buttons, transport controls, which work very well, but of course each of these boxes need their own physical MIDI in/out. Rapidly running out of MIDI ports. Been looking at the iconnectivity MIO, as that appears to accept usb midi class compliant devices via a hub, but not sure if that will accept multiple instances of teensy and treat them as separate devices. If anyone has any experience with this, that would be appreciated, as if it will, then I'll probably buy one.

So, sorry if a little long winded. As an aside, I'm using some aluminium boxes from diyerzone, but because my projects look like rats nests, the wiring means that I can't physically put the top on the cases:). So, guess I'll need to look into making circuit boards next. Guess I'll be having lots of questions in the future....

Thank you for your patience.

Paul.
 
Hi,

Did you see the MIDI_name example in Examples/Teensy/USB_MIDI? This shows how to change the name of your MIDI device, perhaps it will work if you give different names to each device.

regards,

Gerrit
 
if changing names doesn't work you can change product IDs too but (last I heard) only by altering the core library document "usb_desc.h"

Not sure what conflicts you could cause doing that....
 
Ah, I didn't have the MIDI_name in the examples - latest teensyduino wouldn't install in my version of the arduino ide (1.66). I've updated arduino now, along with the latest teensyduino, and will take a closer look at that next time I have some free time.

I did try changing the product ID in the usb_desc.h, and device manager just showed an unknown device. Put it back to how it was, think I need to read up on that a little more before I'm comfortable with what I'm doing :)

Thanks for your advice.

Paul.
 
Quick follow up - after some tribulations. After uninstalling arduino and updating the IDE, some libraries, particularly ILI9163, no longer worked. Bugger. So, easiest thing seemed to be have two versions, but of course, libraries seemed to be problematic. Ended up I installed 1.6.9 on main PC, and latest one on a spare PC. Relieved I got them to work again - 9163 in particular, as I'd needed to re-amend the settings.h file to adjust the pixel offset :) Tried the MIDI_name, and have renamed one of the teensy controllers - this worked, in that it now appears as "kush eq" in midiox and cubase, but still shows as teensy MIDI in device manager. Still doesn't like playing at the same time, though, but for now, I can at least use 2 teensy controllers together - one on PC1, one on PC2, using copperlan and vmidi. Got a couple of other things to try, but reckon that hardware MIDI port is probably the most elegant way to go. Thanks for your interest.

Paul.
 
hi, so I had this same problem when I converted 2 old pioneer cdj 800 to midi. each one had a teensy in and when I plugged them in It wouldn't always give them the same name/number. my solution was to set Traktor scratch midi out to all and have one teensy on ch1 and one of ch2. traktor would send midi to both at the same time and each one would just respond to it's own channel. It's not the most efficient way, but it works.
 
Hi,

Did you see the MIDI_name example in Examples/Teensy/USB_MIDI? This shows how to change the name of your MIDI device, perhaps it will work if you give different names to each device.

regards,

Gerrit

I am using the latest teensyduino on a TeensyLC board. I can't seem to find the MIDI_name example. Can someone post the URL of the example?
 
I am using the latest teensyduino on a TeensyLC board. I can't seem to find the MIDI_name example. Can someone post the URL of the example?

The example is in the Arduino IDE, look under File > Examples > Teensy > USB_MIDI

Kind regards,

Gerrit
 
I never did find the USB_MIDI examples. I thought I saw them there in the past, but they are not there now. I have done some uninstalls and re-installs and wonder if I messed something up somewhere.

I did find the info someplace else and got it working. But now have created a new problem.

I made changes in the desc.h file to both the name and the ID number to make it work. I read that the number is cached somewhere so if you just want to tweek the name you can't use the same ID number because it returns the old name. So the question is, how do you clear the cache??
 
I never did find the USB_MIDI examples.

Maybe this screenshot can help?

sc.png
(click for full size)


This image is with the latest beta. For older versions, you click the same menu. It should have 4 samples in pre-1.41 versions.
 
Hi,

I am new to Teensy too and want to build a midi controller. I started with the MIDI_name example. I uploaded it to my Teensy 3.6, but it comes up listed as "Teensy MIDI" instead of "My MIDI", which is what I was expecting.

I am using a Macbook running OSX 10.11.3. and Arduino software 1.8.5.

I checked in the Audio MIDI setup application on my Mac, in Ableton Live and in Max software. It was listed as Teensy MIDI in all of those things. Anything I am doing wrong?

I will have lot's more questions, but maybe I can figure this out first.

Thank You!

Nick
 
Here's what I learned...
1. Open your Sketch in the Arduino IDE
2. On the right hand side near the top you will see a down arrow. Click it an select "New Tab"
3. Name the New Tab "name.c", all lower case
4. Copy this code into name.c

// 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','S',' ','2','C',' ','A','C',' ','V','0','0','1'}
#define MIDI_NAME_LEN 13

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

5. Modify the MIDI_NAME making sure you use the exact format (One character in single quotes, separated by a comma. A space is also one character)
6. Modify the MIDI_NAME_LEN to match the number of characters
7. Don't change anything else
8. When you save the sketch it will also save the name.c file with it

Compile the sketch as normal and you should see a new device name.

This is all shown in one of the examples, but thought it might be easier for non-programmers to have the steps written out. Hope it helps.
 
Hi,

Thank you tenorjazz for your reply. That's pretty much what I did the first time. I tried it again. This time I looked under About This Mac / System Report / Hardware / USB and I can see the device name listed there as a USB device. So the naming worked, but it's just not recognized by the Audio MIDI Setup application, or any of the music software that I use. It's not that big of a deal though, I can work with this. I'm going to move on to hooking up sensors and other things to see if I can get that working.

Thank You.
 
Hi,

Thank you tenorjazz for your reply. That's pretty much what I did the first time. I tried it again. This time I looked under About This Mac / System Report / Hardware / USB and I can see the device name listed there as a USB device. So the naming worked, but it's just not recognized by the Audio MIDI Setup application, or any of the music software that I use. It's not that big of a deal though, I can work with this. I'm going to move on to hooking up sensors and other things to see if I can get that working.

Thank You.

It should show up in the Audio MIDI setup. Are you sure you selected MIDI or Serial + MIDI under Tools>USB Type ?

Kind regards,

Gerrit
 
Hi Gerrit,

Yes, I selected MIDI under USB type. I added the name.c tab from the MIDI_name example to the analog control change example, and I am getting midi data into my computer, so I know that my Teensy is working, and the midi function is working.

Do you have a mac? and in your Audio Midi setup does it show up as a custom name?

thanks, Nick
 
Hi Gerrit,

Yes, I selected MIDI under USB type. I added the name.c tab from the MIDI_name example to the analog control change example, and I am getting midi data into my computer, so I know that my Teensy is working, and the midi function is working.

Do you have a mac? and in your Audio Midi setup does it show up as a custom name?

thanks, Nick

Yes I have a Mac and the Teensy shows up with a custom name.

Here's the content of my name.c file:

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 MIDI_NAME   {'Z','e','u','s','D','P','C'}
#define MIDI_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
};


Kind regards,

Gerrit
 
Hi, I wanted to update everyone on this. I plugged my Teensy into a new macbook from 2018 and it showed up in the audio midi setup as the name I gave it, so it worked. My computer is 10 years old, so maybe that has something to do with why it doesn't work on my computer.

Thank you
 
Hi, I wanted to update everyone on this. I plugged my Teensy into a new macbook from 2018 and it showed up in the audio midi setup as the name I gave it, so it worked. My computer is 10 years old, so maybe that has something to do with why it doesn't work on my computer.

Thank you

To see the name change you have to unplug the Teensy device and delete it from Audio Midi Setup and then plug it back in.

The usb midi device is cached so apps that use it as a midi device will still show it even when it’s disconnected and you don’t have to reconfigure it every time it’s unplugged.
 
Gday all.

New member here, old hand at soldering, relative noob to the world of MCU's, Midi hardware etc. Setup: Win7-64, Win XP, Assorted synths and other goodies. a clutch of USB - Midi interfaces including an iCconnectivity MIO-10, several self-build Midi controllers using Arduino Megas.

WRT the MIO-10's Usb Host port and Teensy.

I used the Teensy example code for the interface_3x3, board type Teensy 3.2, USB type Serial + MIDI x4, uploaded ok.

Tested in Win7 and XP and all 3 Midi ports show up in Midiox, and I can send stuff to it and make the led blink, so I guess it's working, tho have yet to hook it to the outside world.

The USB host port on the iConnectivity MIO-10 does not see the Teensy.

So then starting out with the interface_3x3 code , I modded it to a 1x1, selected USB Type to MIDI, re-uploaded and as expected Win7 and Win XP and the iCconnectivity MIO-10 all see the Teensy as a 1x1 Midi interface and can throw Midi at it via Modiox or Copperlan and make the led flash.

I then plugged it into a different Win7 system which has had no arduino or Teensy software installed and when Win was sorting driver details, it popped up with the usual unknown hardware dialog, two out of three boxes sporting a green tick, but the one called Usb composite device got the red cross. Nevertheless, The Teensy 3x3 Midi Interface showed up correctly and the led flashed as before.

I want to use a Teensy 3.5 for it's 6 Uarts as a 6x6 Midi interface and at this point see that the thing will work into either Win7 or WinXP.

So naturally, my burning question is .. how do we get the MIO-10 to recognise a Teensy 6x6. Given that the 3x3 seemed to work as a Midi interface on a Win7 host despite the "composite device" driver issue having not been sorted... begs a subroutine kinda question.. Is the Mio-10 not accepting the Teensy 3x3 coz it can't deal with the "composite device" issue..

Any ideas?
 
From looking through the manual, it’s likely this setting here that makes it not recognize the Teensy correctly when there’s more than one port.

21F2361D-79B0-4E41-B89E-44A8BEEC0035.jpg

This should be set at or above the max number of Teensy usbMIDI ports you are trying use, hope this solves the issue.
 
Hey thanks.

This should be set at or above the max number of Teensy usbMIDI ports you are trying use, hope this solves the issue.

Have tried that to no avail. I recall reading that the MIO-10 USB host allows the connection of ONE hub only so if the Teensy >1x>1 interface appears to the host as a hub... Next step, plugged the Teensy 3x3 directly into the MIO-10 USB host port, and this was no go as well.

For the sake of the learning, will plug the Beatstep Pro (multiport class compliant) into the MIO's USB host and see what MIO has to say..

Cheers for now..

...somewhat later.

The MIO-10 usb host finds both ports in the Beatstep Pro and a BCR2000. Hmmmm.. just not the Teensy multiport.
 
Last edited:
Hi there, I am using three Teensy2.0++ as USB Midi-Devices to control Traktor. Two of them work fine, but with three the problems/bugs/freezes start.
This is because it is not possible to give each Teensy an individual device-name as mentioned above by tenorjazz - this is only possible since Teensy3.x. So Traktor gots problems to differentiate between the there Teensys.

So I wonder if there is a "hack" to still make individual device-names possible. I stumbled across this tutorial, but my skills are too limited to make sense of it: https://liveelectronics.musinou.net/MIDIdeviceName.php

Can anybody tell me if this method would even work for a Teensy2.0?
 
I am using 2 identical midi devices based on Teensy 3.6, and compiled identical code for the two except for different names ("GND-1" and "GND-1 B") using the MIDI_NAME method. But if I have both devices plugged in when I start up midi software like MidiOx or CakeWalk (windows 10), the two device names are shown as identical so I can't tell which is which. That common name, GND-1 or GND-1 B depends on which teensy is plugged into one of the two usb ports.

I can only get both names showing correctly if I plug in one device, start the midi software, set midi devices, then plug in the second midi device and go to set midi devices again. Clearly this is not a good solution for users of my device.

Is there anything that can be done on the Teensy side that can remedy this?
 
Back
Top