libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::MidiParser Class Reference

Utility class for parsing raw byte streams into MIDI messages. More...

Detailed Description

Utility class for parsing raw byte streams into MIDI messages.

Implemented as a state machine designed to parse one byte at a time

#include <midi_parser.h>

Public Member Functions

 MidiParser ()
 
 ~MidiParser ()
 
void Init ()
 
bool Parse (uint8_t byte, MidiEvent *event_out)
 Parse one MIDI byte. If the byte completes a parsed event, its value will be assigned to the dereferenced output pointer. Otherwise, status is preserved in anticipation of the next sequential byte. Return value indicates if a new event was parsed or not.
 
void Reset ()
 Reset parser to default state.
 

Constructor & Destructor Documentation

◆ MidiParser()

daisy::MidiParser::MidiParser ( )
inline

◆ ~MidiParser()

daisy::MidiParser::~MidiParser ( )
inline

Member Function Documentation

◆ Init()

void daisy::MidiParser::Init ( )
inline

◆ Parse()

bool daisy::MidiParser::Parse ( uint8_t  byte,
MidiEvent event_out 
)

Parse one MIDI byte. If the byte completes a parsed event, its value will be assigned to the dereferenced output pointer. Otherwise, status is preserved in anticipation of the next sequential byte. Return value indicates if a new event was parsed or not.

Parameters
byteRaw MIDI byte to parse
event_outPointer to output event object, value assigned on parse success
Returns
true If a new event was parsed
false If no new event was parsed

◆ Reset()

void daisy::MidiParser::Reset ( )

Reset parser to default state.


The documentation for this class was generated from the following file: