#include <MIDI_Parsers/SerialMIDI_Parser.hpp>
Parser for Serial MIDI streams (and BLE-MIDI).
Definition at line 13 of file SerialMIDI_Parser.hpp.
|
static bool | isStatus (uint8_t data) |
| Check if the given byte is a MIDI header/status byte.
|
|
static bool | isData (uint8_t data) |
| Check if the given byte is a MIDI data byte.
|
|
|
bool | sysCommonCancelsRunningStatus |
| Accounts for running status differences between MIDI 1.0 and BLE-MIDI.
|
|
bool | thirdByte = false |
| Flag that remembers that the next data byte will be the third byte of a message.
|
|
uint8_t | currentHeader = 0 |
| Current header (not necessarily running), contains the header of the message that's currently being received.
|
|
uint8_t | runningHeader = 0 |
| Running status header.
|
|
uint8_t | storedByte = 0xFF |
|
◆ SerialMIDI_Parser()
◆ pull()
template<class BytePuller >
Parse one incoming MIDI message.
- Parameters
-
puller | The source of MIDI bytes. |
- Returns
- The type of MIDI message available, or
MIDIReadEvent::NO_MESSAGE
if puller
ran out of bytes before a complete message was parsed.
Definition at line 94 of file SerialMIDI_Parser.hpp.
◆ feed()
◆ resume()
◆ getSysExMessage()
◆ addSysExByte()
void addSysExByte |
( |
uint8_t | data | ) |
|
|
inlineprotected |
◆ hasSysExSpace()
bool hasSysExSpace |
( |
| ) |
const |
|
inlineprotected |
◆ startSysEx()
◆ endSysEx()
◆ handleRealTime()
◆ handleNonRealTimeStatus()
◆ handleStatus()
◆ handleData()
◆ storeByte()
void storeByte |
( |
uint8_t | midiByte | ) |
|
|
inlineprotected |
Store a byte to parse later.
This is used when the SysEx buffer is full, for example. The byte cannot be added to the buffer now, so store it to add it the next time the parser is updated.
Definition at line 61 of file SerialMIDI_Parser.hpp.
◆ hasStoredByte()
bool hasStoredByte |
( |
| ) |
const |
|
inlineprotected |
Check whether there's a stored byte.
If this is the case, this byte should be parsed before reading a new byte.
Definition at line 64 of file SerialMIDI_Parser.hpp.
◆ popStoredByte()
uint8_t popStoredByte |
( |
| ) |
|
|
inlineprotected |
◆ cancelRunningStatus()
void cancelRunningStatus |
( |
| ) |
|
|
inline |
◆ getChannelMessage()
Get the latest MIDI channel voice message.
Definition at line 19 of file MIDI_Parser.hpp.
◆ getSysCommonMessage()
Get the latest MIDI system common message.
Definition at line 21 of file MIDI_Parser.hpp.
◆ getRealTimeMessage()
Get the latest MIDI real-time message.
Definition at line 25 of file MIDI_Parser.hpp.
◆ isStatus()
static bool isStatus |
( |
uint8_t | data | ) |
|
|
inlinestaticinherited |
Check if the given byte is a MIDI header/status byte.
Definition at line 37 of file MIDI_Parser.hpp.
◆ isData()
static bool isData |
( |
uint8_t | data | ) |
|
|
inlinestaticinherited |
Check if the given byte is a MIDI data byte.
Definition at line 39 of file MIDI_Parser.hpp.
◆ sysexbuffer
◆ sysCommonCancelsRunningStatus
bool sysCommonCancelsRunningStatus |
|
private |
Accounts for running status differences between MIDI 1.0 and BLE-MIDI.
Definition at line 79 of file SerialMIDI_Parser.hpp.
◆ thirdByte
Flag that remembers that the next data byte will be the third byte of a message.
Definition at line 82 of file SerialMIDI_Parser.hpp.
◆ currentHeader
uint8_t currentHeader = 0 |
|
private |
Current header (not necessarily running), contains the header of the message that's currently being received.
As soon as the message is complete, it is set to zero.
Definition at line 86 of file SerialMIDI_Parser.hpp.
◆ runningHeader
uint8_t runningHeader = 0 |
|
private |
◆ storedByte
uint8_t storedByte = 0xFF |
|
private |
◆ midimsg
◆ rtmsg
The documentation for this class was generated from the following files: