From ad9ba0da58aa8d9f1bfa849110d544b769e8e2de Mon Sep 17 00:00:00 2001 From: Francois Best Date: Thu, 6 Sep 2012 11:16:53 +0200 Subject: [PATCH] Cleaning up examples. --- res/Examples/MIDI_Callbacks/MIDI_Callbacks.ino | 7 +++++-- res/Examples/MIDI_Input/MIDI_Input.ino | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/res/Examples/MIDI_Callbacks/MIDI_Callbacks.ino b/res/Examples/MIDI_Callbacks/MIDI_Callbacks.ino index 36d980e..b2bdb3d 100644 --- a/res/Examples/MIDI_Callbacks/MIDI_Callbacks.ino +++ b/res/Examples/MIDI_Callbacks/MIDI_Callbacks.ino @@ -6,8 +6,8 @@ // see documentation here: // http://arduinomidilib.sourceforge.net/class_m_i_d_i___class.html -void HandleNoteOn(byte channel, byte pitch, byte velocity) { - +void HandleNoteOn(byte channel, byte pitch, byte velocity) +{ // Do whatever you want when you receive a Note On. if (velocity == 0) { @@ -33,4 +33,7 @@ void loop() { MIDI.read(); // There is no need to check if there are messages incoming if they are bound to a Callback function. + // The attached method will be called automatically when the corresponding message has been received. } + + diff --git a/res/Examples/MIDI_Input/MIDI_Input.ino b/res/Examples/MIDI_Input/MIDI_Input.ino index 5ecb07d..0187a62 100644 --- a/res/Examples/MIDI_Input/MIDI_Input.ino +++ b/res/Examples/MIDI_Input/MIDI_Input.ino @@ -30,7 +30,7 @@ void setup() { void loop() { if (MIDI.read()) { // Is there a MIDI message incoming ? switch(MIDI.getType()) { // Get the type of the message we caught - case ProgramChange: // If it is a Program Change + case midi::ProgramChange: // If it is a Program Change BlinkLed(MIDI.getData1()); // Blink the LED a number of times // correponding to the program number // (0 to 127, it can last a while..)