Crash Course to Midi with Teensyduino: Part 2

This is part two of what should be covered before we start putting together our step pedal midi controller. I covered a little about what midi messages were in Part 1. Now we’ll cover how to make your Teensy device send these midi messages. Specifically, I am using a Teensy 3.1.

What is a Teensy 3.1?

Teensy 3.1 is a USB development board that uses a MK20DX256VLH7¬†microchip, developed and sold by PJRC. It has a smaller footprint than most common Arduino boards and is unique in that we can turn it into a midi device that can be sensed by a PC without any additional drivers or programs installed. (If you know of an alternative board that doesn’t need to be hacked to work like this, let me know!) There is a newer model that exists, Teensy 3.2, and this should work similarly to the 3.1.

What is Teensyduino?

Teensyduino is a software add-on for the Arduino. It allows someone to use the Arduino program to also create sketches for a Teensy or Teensy++ device. Most Arduino sketches (what we call a code file) are usable with a Teensy. This add-on will allow us to switch the device to MIDI USB mode, and is required to get your sketch onto the Teensy board.

How do I turn a Teensy into a PC detectable midi device?

After installing Teensyduino (and Arduino), you will be able to select your Teensy board under Tools > Board. After selecting an applicable board, you can change it’s USB Type in the Tools menu as well. Some USB Types include “Serial” (the mode Arduinos are normally in when programmed), “Keyboard + Mouse + Joystick” (great for creating your own game controllers), “MIDI” (what we will use for this project), and a few others.

How do I send a midi message?

Teensyduino comes with some useful libraries that will allow us to send midi messages through the USB. PJRC offers some good documentation on their website here in regards to the midi library functions. For this project, we will be interested in the following midi functions:

We will also be using the Bounce library to easily detect when when step buttons are pushed so that a setting can be placed “on” or “off” and not rely on the switch staying in the “on” state (voltage high). It does an excellent job at ignoring chatter inherent in mechanical buttons.


Alright, I’m eager to start working with some physical parts! First, let’s set up a few buttons.

Leave a Message!

Your email address will not be published. Required fields are marked *