MIDI-Input-Callback
This is an example on how to attach your own callbacks for receiving MIDI input data.
- Boards: 🛈
- AVR, AVR USB, Nano Every, Due, Nano 33 IoT, Nano 33 BLE, UNO R4, Pi Pico, Teensy 3.x, ESP32, ESP8266
Connections
None.
Behavior
- When MIDI messages are sent to the USB interface, they are printed to the Serial port.
Mapping
None.
Written by PieterP, 2019-08-07
https://github.com/tttapa/Control-Surface
Serial << F(
"Channel message: ") << hex
<<
cm.header <<
' ' <<
cm.data1 <<
' ' <<
cm.data2
<< dec << F(
" on cable ") <<
cm.cable.getOneBased() <<
endl;
return true;
}
Serial << F(
"System Exclusive message: [") <<
se.length <<
"] "
<< F(
" on cable ") <<
se.cable.getOneBased() <<
endl;
return true;
}
Serial <<
F(
"System Common message: ") << hex
<<
sc.header <<
' ' <<
sc.data1 <<
' ' <<
sc.data2
<< dec <<
F(
" on cable ") <<
sc.cable.getOneBased() <<
endl;
return true;
}
<< hex <<
rt.message << dec
<<
F(
" on cable ") <<
rt.cable.getOneBased() <<
endl;
return true;
}
sysExMessageCallback,
sysCommonMessageCallback,
realTimeMessageCallback);
}
void loop() {
}
The main header file that includes all Control-Surface header files.
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
void setMIDIInputCallbacks(ChannelMessageCallback channelMessageCallback, SysExMessageCallback sysExMessageCallback, SysCommonMessageCallback sysCommonMessageCallback, RealTimeMessageCallback realTimeMessageCallback)
Set the MIDI input callbacks.
void begin()
Initialize the Control_Surface.
void loop()
Update all MIDI elements, send MIDI events and read MIDI input.
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)