|
1 | | -#Arduino MIDI Library v4.2 |
| 1 | +# Arduino MIDI Library |
2 | 2 |
|
3 | | -This library enables MIDI I/O communications on the Arduino serial ports. |
4 | | -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. |
| 3 | +[](https://travis-ci.org/FortySevenEffects/arduino_midi_library) |
| 4 | +[](https://coveralls.io/github/FortySevenEffects/arduino_midi_library) |
| 5 | +[](https://github.com/FortySevenEffects/arduino_midi_library/releases/latest) |
| 6 | +[](LICENSE) |
5 | 7 |
|
6 | | -Download the latest version [here](https://github.com/FortySevenEffects/arduino_midi_library/releases/latest). |
| 8 | +This library enables MIDI I/O communications on the Arduino serial ports. |
7 | 9 |
|
8 | 10 | ### Features |
9 | | -* Compatible with all Arduino boards (and clones with an AVR processor) |
| 11 | +* Compatible with all Arduino boards (and clones with an AVR processor). |
10 | 12 | * Simple and fast way to send and receive every kind of MIDI message (including all System messages, SysEx, Clock, etc..). |
11 | 13 | * OMNI input reading (read all channels). |
12 | 14 | * Software Thru, with message filtering. |
13 | 15 | * [Callbacks](http://playground.arduino.cc/Main/MIDILibraryCallbacks) to handle input messages more easily. |
14 | 16 | * Last received message is saved until a new one arrives. |
15 | | -* Configurable: [overridable template-based settings](http://arduinomidilib.fortyseveneffects.com/a00013.html#details). |
| 17 | +* Configurable: [overridable template-based settings](https://github.com/FortySevenEffects/arduino_midi_library/wiki/Using-custom-Settings). |
16 | 18 | * Create more than one MIDI port for mergers/splitters applications. |
17 | 19 | * Use any serial port, hardware or software. |
18 | 20 |
|
| 21 | +### Getting Started |
19 | 22 |
|
20 | | -#### Changelog |
21 | | -* 11/06/2014 : Version 4.2 released. Bug fix for SysEx, overridable template settings. |
22 | | -* 16/04/2014 : Version 4.1 released. Bug fixes regarding running status. |
23 | | -* 13/02/2014 : Version 4.0 released. Moved to GitHub, added multiple instances & software serial support, and a few bug fixes. |
24 | | -* 29/01/2012 : Version 3.2 released. Release notes are [here](http://sourceforge.net/news/?group_id=265194) |
25 | | -* 06/05/2011 : Version 3.1 released. Added [callback](http://playground.arduino.cc/Main/MIDILibraryCallbacks) support. |
26 | | -* 06/03/2011 : Version 3.0 released. Project is now hosted on [SourceForge](http://sourceforge.net/projects/arduinomidilib). |
27 | | -* 14/12/2009 : Version 2.5 released. |
28 | | -* 28/07/2009 : Version 2.0 released. |
29 | | -* 28/03/2009 : Simplified version of MIDI.begin, Fast mode is now on by default. |
30 | | -* 08/03/2009 : Thru method operational. Added some features to enable thru. |
31 | | - |
32 | | - |
33 | | - |
34 | | -**__Warning: this library requires Arduino 1.0 or more recent versions.__** |
35 | | - |
36 | | - |
37 | | -### What do I need to do? |
38 | | - |
39 | | -* Download the library ([link](https://github.com/FortySevenEffects/arduino_midi_library/releases/latest)) |
40 | | -* Follow the installation instructions there: http://arduino.cc/en/Guide/Libraries |
41 | | -* Include the library in your sketch using the menu in the IDE, or type `#include <MIDI.h>` |
42 | | -* Create the MIDI instance using `MIDI_CREATE_DEFAULT_INSTANCE();` or take a look at the documentation for custom serial port, settings etc.. |
43 | | - |
44 | | -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... |
45 | | - |
| 23 | +1. Use Arduino's Library Manager to install the library. |
| 24 | +2. Start coding: |
| 25 | + ```c++ |
| 26 | + #include <MIDI.h> |
46 | 27 |
|
47 | | -##Reference |
| 28 | + // Created and binds the MIDI interface to the default hardware Serial port |
| 29 | + MIDI_CREATE_DEFAULT_INSTANCE(); |
48 | 30 |
|
49 | | -See the extended reference [here](http://arduinomidilib.fortyseveneffects.com) ([Mirror](http://fortyseveneffects.github.io/arduino_midi_library/)). |
| 31 | + void setup() |
| 32 | + { |
| 33 | + MIDI.begin(MIDI_CHANNEL_OMNI); // Listen to all incoming messages |
| 34 | + } |
50 | 35 |
|
51 | | -### Using MIDI.begin |
| 36 | + void loop() |
| 37 | + { |
| 38 | + // Send note 42 with velocity 127 on channel 1 |
| 39 | + MIDI.sendNoteOn(42, 127, 1); |
52 | 40 |
|
53 | | -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). |
| 41 | + // Read incoming messages |
| 42 | + MIDI.read(); |
| 43 | + } |
| 44 | + ``` |
54 | 45 |
|
55 | | -This method will: |
56 | | -* Start the serial port at the MIDI baudrate (31250) |
57 | | -* Set the input channel at the argument given (if any, else 1) |
58 | | -* Enable Soft Thru, without filtering (everything at the input is sent back) |
| 46 | +3. Read the [documentation](#documentation) or watch the awesome video tutorials from [Notes & Volts](https://www.youtube.com/playlist?list=PL4_gPbvyebyH2xfPXePHtx8gK5zPBrVkg). |
59 | 47 |
|
| 48 | +## Documentation |
60 | 49 |
|
| 50 | +- [Doxygen Extended Documentation](http://fortyseveneffects.github.io/arduino_midi_library/). |
| 51 | +- [GitHub wiki](https://github.com/FortySevenEffects/arduino_midi_library/wiki). |
61 | 52 |
|
62 | | -### MIDI Thru |
63 | | - |
64 | | -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. |
65 | | - |
66 | | -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. |
67 | | - |
68 | | -Thru is enabled by default, you can turn it off using appropriate methods. |
69 | | - |
70 | | - |
71 | | -### Hardware |
| 53 | +## Contact |
72 | 54 |
|
73 | | -Take a look at [the MIDI.org schematic](http://www.midi.org/techspecs/electrispec.php) |
| 55 | +To report a bug, contribute, discuss on usage, or simply request support, please [create an issue here](https://github.com/FortySevenEffects/arduino_midi_library/issues/new). |
74 | 56 |
|
| 57 | +You can also get informations about bug fixes and updates on my twitter account: [@fortysevenfx](http://twitter.com/fortysevenfx). |
75 | 58 |
|
76 | | -## Contact |
77 | | -if you have any comment or support request to make, feel free to contact me: francois.best@fortyseveneffects.com |
| 59 | +## License |
78 | 60 |
|
79 | | -You can also get informations about bug fixes and updates on my twitter account: [@fortysevenfx](http://twitter.com/fortysevenfx). |
| 61 | +MIT © 2016 [Francois Best](http://fortyseveneffects.com) |
0 commit comments