In this tutorial we are going to create a working MIDI Player which can be connected up to a USB MIDI device like a Keyboard, Drum Set etc.
To complete the building we need the following components
- USB Host Board (either Mini or Standard) with the MIDI software installed. This allows you to plug in a USB MIDI device and outputs MIDI strings via its serial port at the standard MIDI rate of 31250 baud.
- Teensy 3.1. This is the brains of the MIDI Player and will contain all the MIDI code
- Teensy Audio Adapter. This allows you to output CD quality audio via the stereo headphone and stereo line-level output.
- USB MIDI Device. We are using an Akai keyboard
Here are the assembled components
USB MIDI Keyboard
Wiring it up
Connection of components is very simple. We need to supply the USB Host board with 5V and GND from the Teensy board and also connect the Teensy's RX0 input (pin 0) to the USB Host boards TX pin. See the following pictures
|Teensy 3.1 with Audio board underneath|
|Connections on the back of the Audio board which go to the USB Host board|
USB Host Board
Mini or Standard board
The Teensy board is programmed using the Arduino IDE (check Teensy website for supported version). Along with the Arduino software you will need the following libraries and the MIDI Player example.