MIDI Control Surface library for Arduino
|
Go to the documentation of this file.
26 #if defined(ARDUINO) && defined(DEBUG_OUT)
31 ExtendedIOElement::beginAll();
61 FATAL_ERROR(
F(
"No default MIDI interface is selected."), 0xDEAD);
75 #ifdef DEBUG_MIDI_PACKETS
91 DEBUG(
F(
"Reset All Controllers"));
99 DEBUGFN(
F(
"Updating CC elements with new MIDI message."));
104 DEBUGFN(
F(
"Updating Note elements with new MIDI message."));
109 DEBUGFN(
F(
"Updating Channel Pressure elements with new "
114 DEBUGFN(
F(
"Updating Program Change elements with new "
124 #ifdef DEBUG_MIDI_PACKETS
125 const uint8_t *data = msg.
data;
129 for (
size_t i = 0; i < len; i++)
164 if (thisDisplay != previousDisplay) {
167 previousDisplay = thisDisplay;
170 displayElement.draw();
A super class for object that have to be updated regularly.
virtual void display()=0
Write the frame buffer to the display.
const uint8_t CHANNEL_PRESSURE
An interface for elements that draw to a display.
static MIDI_Interface * getDefault()
Return the default MIDI interface.
bool isEnabled()
Check if this display is enabled.
void updateDisplays()
Clear, draw and display all displays.
virtual void update()=0
Read the MIDI interface and call the callback if a message is received.
uint8_t getCN() const
Return the cable number of the received message.
SysExMessage getSysExMessage() const
Return the received system exclusive message.
An abstract class for MIDI interfaces.
An interface for displays.
static void beginAll()
Initialize all displays.
virtual void setCallbacks(MIDI_Callbacks *cb)=0
Set the callbacks that will be called when a MIDI message is received.
constexpr uint8_t All_Notes_Off
#define BEGIN_CS_NAMESPACE
Struct for easily matching MIDI messages.
A class that reads and filters an analog input.
SysExMessageCallback sysExMessageCallback
MIDI_Interface & MIDI()
Get the MIDI interface of the Control Surface.
Timer< micros > potentiometerTimer
A timer to know when to update the analog inputs.
An abstract base class for Extended Input/Output elements.
#define FATAL_ERROR(msg, errc)
Print the error message and error code, and stop the execution.
void begin()
Initialize the timer.
void updateMidiInput()
Update all MIDI interfaces to receive new MIDI events.
constexpr unsigned long defaultBaudRate
The default baud rate for debug output.
void loop()
Update all MIDI elements, send MIDI events and read MIDI input.
static Control_Surface_ & getInstance()
Return the static Control_Surface_ instance.
void onSysExMessage(Parsing_MIDI_Interface &midi) override
The callback to be called when a MIDI System Exclusive message is received.
ChannelMessage getChannelMessage()
Return the received channel message.
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
Timer< micros > displayTimer
A timer to know when to refresh the displays.
virtual void begin()
Initialize the MIDI Interface.
const uint8_t PROGRAM_CHANGE
#define DEBUG_OUT
The debug output.
Print & hex(Print &printer)
void onRealtimeMessage(Parsing_MIDI_Interface &midi, uint8_t message) override
The callback to be called when a MIDI Real-Time message is received.
#define DEBUGFN(x)
Print an expression and its function (function name and line number) to the debug output if debugging...
void onChannelMessage(Parsing_MIDI_Interface &midi) override
The callback to be called when a MIDI channel message is received.
void clearAndDrawBackground()
Clear the frame buffer, and draw the custom background.
Print & endl(Print &printer)
static DoublyLinkedList< DisplayElement > & getAll()
Get the list of all DisplayElement instances.
void updateInputs()
Update all MIDIInputElements.
RealTimeMessageCallback realTimeMessageCallback
An abstract class for MIDI interfaces.
Print & dec(Print &printer)
#define DEBUG(x)
Print an expression to the debug output if debugging is enabled.
This class ensures initialization, updating, and interaction between all other classes,...
ChannelMessageCallback channelMessageCallback
void begin()
Initialize the Control_Surface.