Cleaning up examples.
This commit is contained in:
parent
ea96fbd211
commit
ad9ba0da58
|
|
@ -6,8 +6,8 @@
|
||||||
// see documentation here:
|
// see documentation here:
|
||||||
// http://arduinomidilib.sourceforge.net/class_m_i_d_i___class.html
|
// 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.
|
// Do whatever you want when you receive a Note On.
|
||||||
|
|
||||||
if (velocity == 0) {
|
if (velocity == 0) {
|
||||||
|
|
@ -33,4 +33,7 @@ void loop() {
|
||||||
MIDI.read();
|
MIDI.read();
|
||||||
|
|
||||||
// There is no need to check if there are messages incoming if they are bound to a Callback function.
|
// 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.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ void setup() {
|
||||||
void loop() {
|
void loop() {
|
||||||
if (MIDI.read()) { // Is there a MIDI message incoming ?
|
if (MIDI.read()) { // Is there a MIDI message incoming ?
|
||||||
switch(MIDI.getType()) { // Get the type of the message we caught
|
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
|
BlinkLed(MIDI.getData1()); // Blink the LED a number of times
|
||||||
// correponding to the program number
|
// correponding to the program number
|
||||||
// (0 to 127, it can last a while..)
|
// (0 to 127, it can last a while..)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue