MIDI to Arduino Source Code Generator


This is a tool to convert a MIDI file into Arduino source code. It will convert MIDI messages to function calls and automatically add delays for the timing. This is an educational tool - the generated programs will be a 1-to-1 conversion of the MIDI file with no optimization. It is meant to demonstrate the simplicity of programming.

What do I need?

You'll need some MIDI sequencing/notation software to create your MIDI file. Rosegarden (Linux|Windows) seems to work well and is cross-platform, but any software which can generate a MIDI file will probably work.

Quick start:

  1. Create a new file in your MIDI sequencing software - or open an existing MIDI file
  2. Find or add a track to your MIDI file and name it according to the feature you want it to control, followed by a space and the Arduino pin number to associate with it. For example, to create tones on pin 8, name the track tone 8
  3. Add note events in the track at the time you want those events to occur
  4. Save/export your MIDI file
  5. Upload your MIDI file using the form below
  6. Copy and paste the generated code into your Arduino sketch

Need to see a sample MIDI file? Try this one: midi-to-arduino-example1.mid.

Full documentation

Visit the documentation page for specific details on available features.


MIDI File:

Wanna support this project or others like it? Click here to help me out!