MIDI Control Surface library for Arduino
|
Go to the documentation of this file.
26 #if defined(ARDUINO) && defined(DEBUG_OUT)
34 ExtendedIOElement::beginAll();
69 ExtendedIOElement::updateAllBufferedInputs();
77 ExtendedIOElement::updateAllBufferedOutputs();
102 #ifdef DEBUG_MIDI_PACKETS
104 if (midimsg.
type != PROGRAM_CHANGE && midimsg.
type != CHANNEL_PRESSURE)
116 if (midimsg.
type == MIDIMessageType::CONTROL_CHANGE &&
119 DEBUG(
F(
"Reset All Controllers"));
122 }
else if (midimsg.
type == MIDIMessageType::CONTROL_CHANGE &&
126 if (midimsg.
type == MIDIMessageType::CONTROL_CHANGE) {
128 DEBUGFN(
F(
"Updating CC elements with new MIDI message."));
131 }
else if (midimsg.
type == MIDIMessageType::NOTE_OFF ||
132 midimsg.
type == MIDIMessageType::NOTE_ON) {
134 DEBUGFN(
F(
"Updating Note elements with new MIDI message."));
137 }
else if (midimsg.
type == MIDIMessageType::CHANNEL_PRESSURE) {
139 DEBUGFN(
F(
"Updating Channel Pressure elements with new "
142 }
else if (midimsg.
type == MIDIMessageType::PROGRAM_CHANGE) {
144 DEBUGFN(
F(
"Updating Program Change elements with new "
153 #ifdef DEBUG_MIDI_PACKETS
154 const uint8_t *data = msg.
data;
158 for (
size_t i = 0; i < len; i++)
191 if (thisDisplay != previousDisplay) {
194 previousDisplay = thisDisplay;
197 displayElement.draw();
A super class for object that have to be updated regularly.
virtual void display()=0
Write the frame buffer to the display.
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.
An interface for displays.
static void beginAll()
Initialize all displays.
bool hasSinkPipe() const
Check if this source is connected to a sink pipe.
Print & dec(Print &printer)
constexpr uint8_t All_Notes_Off
#define BEGIN_CS_NAMESPACE
uint8_t header
MIDI status byte (message type and channel).
Struct for easily matching MIDI messages.
A class that reads and filters an analog input.
SysExMessageCallback sysExMessageCallback
Timer< micros > potentiometerTimer
A timer to know when to update the analog inputs.
void disconnectSinkPipes()
Disconnect all sink pipes that this source sinks to (recursively).
void disconnectMIDI_Interfaces()
Disconnect Control Surface from the MIDI interfaces it's connected to.
An abstract base class for Extended Input/Output elements.
bool hasSourcePipe() const
Check if this sink is connected to a source pipe.
#define FATAL_ERROR(msg, errc)
Print the error message and error code, and stop the execution.
void begin()
Initialize or reset the timer. The timer will fire immediately.
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 sendImpl(uint8_t header, uint8_t d1, uint8_t d2, uint8_t cn)
Low-level function for sending a 3-byte MIDI message.
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
void sourceMIDItoPipe(ChannelMessage)
Send a MIDI Channel Message.
void disconnectSourcePipes()
Disconnect all source pipes that sink to this sink (recursively).
Timer< micros > displayTimer
A timer to know when to refresh the displays.
Print & hex(Print &printer)
#define DEBUG_OUT
The debug output.
bool connectDefaultMIDI_Interface()
Connect Control Surface to the default MIDI interface.
void sinkMIDIfromPipe(ChannelMessage msg) override
Accept an incoming MIDI Channel message.
#define DEBUGFN(x)
Print an expression and its function (function name and line number) to the debug output if debugging...
void clearAndDrawBackground()
Clear the frame buffer, and draw the custom background.
static DoublyLinkedList< DisplayElement > & getAll()
Get the list of all DisplayElement instances.
void updateInputs()
Update all MIDIInputElements.
RealTimeMessageCallback realTimeMessageCallback
#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,...
Print & endl(Print &printer)
ChannelMessageCallback channelMessageCallback
void begin()
Initialize the Control_Surface.
constexpr uint8_t Reset_All_Controllers