23 #ifndef EVORAL_MIDI_UTIL_H
24 #define EVORAL_MIDI_UTIL_H
30 #include <sys/types.h>
46 if (status >= 0x80 && status < 0xF0) {
76 std::cerr <<
"event size called for sysex\n";
80 std::cerr <<
"event size called for unknown status byte " << std::hex << (int) status <<
"\n";
90 uint8_t status = buffer[0];
93 if (status >= 0x80 && status < 0xF0) {
102 if ((buffer[end] & 0x80) != 0) {
119 uint8_t status = buffer[0];
124 if (size < 0 || (
size_t)size != len) {
131 for (
size_t i = 1; i < len; ++i) {
132 if ((buffer[i] & 0x80) != 0) {
#define MIDI_CMD_NOTE_PRESSURE
#define MIDI_CMD_COMMON_CONTINUE
#define MIDI_CMD_COMMON_SYSEX_END
#define MIDI_CMD_COMMON_STOP
#define MIDI_CMD_COMMON_CLOCK
#define MIDI_CMD_COMMON_SONG_SELECT
#define MIDI_CMD_COMMON_MTC_QUARTER
#define MIDI_CMD_COMMON_SENSING
#define MIDI_CMD_COMMON_SYSEX
#define MIDI_CMD_PGM_CHANGE
#define MIDI_CMD_COMMON_RESET
#define MIDI_CMD_COMMON_START
#define MIDI_CMD_COMMON_TUNE_REQUEST
#define MIDI_CMD_COMMON_SONG_POS
#define MIDI_CMD_CHANNEL_PRESSURE
#define MIDI_CMD_NOTE_OFF
static bool midi_event_is_valid(const uint8_t *buffer, size_t len)
static int midi_event_size(uint8_t status)