How to use MIDI with arduino or teensy



  1. modify your code and verify it before you push the reset on the teensy, to make sure it works.
  2. Use my version of control-surface uploaded here. That version has modified .hpp files that are crucial for making this code work on teensy 4.0 xp120. The default code scans lines too fast and causes the right column to send ghost notes to other keys in that column randomly.

If you choose to download control-surface from github, you need to alter the code in these .hpp files.

There, you would change the delayMicroseconds number to 500.

To install the control-surface library. Open Teensyduino, navigate to sketch>include library>add zip

To change your pitches, simply type in what numbers you want, along with the CHANNEL number in NoteButtonMatrix. You can have spaces between numbers, but don’t change any commas or }.

Choose these settings under tools. MIDI, 24MHz, “Fast”. Then verify that it works, and upload.

For anyone using this code with another teensy. You can download control-surface from github.

You will need to change the AddressMatrix row/column numbers. And then change NoteButtonMatrix numbers, as well as your own row/column pins used.