MIDI Control Surface library for Arduino
|
Go to the documentation of this file.
18 template <
class Derived>
200 virtual void sendImpl(uint8_t header, uint8_t d1, uint8_t d2,
205 virtual void sendImpl(uint8_t header, uint8_t d1, uint8_t cn) = 0;
210 virtual void sendImpl(
const uint8_t *data,
size_t length, uint8_t cn) = 0;
A type-safe class for MIDI channels.
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
void send(const uint8_t(&sysexdata)[N], Cable cable=CABLE_1)
Send a MIDI System Exclusive message.
ChannelMessage getChannelMessage()
Get the latest MIDI channel message.
A super class for object that have to be updated regularly.
static MIDI_Interface * DefaultMIDI_Interface
static MIDI_Interface * getDefault()
Return the default MIDI interface.
A type-safe class for MIDI USB Cable numbers.
SysExMessage getSysExMessage() const
Return the received system exclusive message.
An abstract class for MIDI interfaces.
virtual void onRealTimeMessage(Parsing_MIDI_Interface &midi)
Callback for incoming MIDI Real-Time Messages.
void sendNoteOn(MIDIAddress address, uint8_t velocity)
Send a MIDI Note On event.
void sendKP(MIDIAddress address, uint8_t pressure)
Send a MIDI Key Pressure event.
virtual void sendImpl(const uint8_t *data, size_t length, uint8_t cn)=0
Low-level function for sending a system exclusive MIDI message.
A class for saving a MIDI channel and cable number.
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 sinkMIDIfromPipe(ChannelMessage) override
Accept an incoming MIDI Channel message.
void sendOnCable(MIDIMessageType m, Channel c, uint8_t d1, uint8_t d2, Cable cable)
Send a 3-byte MIDI packet with cable number.
virtual void onSysExMessage(Parsing_MIDI_Interface &midi)
Callback for incoming MIDI System Exclusive Messages.
void sendPC(MIDIAddress address)
Send a MIDI Program Change event.
void update() override
Read the MIDI interface and call the callback if a message is received.
A struct that is both a TrueMIDI_Sink and a TrueMIDI_Source.
void send(MIDIMessageType m, Channel c, uint8_t d1, uint8_t d2, Cable cable=CABLE_1)
Send a 3-byte MIDI packet.
Parsing_MIDI_Interface(MIDI_Parser &parser)
Construct a MIDI interface with the given parser.
virtual void onChannelMessage(Parsing_MIDI_Interface &midi)
Callback for incoming MIDI Channel Messages (notes, control change, pitch bend, etc....
MIDI_Callbacks * callbacks
void begin() override
Initialize the MIDI Interface.
MIDI_Parser & getParser()
bool dispatchMIDIEvent(MIDIReadEvent event)
virtual void sendImpl(uint8_t header, uint8_t d1, uint8_t d2, uint8_t cn)=0
Low-level function for sending a 3-byte MIDI message.
virtual ~MIDI_Callbacks()=default
Destructor.
Statically polymorphic template for classes that send MIDI messages.
MIDI_Interface()=default
Constructor.
RealTimeMessage getRealTimeMessage()
Get the latest MIDI real-time message.
void sendCC(MIDIAddress address, uint8_t value)
Send a MIDI Control Change event.
void sendPB(MIDIChannelCN address, uint16_t value)
Send a MIDI Pitch Bend event.
void setAsDefault()
Set this MIDI interface as the default interface.
MIDIReadEvent
Result of the MIDI interface read methods.
void sendNoteOff(MIDIAddress address, uint8_t velocity)
Send a MIDI Note Off event.
virtual void sendImpl(uint8_t rt, uint8_t cn)=0
Low-level function for sending a single-byte MIDI message.
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.
virtual MIDIReadEvent read()=0
Try reading and parsing a single incoming MIDI message.
void update() override=0
Read the MIDI interface and call the callback if a message is received.
virtual void sendImpl(uint8_t header, uint8_t d1, uint8_t cn)=0
Low-level function for sending a 2-byte MIDI message.
virtual SysExMessage getSysExMessage() const =0
Get the latest SysEx message.
void sendCP(MIDIChannelCN address, uint8_t pressure)
Send a MIDI Channel Pressure event.
virtual ~MIDI_Interface()
Destructor.
ChannelMessage getChannelMessage() const
Return the received channel message.
MIDI_Interface(MIDI_Interface &&)=default
RealTimeMessage getRealTimeMessage() const
Return the received real-time message.