MIDI Control Surface library for Arduino
|
Go to the documentation of this file.
103 ERROR(
F(
"Error: invalid SysEx length"), 0x7F7F);
140 #pragma GCC diagnostic push
141 #pragma GCC diagnostic ignored "-Wswitch-enum"
152 #pragma GCC diagnostic pop
ChannelMessage getChannelMessage()
Get the latest MIDI channel message.
static MIDI_Interface * DefaultMIDI_Interface
const uint8_t CHANNEL_PRESSURE
static MIDI_Interface * getDefault()
Return the default MIDI interface.
uint8_t getCN() const
Return the cable number of the received message.
void send(uint8_t m, uint8_t c, uint8_t d1, uint8_t d2)
Send a 3-byte MIDI packet.
virtual MIDI_read_t read()=0
SysExMessage getSysExMessage() const
Return the received system exclusive message.
MIDI_Interface()
Constructor.
bool dispatchMIDIEvent(MIDI_read_t event)
constexpr uint8_t getRawChannel() const
Get the channel [0, 15].
#define BEGIN_CS_NAMESPACE
void sendCP(MIDICNChannel address, uint8_t pressure)
Send a MIDI Channel Pressure event.
constexpr uint8_t getCableNumber() const
Get the cable number [0, 15].
void sendKP(MIDICNChannelAddress address, uint8_t pressure)
Send a MIDI Key Pressure event.
void sendNoteOn(MIDICNChannelAddress address, uint8_t velocity)
Send a MIDI Note On event.
virtual void onSysExMessage(Parsing_MIDI_Interface &midi)
virtual void onRealtimeMessage(Parsing_MIDI_Interface &midi, uint8_t message)
void update() override
Read the MIDI interface and call the callback if a message is received.
#define ERROR(msg, errc)
Print the error message and error code, and stop the execution if FATAL_ERRORS are enabled.
Parsing_MIDI_Interface(MIDI_Parser &parser)
Construct a MIDI interface with the given parser.
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
ChannelMessage getChannelMessage()
Return the received channel message.
constexpr uint8_t getAddress() const
Get the address [0, 127].
virtual void onChannelMessage(Parsing_MIDI_Interface &midi)
virtual void sendImpl(uint8_t m, uint8_t c, uint8_t d1, uint8_t d2, uint8_t cn)=0
Low-level function for sending a 3-byte MIDI message.
void sendPB(MIDICNChannel address, uint16_t value)
Send a MIDI Pitch Bend event.
MIDI_Callbacks * callbacks
const uint8_t PROGRAM_CHANGE
A class for saving a MIDI channel and cable number.
void sendNoteOff(MIDICNChannelAddress address, uint8_t velocity)
Send a MIDI Note Off event.
virtual uint8_t getCN() const
Get the cable number of the latests MIDI message.
void sendOnCable(uint8_t m, uint8_t c, uint8_t d1, uint8_t d2, uint8_t cn)
Send a 3-byte MIDI packet with cable number.
void setAsDefault()
Set this MIDI interface as the default interface.
virtual SysExMessage getSysEx() const =0
Get the latest SysEx message.
constexpr uint8_t getRawChannel() const
Get the channel as an integer [0, 15].
An abstract class for MIDI interfaces.
void sendCC(MIDICNChannelAddress address, uint8_t value)
Send a MIDI Control Change event.
virtual ~MIDI_Interface()
Destructor.
void sendPC(MIDICNChannelAddress address)
Send a MIDI Program Change event.
void onRealtimeMessage(uint8_t message)
constexpr uint8_t getCableNumber() const
Get the cable number [0, 15].
const uint8_t KEY_PRESSURE