19 template <
class M
idiInterface>
23 template <
class M
idiInterface>
25 uint8_t channel = interface.getChannel() - 1;
26 this->midimsg.header = interface.getType() | channel;
27 this->midimsg.data1 = interface.getData1();
28 this->midimsg.data2 = interface.getData2();
33 template <
class M
idiInterface>
35 this->sysex.data = interface.getSysExArray();
36 this->sysex.length = interface.getSysExArrayLength();
41 template <
class M
idiInterface>
43 this->midimsg.header = interface.getType();
44 this->midimsg.data1 = interface.getData1();
45 this->midimsg.data2 = interface.getData2();
50 template <
class M
idiInterface>
52 this->rtmsg.message = interface.getType();
84template <
class M
idiInterface>
88 :
midi(std::forward<MidiInterface>(
midi)) {}
90 void begin()
override {
midi.begin(MIDI_CHANNEL_OMNI); }
95 auto type =
midi.getType();
176 midi.sendRealTime(
static_cast<MIDI_NAMESPACE::MidiType
>(msg.
message));
185 ERROR(F(
"Not implemented (stalled by ") << stallername <<
')', 0x1349);
189 const char *
getName()
const override {
return "47fx"; }
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.
@ SysExStart
Start of System Exclusive.
@ TuneRequest
Tune Request System Common message (1B).
@ SysExEnd
End of System Exclusive.
@ PitchBend
Pitch Bend Channel Voice message (3B).
#define BEGIN_CS_NAMESPACE
#define AH_DIAGNOSTIC_EXTERNAL_HEADER()
#define AH_DIAGNOSTIC_POP()
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.
const char * getName() const override
Get the staller's name for debugging purposes.
void begin() override
Initialize this updatable.
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.