This library enables MIDI I/O communications on the Arduino serial ports. You can send and receive messages of all kind (including System Exclusive, RealTime etc..). 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.
You can now follow the developments on SourceForge. Download the latest version here.
- Update (29/01/2012): Version 3.2 released. Release notes are here
- Update (06/05/2011): Version 3.1 released. Added callback support.
- Update (06/03/2011): Version 3.0 released. Project is now hosted on SourceForge.
- Update (14/12/2009): Version 2.5 released.
- Update (28/07/2009): Version 2 released.
- Update (28/03/2009): Simplified version of MIDI.begin, Fast mode is now on by default.
- Update (08/03/2009): Thru method operationnal. Added some features to enable thru.
After downloading the library, unzip it to the libraries folder (arduino-00xx/hardware/libraries), then reboot the Arduino IDE or compile your sketch, it will compile the library.
If you are using Mac OS X, the libraries folder is hidden in the Arduino application:
Right-click on Arduino.app, "Show package content", then put the library folder in "Contents/Resources/Java/hardware/libraries".
Include the library using the menu in the IDE, or type #include <MIDI.h>
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, or download it as PDF in the .zip archive containing the source code.
To know how to use the callback feature, see the dedicated page here.
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:
The MIDI Thru allows you to mirror 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 MIDI.read. See the reference for Thru explanations.
Thru is default enabled, you can turn it off using appropriate methods.
Take a look at the MIDI.org schematic
if you have any comment or support request to make, feel free to contact me at fortyseveneffects (at) gmail (dot) com.
You can follow the developments on SourceForge: http://sourceforge.net/projects/arduinomidilib/
You can also get informations about bug fixes and updates on my twitter account: @fortysevenfx.