diff options
Diffstat (limited to 'controller/inc')
-rw-r--r-- | controller/inc/base_midi.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/controller/inc/base_midi.h b/controller/inc/base_midi.h index 8320803..b6e5b19 100644 --- a/controller/inc/base_midi.h +++ b/controller/inc/base_midi.h @@ -8,7 +8,8 @@ // Configuration. #define DEBUG 0 // If defined, enable input safety checking (e.g. too large data bytes, bad ID numbers, etc). // These checks have some performance downside. -#define RUNNING_STATUS 0 // If defined, the MIDI instrument stores a transmit status and uses running statuses whenever possible. +/* #define RUNNING_STATUS 0 // If defined, the MIDI instrument stores a transmit status and uses running statuses whenever possible .*/ + #define KEY_ON_VELOCITY 0 // If defined, the MIDI instrument sends velocities with Note On messages. #undef RELEASE_VELOCITY // If defined, the MIDI instrument sends Note Off messages with velocities. // Otherwise, sends Note On velocity 0 or Note Off velocity 0 according to ACTUAL_OFF_MESSAGE. @@ -69,7 +70,17 @@ typedef struct { bool (*unimplemented_universal_sysex_collector)(uint8_t); // Same as above. Parsing ends with end_of_sysex_handler. } ConsumerBehavior; -extern ConsumerBehavior pfns; // Initialize this globally in your main. +typedef struct { + uint8_t status; + bool first_byte; + uint8_t byte0; + bool send_eox; + uint8_t *stack; + size_t top; + size_t size; +} ParserMemory; + +void midi_init(ConsumerBehavior new_pfns); // System exclusive sends. void sysex(uint16_t manufacturer_id, uint8_t* contents, size_t contents_len); |