MIDI IN on Teensy?

Status
Not open for further replies.

Mike5000

Well-known member
I want to experiment with different Audio filters cutoff frequencies and different compressor settings on the fly on my Teensy 3.6 (I have the audio shield connected).

Instead of doing one setting at a time in C++ code and having to recompile, I would like to use a USB MIDI controller with rotary encoders and different buttons etc to vary the settings on the fly and adjust until the audio is good. Then I can must faster find the correct settings.

How can I achieve this on the Teensy 3.6?

The best would be to connect the midi controller to the pc as it has an USB port, and then the PC would "relay" the midi commands to the Teensy via its USB port (otherwise I would need to unplug and plug in the PC programming USB cable everytime I want to upload new firmware to the Teensy). To achieve that I guess I need some kind of "midi server" on the PC.

I havent been involved in Midi for 20years or so ... way before USB ports became available so I am a bit rusty on how MIDI is done nowadays.

Is there any example code that I can use for MIDI IN?
How do I do this relaying thing on the PC? What software for that ?
 
Part of the issue is on the PC side where you would need a MIDI application or utility to send thru MIDI.

A Teensy 3.6 can act as a MIDI host so you could send MIDI for the controller without a PC.

Or a hardware interface for DIN MIDI could be used to connect any Teensy directly to a controller.
https://www.pjrc.com/teensy/td_libs_MIDI.html

See the Recieve section of the USB MIDI page for how to handle the Teensy side.
https://www.pjrc.com/teensy/td_midi.html
 
To connect a USB MIDI controller directly to your Teensy 3.6 (no need to route data through your PC), you'd use this cable and the USBHost_t36 library.

https://www.pjrc.com/store/cable_usb_host_t36.html

This cable is exactly the same as used by most PC motherboards for USB 2.0 ports, so if you have a spare cable that goes from the motherboard to a slot cover or front panel, it should work.

To get started, in Arduino click File > Examples > USBHost_t36 > MIDI > InputFunctions. Run this and open the serial monitor. As you use your MIDI controller, you should see lines appear with info about the MIDI messages Teensy is receiving. From there, you'd put your code into those handler functions to make your controller affect the audio settings.
 
Status
Not open for further replies.
Back
Top