MIDI Control Surface library for Arduino
|
Go to the documentation of this file.
46 void send(uint8_t m, uint8_t c, uint8_t d1, uint8_t d2);
58 void send(uint8_t m, uint8_t c, uint8_t d1);
74 void sendOnCable(uint8_t m, uint8_t c, uint8_t d1, uint8_t d2, uint8_t cn);
88 void sendOnCable(uint8_t m, uint8_t c, uint8_t d1, uint8_t cn);
120 void send(
const uint8_t (&sysexdata)[N], uint8_t cn = 0) {
124 void send(uint8_t rt, uint8_t cn = 0);
130 virtual void update() = 0;
164 virtual void sendImpl(uint8_t m, uint8_t c, uint8_t d1, uint8_t d2,
169 virtual void sendImpl(uint8_t m, uint8_t c, uint8_t d1, uint8_t cn) = 0;
174 virtual void sendImpl(
const uint8_t *data,
size_t length, uint8_t cn) = 0;
179 virtual void sendImpl(uint8_t rt, uint8_t cn) = 0;
216 uint8_t
getCN()
const;
static MIDI_Interface * DefaultMIDI_Interface
static MIDI_Interface * getDefault()
Return the default MIDI interface.
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.
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.
An abstract class for MIDI interfaces.
bool dispatchMIDIEvent(MIDI_read_t event)
virtual void setCallbacks(MIDI_Callbacks *cb)=0
Set the callbacks that will be called when a MIDI message is received.
#define BEGIN_CS_NAMESPACE
void sendCP(MIDICNChannel address, uint8_t pressure)
Send a MIDI Channel Pressure event.
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)
void setCallbacks(MIDI_Callbacks &cb)
Set the callbacks that will be called when a MIDI message is received.
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.
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.
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.
virtual void begin()
Initialize the MIDI Interface.
MIDI_Callbacks * callbacks
MIDI_Parser & getParser()
A class for saving a MIDI channel and cable number.
void sendNoteOff(MIDICNChannelAddress address, uint8_t velocity)
Send a MIDI Note Off event.
virtual ~MIDI_Callbacks()=default
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.
A class for callbacks from MIDI input.
An abstract class for MIDI interfaces.
void setCallbacks(MIDI_Callbacks *cb) override
Set the callbacks that will be called when a MIDI message is received.
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)
void send(const uint8_t(&sysexdata)[N], uint8_t cn=0)
Send a MIDI System Exclusive message.