Skip to content

Class daisy::MidiParser

ClassList > daisy > MidiParser

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

  • #include <midi_parser.h>

Public Functions

Type Name
void Init ()
MidiParser ()
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.
~MidiParser ()

Detailed Description

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

Public Functions Documentation

function Init

inline void daisy::MidiParser::Init () 

function MidiParser

inline daisy::MidiParser::MidiParser () 

function Parse

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.

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

Parameters:

  • byte Raw MIDI byte to parse
  • event_out Pointer to output event object, value assigned on parse success

Returns:

true If a new event was parsed

Returns:

false If no new event was parsed


function Reset

Reset parser to default state.

void daisy::MidiParser::Reset () 


function ~MidiParser

inline daisy::MidiParser::~MidiParser () 


The documentation for this class was generated from the following file external-docs/libDaisy/src/hid/midi_parser.h