Personal Mirror
Go to file
lathoub 1e14162bf4
rewrote AltPinSerial to use SoftwareSerial
2020-04-20 13:08:49 +02:00
.vscode chore: Config file update 2018-11-07 12:09:47 +01:00
builder feat: Increase warning level for sources 2018-03-10 17:44:16 +01:00
doc Added support for Active Sensing and SysEx command segments (v4.4.0) (#138) 2020-04-08 10:36:10 +02:00
examples rewrote AltPinSerial to use SoftwareSerial 2020-04-20 13:08:49 +02:00
external chore: Update Google Test & remove USBMIDI 2020-04-17 08:15:01 +02:00
res Added library manager screenshot 2017-08-25 15:29:07 +02:00
src fix: Use SysEx size in Settings 2020-04-17 08:15:42 +02:00
test Added support for Active Sensing and SysEx command segments (v4.4.0) (#138) 2020-04-08 10:36:10 +02:00
.editorconfig chore: Add VSCode config files & editor settings 2018-10-11 10:32:26 +02:00
.gitignore Added support for Active Sensing and SysEx command segments (v4.4.0) (#138) 2020-04-08 10:36:10 +02:00
.gitmodules chore: Update Google Test & remove USBMIDI 2020-04-17 08:15:01 +02:00
.travis.yml added AltPinSerial example 2020-04-19 21:37:39 +02:00
CMakeLists.txt Moved stuff to builder. Added code coverage. 2016-10-08 02:36:15 +02:00
CONTRIBUTING.md fix: correct sequence of commands for submodules 2017-10-08 09:49:36 +02:00
LICENSE Added badges and license file. 2016-10-03 12:04:44 -07:00
README.md added USB Migration and other Transport mechanisms 2020-04-17 22:09:06 +02:00
ReleaseNotes.md Updated readme. 2016-11-02 10:01:33 +01:00
keywords.txt Added support for Active Sensing and SysEx command segments (v4.4.0) (#138) 2020-04-08 10:36:10 +02:00
library.json Added support for Active Sensing and SysEx command segments (v4.4.0) (#138) 2020-04-08 10:36:10 +02:00
library.properties Added support for Active Sensing and SysEx command segments (v4.4.0) (#138) 2020-04-08 10:36:10 +02:00

README.md

Arduino MIDI Library

Build Status Coveralls GitHub release License

This library adds MIDI I/O communications to an Arduino board.

Features

  • New : USB MIDI Device support with MIDIUSB.
  • 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 interface for mergers/splitters applications.
  • Use any serial port, hardware or software.

Getting Started

  1. Use the Arduino Library Manager to install the library. Type "MIDI" in the Arduino IDE Library Manager

  2. Start coding:

#include <MIDI.h>

// Create and bind the MIDI interface to the default hardware Serial port
MIDI_CREATE_DEFAULT_INSTANCE();

void setup()
{
    MIDI.begin(MIDI_CHANNEL_OMNI);  // Listen to all incoming messages
}

void loop()
{
    // Send note 42 with velocity 127 on channel 1
    MIDI.sendNoteOn(42, 127, 1);

    // Read incoming messages
    MIDI.read();
}
  1. Read the documentation or watch the awesome video tutorials from Notes & Volts.

USB Migration

All USB related code has been moved into a separate repository Arduino-USB-MIDI, USB MIDI Device support with MIDIUSB, still using this library to do all the MIDI heavy-lifting.

Migration has been made as easy as possible: only the declaration of the MIDI object has been modified, the code remains identical.

4.3.1 code:

    #include <MIDI.h>
    #include <midi_UsbTransport.h>
    
    static const unsigned sUsbTransportBufferSize = 16;
    typedef midi::UsbTransport<sUsbTransportBufferSize> UsbTransport;
    
    UsbTransport sUsbTransport;
    
    MIDI_CREATE_INSTANCE(UsbTransport, sUsbTransport, MIDI);
    ...

become in 5.0.0

    #include  <USB-MIDI.h>
    USBMIDI_CREATE_DEFAULT_INSTANCE();
    ...

Start with the NoteOnOffEverySec example that is based on the original MidiUSB sketch. Note the only difference is in the declaration.

The USB-MIDI Arduino library depends on this library and the MIDIUSB library.

USB-MIDI uses the latest Arduino IDE depends feature in the library.properties file installing all the dependencies automatically when installing from the IDE.

Other Transportation mechanisms

Version 5 of this library, allows for other Transportation layers than the original MIDI 1.0 Electrical Specification.

All these Transportation layers use this library for all the underlying MIDI work, making it easy to switch transport protocols or making transport protocol bridges.

Documentation

Contact

To report a bug, contribute, discuss on usage, or simply request support, please create an issue here.

You can also contact me on Twitter: @fortysevenfx.

License

MIT © 2009 - present Francois Best