Simple MIDI Handler
Parses bytes from an input into valid MidiEvents.
The MidiEvents fill a FIFO queue that the user can pop messages from.
More...
Simple MIDI Handler
Parses bytes from an input into valid MidiEvents.
The MidiEvents fill a FIFO queue that the user can pop messages from.
#include <midi.h>
Classes | |
| struct | Config |
Public Types | |
| using | MidiEventCallback = std::function<void(MidiEvent&)> |
Public Member Functions | |
| MidiHandler () | |
| ~MidiHandler () | |
| void | Init (Config config) |
| void | StartReceive () |
| void | StartReceiveRt (MidiEventCallback callback_for_rt_messages) |
| void | Listen () |
| bool | HasEvents () const |
| bool | RxActive () |
| MidiEvent | PopEvent () |
| void | SendMessage (uint8_t *bytes, size_t size) |
| void | Parse (uint8_t byte) |
| using daisy::MidiHandler< Transport >::MidiEventCallback = std::function<void(MidiEvent&)> |
|
inline |
|
inline |
|
inline |
Checks if there are unhandled messages in the queue
|
inline |
Initializes the MidiHandler
| config | Configuration structure used to define specifics to the MIDI Handler. |
|
inline |
Start listening
|
inline |
Feed in bytes to parser state machine from an external source. Populates internal FIFO queue with MIDI Messages.
| byte | MIDI byte to be parsed |
|
inline |
Pops the oldest unhandled MidiEvent from the internal queue
|
inline |
|
inline |
SendMessage Send raw bytes as message
|
inline |
Starts listening on the selected input mode(s). MidiEvent Queue will begin to fill, and can be checked with HasEvents()
|
inline |
Starts listening on the selected input mode(s). MidiEvent Queue will begin to fill, and can be checked with HasEvents() MIDI events of type SystemRealTime will be delivered synchronously by callback. All other events are on the queue