-
Notifications
You must be signed in to change notification settings - Fork 0
Step 1: create your sketch
Alex Simon edited this page Feb 20, 2015
·
5 revisions
In order for the sketch to work, we some extra functionality: the MIDI library.
- Download MIDILibrary 4.2 here
- Unzip
- Move the folder into your
Documents/Arduino/libraries
folder.
When you boot Arduino IDE the next time you should see the following:
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
#define CHANNEL 1
void setup() {
// Initiate MIDI communications, listen to all channels
MIDI.begin(MIDI_CHANNEL_OMNI);
}
void sendNote(byte note, byte velo, byte channel) {
MIDI.sendNoteOn(note, velo, channel); // Send a Note
delay(1000); // Wait
MIDI.sendNoteOff(note, 0, channel); // Stop the note
}
void loop() {
sendNote(24, 127, CHANNEL);
delay(2000);
}