arduino-midi
|
A simple Midi Parser which calls the corresponding events. It supports Midi and BLE Midi messages. The main entry point is the parse command which calls the related methods. More...
#include <MidiParser.h>
Public Member Functions | |
MidiParser (MidiAction *MidiAction, int filter_channel=-1) | |
void | begin (MidiAction *MidiAction, int filter_channel=-1) |
Assigns the MidiAction and optinally defines a midi channel. | |
virtual void | onCommand (uint8_t channel, uint8_t status, uint8_t p1, uint8_t p2) |
virtual void | onControlChange (uint8_t controller, uint8_t controllerValue, uint8_t channel) |
virtual void | onNoteOff (uint8_t note, uint8_t velocity, uint8_t channel) |
virtual void | onNoteOn (uint8_t note, uint8_t velocity, uint8_t channel) |
virtual void | onPitchBend (uint8_t value, uint8_t channel) |
void | parse (uint8_t *msg, uint8_t len) |
Parse a string into midi messages. More... | |
Protected Attributes | |
int | filter_channel = -1 |
MidiAction * | p_MidiAction = nullptr |
A simple Midi Parser which calls the corresponding events. It supports Midi and BLE Midi messages. The main entry point is the parse command which calls the related methods.
In this implementation the handler just passes the noteOn and noteOff to the MidiAction.
If you indicate the channel in the constructor, it is used as filter to process only the messages for the indicated channel.
http://www.hangar42.nl/wp-content/uploads/2017/10/BLE-MIDI-spec.pdf
by Phil Schatzmann
void midi::MidiParser::parse | ( | uint8_t * | msg, |
uint8_t | len | ||
) |
Parse a string into midi messages.
Parse byte stream for ble midi messages.
[in] | msg | byte stream |
[in] | len | length of the msg |