USB Midi on teensy 4.0

Status
Not open for further replies.
Hello! Im trying to build a digital synthesizer and I need to be able to read the output of a MIDI keyboard on the teensy and then create waveforms based on the MIDI signals.

My question, however, only pertains to the actual MIDI communication. All the examples I can find use USB midi library (https://www.pjrc.com/teensy/td_midi.html), programmed through Arduino IDE.
I'm supposed to select MIDI as the USB type, but this option is not available to me. I only see serial when I have the teensy 4.0 selected.
Why is this? What does this option even enable and is it possible to enable the same functionality manually?
Does anybody have another approach that I should use instead?

Kind regards,
Frederik.
 
USB MIDI device mode (not yet supported on Teensy 4.0) is used for Teensy to communicate with your PC or Mac. You'd normally use that if you're making a MIDI controller.

For connecting a MIDI keyboard to Teensy, you'd use either USBHost_t36 (if the keyboard is a USB interface) or the MIDI library (if old-style MIDI with the 5 pin DIN connector). The good news is both of those work on Teensy 4.0.
 
On GitHub ( USBHost_t36/examples/Serial/MIDI/InputFunctions/InputFunctions.ino ), I see in the example that I am still supposed to select the the USB type as midi. "You must select MIDI from the "Tools > USB Type" menu" is written as a comment in the beginning of the file. I still can only select serial. Can I ignore this, or is there a way to manually select MIDI in a setup file etc?.
 
USB MIDI device mode (not yet supported on Teensy 4.0) is used for Teensy to communicate with your PC or Mac. You'd normally use that if you're making a MIDI controller.

For connecting a MIDI keyboard to Teensy, you'd use either USBHost_t36 (if the keyboard is a USB interface) or the MIDI library (if old-style MIDI with the 5 pin DIN connector). The good news is both of those work on Teensy 4.0.

I've copy pasted the example sketch mentioned in the above comment, and have connected the MIDI keyboard to the T4 USB port through a simple USB-A to micro-USB board (This also allows me to probe the connection).

When I power up the teensy and keyboard, the D+ pin simply goes high, indicating full-speed mode and then nothing more happens.
Did I misunderstand how to use the usbhost_t36 library?
 
Run the File > Examples > USBHost_t36 > Test > Test example.
Hi Paul. I might not get it, but is Main USB works as host too? I've tried to run Test example for my Teensy 4.0 in two ways:

1. Connecting to PC and sending Midi thru PureData as in this tutorial with 3.6: https://www.youtube.com/watch?v=qWd60HWCCVI
2. Connecting USB keyboard directly to USB, I've changed sound in NoteOn listeners instead of printing to serial.

Both ways failed with any MIDI events handling. Nothing at all. Does it mean I need to solder 2nd USB as host or something else?
Thanks
 
but is Main USB works as host too?

No, the main USB connector is only supported as USB device.

For USB host on Teensy 4.0, you need to access the bottom side pads. Details here:

https://www.pjrc.com/breakout-board-for-teensy-4-0/

Remember to consider USB power. If you wire the USB host power directly to Teensy 4.0 power without any current limiting chip, hot plugging USB devices is likely to crash or reboot your Teensy because of the sudden power drain.
 
Status
Not open for further replies.
Back
Top