MIDI
Control MIDI equipment!
Library
Import Library:
http://mbed.org/projects/cookbook/svn/MIDI/trunk
Hardware
gnd
|
o
tx ----[ 220R ]----o o----[ 220R ]---- +3.3v
o o
(view from back of socket)
Hello World
Press middle C for 1 second
#include "mbed.h"
#include "MIDI.h"
MIDI midi(p13, p14);
int main() {
midi.noteon(60);
wait(1);
midi.noteoff(60);
}
|
| Source Code of MIDIHelloWorld.bin (LPC1768 LPC2368)
|
MIDI API
| MIDI | A MIDI port, used for sending MIDI commands to e.g. |
| Functions | |
| MIDI | Create a MIDI port connected to the specified serial pins |
| noteon | Send a Note On Message |
| noteoff | Send a Note Off Message |
| pitch | Send a Pitchbend Message |
| controller | Send a Continuous Controller Message |
| patch | Send a Patch Change Message |
See MIDI/trunk/MIDI.h for full details
Examples
See Also
Development Notes
Some notes/links that are useful for developement of the library itself...
| Command Name | Code | Parameter 1 | Parameter 2
|
| Note-off | 0x8<c> | Key | Velocity
|
| Note-on | 0x9<c> | Key | Veolcity
|
| Aftertouch | 0xA<c> | Key | Touch
|
| Continuous controller | 0xB<c> | Controller | Value
|
| Patch change | 0xC<c> | Instrument | -
|
| Channel Pressure | 0xD<c> | Pressure | -
|
| Pitch bend | 0xE<c> | LSB (0-127) | MSB (0-127)
|