Best way to get MIDI input

pirko2001

Member
Hello, I was wondering what would be the best way to get MIDI input in the Teensy so it could work as a standalone synth.

The best options I could think of are:
- using 5-pin DIM connector for MIDI and using a library to control it
- making a MIDI to CV converter and using analog in to control pitch
- building a keyboard from scratch.

As I don't have a lot of electronic parts laying around it would be amazing if I could use the USB input of the Teensy but this isn't possible?
Anyways would be nice to hear some opinions I still have a lot to learn so sorry if I missed something very obvious.
Thanks!!
 
@pirko2001: Take a look <here> for the recommended traditional serial MIDI circuitry. In addition to this traditional serial MIDI in/out, the T4.x also supports MIDI in/out over the primary USB interface (the microUSB connector that's used to program & monitor it), as well as MIDI in/out over the USHhost interface (the 5-pin connector, to which you can connect most any other MIDI device thru a connected host cable, e.g. keyboard, sequencer, or even a USB hub to allow multiple simultaneous devices, etc.). MIDI on the Teensy is very easy, and the audio library capabilities are fantastic !!

Mark J Culross
KD5RXT
 
@pirko2001: Take a look <here> for the recommended traditional serial MIDI circuitry. In addition to this traditional serial MIDI in/out, the T4.x also supports MIDI in/out over the primary USB interface (the microUSB connector that's used to program & monitor it), as well as MIDI in/out over the USHhost interface (the 5-pin connector, to which you can connect most any other MIDI device thru a connected host cable, e.g. keyboard, sequencer, or even a USB hub to allow multiple simultaneous devices, etc.). MIDI on the Teensy is very easy, and the audio library capabilities are fantastic !!

Mark J Culross
KD5RXT
Hello, I found a Teensy 4.0! Would you say it is possible to connect a micro USB -> USB hub to the primary USB interface?
E200-SERT_125150_01.png


Then I could use one USB port for powering the Teensy and the other for MIDI keyboard input.

The alternative would be power the Teensy via the VIN but I can't seem to understand what I have to cut in what way for the VIN to not be connected to VUSB.

The other alternative is connecting the keyboard to USB Host, but I can't seem to find how to connect USB to D- & D+

Anyways, thanks a lot and sorry if these are very basic things!
 
Would you say it is possible to connect a micro USB -> USB hub to the primary USB interface?

Then I could use one USB port for powering the Teensy and the other for MIDI keyboard input.

No, that definitely will not work.

Teensy's main USB port only supports USB device mode. It can only communicate with a USB host. It can't possibly communicate with another USB device. For that, you must use Teensy's USB host port.


The other alternative is connecting the keyboard to USB Host, but I can't seem to find how to connect USB to D- & D+

Yes, this is the way. Refer to the pinout card (PDF if you don't have the original card that shipped with Teensy). The D+ and D- host signals are at these small pads on the bottom side.

1736165391917.png
 
Last edited:
If you're not familiar with USB host vs device mode, here's a copy of the USB 2.0 spec. (you can also get it for free at usb.org if you dig deep...)


Start on page 15 (the 43rd page in the PDF). This document is huge, but the essential explanation of host vs device vs hub is only a few pages.

The most important point is you must have exactly 1 host, and the communication is always between the host and whatever device it chooses. USB device can never communicate with each other. They only talk to the 1 and only USB host, and only as the host allows because the host is in control of when all communication occurs.

This is why you must use Teensy's USB host port if you want to connect a USB device like a MIDI keyboard.
 
Ah thank you, perfect!
8b6mslgmgt581.jpeg

So now I understand how to connect D+ & D- (and also GND), what would be the best port to connect V? VUSB or 3.3V?
Thanks again! I'm a noob in USB things so I'll definitely check out the specification you sent :)
Greetings,
Pier
 
USB devices want 5 volt power. Most can work with as low as 4 volts. Some even work if you give them only 3.3V, but that's not recommended.

The main issue is what happens if your USB device draws too much current. This is actually 2 different issues, the normal steady current it needs to run, and the "inrush" current if you hot-plug it. Obviously you can avoid the inrush problem it you permanently connect the device. But if it's pluggable, be aware you the inrush current can cause your whole power supply to drop too low and Teensy will shut off and reboot when the power comes back up only milliseconds later. On Teensy 4.1 we have a special chip and 100uF capacitor to manage the inrush current. On Teensy 4.0, you're on your own for this (just adding a big capacitor without the chip causes too much inrush current when you plug Teensy into your PC...)
 
Back
Top