Skip to content
MIDI for Arduino
C++ Python Arduino C Shell
Find file
Pull request Compare This branch is 5 commits ahead, 5 commits behind master.
Failed to load latest commit information.
doc Examples. Jun 11, 2014
res Examples. Jun 11, 2014
src Fixed #30 Feb 27, 2015
.gitignore Reworked packaging script. Apr 16, 2014 Readme Jun 11, 2014 Updated docs. Apr 16, 2014
arduino_midi_library.sublime-project Ignoring python stuff. Apr 16, 2014
library.json Fix comma Sep 29, 2014

Arduino MIDI Library v4.2

This library enables MIDI I/O communications on the Arduino serial ports. The purpose of this library is not to make a big synthetizer out of an Arduino board, the application remains yours. However, it will help you interfacing it with other MIDI devices.

Download the latest version here.


  • Compatible with all Arduino boards (and clones with an AVR processor)
  • Simple and fast way to send and receive every kind of MIDI message (including all System messages, SysEx, Clock, etc..).
  • OMNI input reading (read all channels).
  • Software Thru, with message filtering.
  • Callbacks to handle input messages more easily.
  • Last received message is saved until a new one arrives.
  • Configurable: overridable template-based settings.
  • Create more than one MIDI port for mergers/splitters applications.
  • Use any serial port, hardware or software.


  • 11/06/2014 : Version 4.2 released. Bug fix for SysEx, overridable template settings.
  • 16/04/2014 : Version 4.1 released. Bug fixes regarding running status.
  • 13/02/2014 : Version 4.0 released. Moved to GitHub, added multiple instances & software serial support, and a few bug fixes.
  • 29/01/2012 : Version 3.2 released. Release notes are here
  • 06/05/2011 : Version 3.1 released. Added callback support.
  • 06/03/2011 : Version 3.0 released. Project is now hosted on SourceForge.
  • 14/12/2009 : Version 2.5 released.
  • 28/07/2009 : Version 2.0 released.
  • 28/03/2009 : Simplified version of MIDI.begin, Fast mode is now on by default.
  • 08/03/2009 : Thru method operational. Added some features to enable thru.

Warning: this library requires Arduino 1.0 or more recent versions.

What do I need to do?

  • Download the library (link)
  • Follow the installation instructions there:
  • Include the library in your sketch using the menu in the IDE, or type #include <MIDI.h>
  • Create the MIDI instance using MIDI_CREATE_DEFAULT_INSTANCE(); or take a look at the documentation for custom serial port, settings etc..

You are now ready to use the library. Look at the reference page to learn how to use it, or the examples given. Just don't forget to enable the I/O communications with MIDI.begin...


See the extended reference here (Mirror).

Using MIDI.begin

In the setup() function of the Arduino, you must call the MIDI.begin() method. If you don't give any argument to this method, the input channel for MIDI in will be set to 1 (channels are going from 1 to 16, plus `MIDI_CHANNEL_OMNI to listen to all channels at the same time).

This method will:

  • Start the serial port at the MIDI baudrate (31250)
  • Set the input channel at the argument given (if any, else 1)
  • Enable Soft Thru, without filtering (everything at the input is sent back)


The MIDI Thru allows you to redirect your incoming messages to the MIDI output. It replaces the need of a MIDI Thru connector, as it copies every valid incoming message from the input. For good performance, you might want to call read() in a fast loop, for low latency.

Incoming unread bytes/messages are kept in the Arduino serial buffer, in order not to flood it, check regularily with See the reference for Thru explanations.

Thru is enabled by default, you can turn it off using appropriate methods.


Take a look at the schematic


if you have any comment or support request to make, feel free to contact me:

You can also get informations about bug fixes and updates on my twitter account: @fortysevenfx.

Something went wrong with that request. Please try again.