Reading MIDI data sent out on USB Host, from a PC

browncauk

Member
Hi,

I have built a Teensy 4 device that emits MIDI messages via USB, MIDI DIN and USB Host. This allows users to connect multiple devices via different means. E.g. Ableton on USB, a Synth on MIDI DIN OUT, a Keyboard on MIDI DIN IN and a Launchpad on USB Host. All this works lovely.

20230504_100409.jpg

What I'm trying to do is build a test application that can detect MIDI messages from all three output ports. Previously I tested it all by plugging in various pieces of hardware and testing manually but I'm trying to automate this to make the process faster.

I'm using Windows and have written a C# app that can detect the USB MIDI and MIDI DIN output messages. However, I cannot find a way to detect messages sent out over USB Host.

I don't really want to have to write a Windows USB driver if I don't have to. Nor do I want to use a separate device (e.g. a little teensy device that just echoes a MIDI message).

Does anyone have any suggestion on how I might connect the USB Host to the PC and detect the messages?

Cheers for your help.

Chris
 
Without something in the middle, you can't. The PC is only a USB host and you can't connect two hosts together (only host to a device).
 
Thanks for the response. I'm not looking to connect it as a MIDI device. My thinking is that it's just Com port data, so I wanted only to read the data stream. I wondered if there were any tools/mechanisms available for this. I'll keep digging.
 
USB host ports can not communicate with each other. Unless your PC has very special USB device hardware, which does exist on some single board computers like Beaglebone and some Raspberry Pi but is pretty much unheard of for regular PCs, the USB ports are host only.

Host-only ports just can't talk to each other. No amount of wishful thinking and software trickery can change this fundamental fact about the way USB works. Not even a custom Windows driver can change this. The nature of USB host is baked into the host controller hardware.


Nor do I want to use a separate device (e.g. a little teensy device that just echoes a MIDI message).

I know you don't want to go this route, but it really is the most realistic way.


My thinking is that it's just Com port data, so I wanted only to read the data stream.

COM port is the high level view you see from Windows. On the Teensy side, you get simple functions like available(), read(), println(). Underneath is the very complicated USB protocol. It is so much more than just a simple data stream!
 
That makes a lot of sense. Thanks for taking the time to respond.

I've already begun sketching out the test device :)
 
Back
Top