This is an example on how to attach your own callbacks for receiving MIDI input. This example has fine-grained callbacks, i.e. one for each message type (Note On, Note Off, Control Change, System Exclusive ...).
None.
None.
Serial <<
"Note Off: " <<
channel <<
", note " << note <<
", velocity "
<< velocity <<
", " << cable <<
endl;
}
Serial <<
"Note On: " <<
channel <<
", note " << note <<
", velocity "
<< velocity <<
", " << cable <<
endl;
}
Serial <<
"Key Pressure: " <<
channel <<
", note " << note <<
", pressure "
}
<<
", value " << value <<
", " << cable <<
endl;
}
}
<<
", " << cable <<
endl;
}
}
Serial << F(
"System Exclusive: [") <<
se.length <<
"] "
}
Serial <<
"MTC Quarter Frame: " << data <<
", " << cable <<
endl;
}
}
}
}
}
}
} callback;
}
void loop() {
}
The main header file that includes all Control-Surface header files.
A type-safe class for MIDI USB Cable numbers.
A type-safe class for MIDI channels.
void onTimeCodeQuarterFrame(uint8_t data, Cable cable)
void onPitchBend(Channel channel, uint16_t bend, Cable cable)
void onSystemReset(Cable cable)
void onContinue(Cable cable)
void onSystemExclusive(SysExMessage message)
void onActiveSensing(Cable cable)
void onProgramChange(Channel channel, uint8_t program, Cable cable)
void onNoteOff(Channel channel, uint8_t note, uint8_t velocity, Cable cable)
void onStart(Cable cable)
void onNoteOn(Channel channel, uint8_t note, uint8_t velocity, Cable cable)
void onControlChange(Channel channel, uint8_t controller, uint8_t value, Cable cable)
void onSongPosition(uint16_t beats, Cable cable)
void onTuneRequest(Cable cable)
void onSongSelect(uint8_t songnumber, Cable cable)
void onKeyPressure(Channel channel, uint8_t note, uint8_t pressure, Cable cable)
void onChannelPressure(Channel channel, uint8_t pressure, Cable cable)
void onClock(Cable cable)
void update() override
Poll the backend (if necessary) and invoke the callbacks for any received MIDI messages,...
void begin() override
Initialize.
void setCallbacks(MIDI_Callbacks *cb)
Set the callbacks that will be called when a MIDI message is received.
A class for MIDI interfaces sending MIDI messages over a USB MIDI connection.
Array< T, N > copyAs(const Array< U, N > &src)
Copy an Array to an Array of a different type.
Print & endl(Print &printer)