21 template <
class M
idiInterface>
25 template <
class M
idiInterface>
27 uint8_t channel = interface.getChannel() - 1;
28 this->midimsg.header = interface.getType() | channel;
29 this->midimsg.data1 = interface.getData1();
30 this->midimsg.data2 = interface.getData2();
35 template <
class M
idiInterface>
37 this->sysex.data = interface.getSysExArray();
38 this->sysex.length = interface.getSysExArrayLength();
43 template <
class M
idiInterface>
45 this->midimsg.header = interface.getType();
46 this->midimsg.data1 = interface.getData1();
47 this->midimsg.data2 = interface.getData2();
52 template <
class M
idiInterface>
54 this->rtmsg.message = interface.getType();
86template <
class M
idiInterface>
90 :
midi(std::forward<MidiInterface>(
midi)) {}
92 void begin()
override {
midi.begin(MIDI_CHANNEL_OMNI); }
97 auto type =
midi.getType();
178 midi.sendRealTime(
static_cast<MIDI_NAMESPACE::MidiType
>(msg.
message));
186 ERROR(F(
"Not implemented (stalled by ") << stallername <<
')', 0x1349);
MIDIReadEvent
Values returned by the MIDI reading functions.
@ CHANNEL_MESSAGE
A MIDI Channel message was received.
@ SYSCOMMON_MESSAGE
A MIDI System Common message was received.
@ NO_MESSAGE
No new messages were received.
@ SYSEX_MESSAGE
A MIDI System Exclusive message was received.
@ REALTIME_MESSAGE
A MIDI Real-Time message was received.
#define BEGIN_CS_NAMESPACE
#define AH_DIAGNOSTIC_EXTERNAL_HEADER()
#define AH_DIAGNOSTIC_POP()
#define AH_DIAGNOSTIC_WERROR()
constexpr uint8_t getOneBased() const
Get the channel as an integer.
Class that wraps the FortySevenEffects MIDI library.
ChannelMessage getChannelMessage() const
Return the received channel voice message.
RealTimeMessage getRealTimeMessage() const
Return the received real-time message.
void sendRealTimeImpl(RealTimeMessage msg) override
Low-level function for sending a MIDI real-time message.
void dispatchMIDIEvent(MIDIReadEvent event)
FortySevenEffectsMIDI_Parser parser
FortySevenEffectsMIDI_Interface(MidiInterface &&midi)
void handleStall() override
Call back that should finish any MIDI messages that are in progress, and un-stall the pipe or MIDI so...
void update() override
Read the MIDI interface and call the callback if a message was received.
void sendSysCommonImpl(SysCommonMessage msg) override
Low-level function for sending a MIDI system common message.
void sendSysExImpl(SysExMessage msg)
Low-level function for sending a system exclusive MIDI message.
void sendNowImpl() override
Low-level function for sending any buffered outgoing MIDI messages.
SysCommonMessage getSysCommonMessage() const
Return the received system common message.
void begin() override
Initialize the MIDI Interface.
SysExMessage getSysExMessage() const
Return the received system exclusive message.
void sendChannelMessageImpl(ChannelMessage msg) override
Low-level function for sending a MIDI channel voice message.
Wrapper class for the FortySevenEffects MIDI parser.
void updateChannelMessage(const MidiInterface &interface)
Get the latest channel message from the given MIDI interface.
void updateRealTimeMessage(const MidiInterface &interface)
Get the latest real-time message from the given MIDI interface.
void updateSysCommonMessage(const MidiInterface &interface)
Get the latest system common message from the given MIDI interface.
void updateSysExMessage(const MidiInterface &interface)
Get the latest system exclusive message from the given MIDI interface.
SysExMessage getSysExMessage() const
Get the latest SysEx message.
An abstract class for MIDI interfaces.
void onSysCommonMessage(SysCommonMessage message)
Call the System Common message callback and send the message to the sink pipe.
void onSysExMessage(SysExMessage message)
Call the SysEx message callback and send the message to the sink pipe.
void onRealTimeMessage(RealTimeMessage message)
Call the real-time message callback and send the message to the sink pipe.
void onChannelMessage(ChannelMessage message)
Call the channel message callback and send the message to the sink pipe.
Base class for MIDI parsers.
ChannelMessage getChannelMessage() const
Get the latest MIDI channel voice message.
RealTimeMessage getRealTimeMessage() const
Get the latest MIDI real-time message.
SysCommonMessage getSysCommonMessage() const
Get the latest MIDI system common message.
MIDIStaller * getStaller() const
Get a pointer to whatever is causing this MIDI source to be stalled.
MIDIMessageType getMessageType() const
Get the MIDI message type.
Channel getChannel() const
Get the MIDI channel of the message.
uint8_t getData1() const
Get the first data byte.
uint16_t getData14bit() const
If Data 1 and Data 2 represent a single 14-bit number, you can use this method to retrieve that numbe...
uint8_t getData2() const
Get the second data byte.
static const char * getNameNull(MIDIStaller *s)
Get the staller's name for debugging purposes.
MIDIMessageType getMessageType() const
Get the MIDI message type.