see http://mbed.org/users/okini3939/notebook/midi/
Dependencies: MIDI USBDevice mbed
Fork of MIDI_sample by
Diff: main.cpp
- Revision:
- 0:1a4d28e63bef
- Child:
- 1:ecf5c3927710
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Dec 03 14:24:33 2012 +0000 @@ -0,0 +1,20 @@ +#include "mbed.h" +#include "MIDI.h" + +DigitalOut led1(LED1), led2(LED2); + +MIDI midi(p9, p10); + +int main() { + midi.begin(4); + + for (;;) { + if (midi.read()) { + led1 = 1; + midi.sendNoteOn(42,127,1); // Send a Note (pitch 42, velo 127 on channel 1) + wait(1); + midi.sendNoteOn(42,0,1); // Stop the note + led1 = 0; + } + } +}