MIDI USB Host: looking for clarification on "Interface_16x16" example

XFer

Well-known member
Hello,
I have already built a few MIDI devices based upon the Teensy 3.6, thanks to its USB host port.
Usually I connect a (single) MIDI controller to the host port and then process the MIDI messages it sends.

Now I would like to build a device where one can plug more MIDI USB devices to the host port.
Say a controller (AKAI MPK25, for example) and a synth module (say Behringer JT-4000).

Let's say I want to forward MIDI messages from the Akai keyboard to the Behringer synth.

How do I recognize if a MIDI device connected to the host port is a "controller" or a "receiver", that is a keyboard (which sends notes to be played) or a synth module (which plays the received notes)?

I looked at the example in the title ("Interface_16x16.ino"), but it just forwards all non-sysex messages from any device to any other device, without checking the role of the device (controller or sound module).

Or maybe I'm missing something obvious?

Thanks for any suggestion
Fernando
 
Last edited:
How do I recognize if a MIDI device connected to the host port is a "controller" or a "receiver", that is a keyboard (which sends notes to be played) or a synth module (which plays the received notes)?

Unfortunately, there is no good answer. I believe this is the sort of question the (very complicated) new MIDI 2.0 protocol aims to solve.

Best you could probably do, if you know the specific USB MIDI devices in advance, it call the functions to get their USB VID and PID numbers. That should at least let you tell them apart and know which is which. But of course it's not a generic solution that can work if you plug in any other USB MIDI device.
 
Thank you Paul. I was suspecting something like that. Maybe the USB device descriptor/capabilities/infos etc. could give some hint too, I'll look into that.
 
Back
Top