193 DEBUGREF(F(
"Data byte after invalid header"));
226 return feed(midiByte);
MIDIReadEvent
Values returned by the MIDI reading functions.
@ CHANNEL_MESSAGE
A MIDI Channel message was received.
@ SYSEX_CHUNK
An incomplete System Exclusive message.
@ 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
static bool isStatus(uint8_t data)
Check if the given byte is a MIDI header/status byte.
MIDIReadEvent resume()
Resume the parser with the previously stored and unhandled byte.
bool sysCommonCancelsRunningStatus
Accounts for running status differences between MIDI 1.0 and BLE-MIDI.
uint8_t currentHeader
Current header (not necessarily running), contains the header of the message that's currently being r...
MIDIReadEvent handleNonRealTimeStatus(uint8_t midiByte)
MIDIReadEvent handleRealTime(uint8_t midiByte)
uint8_t runningHeader
Running status header.
bool hasStoredByte() const
Check whether there's a stored byte.
uint8_t popStoredByte()
Get the stored byte. Afterwards, hasStoredByte will return false.
MIDIReadEvent feed(uint8_t midibyte)
Feed a new byte to the parser.
void storeByte(uint8_t midiByte)
Store a byte to parse later.
MIDIReadEvent handleData(uint8_t midiByte)
bool thirdByte
Flag that remembers that the next data byte will be the third byte of a message.
bool hasSysExSpace() const
void addSysExByte(uint8_t data)
MIDIReadEvent handleStatus(uint8_t midiByte)
#define DEBUGREF(x)
Print an expression and its location (file and line number) to the debug output if debugging is enabl...
uint8_t data2
First MIDI data byte.
bool hasValidChannelMessageHeader() const
Check whether the header is a valid header for a channel message.
uint8_t header
MIDI status byte (message type and channel).
uint8_t data1
First MIDI data byte.
bool hasValidSystemCommonHeader() const
Check whether the header is a valid header for a System Common message.