utils/midi.h file

MIDI utils.



auto midi_get_controller_name(const midi_byte_t cc) -> CONST const char*
Return the name of the given cc (0-127).
void midi_get_bytes_from_combined(const uint32_t val, midi_byte_t* lsb, midi_byte_t* msb)
Used for MIDI controls whose values are split between MSB/LSB.
auto midi_ctrl_change_get_ch_and_description(midi_byte_t* ctrl_change, char* buf) -> int
Saves a string representation of the given control change event in the given buffer.
auto midi_get_msg_length(const uint8_t status_byte) -> int
Returns the length of the MIDI message based on the status byte.
static auto midi_note_number_to_frequency(const uint8_t note) -> float
Returns the frequency in Hz of the given note, using 440Hz base.
static auto midi_get_chromatic_scale_index(const uint8_t note) -> uint8_t
Returns this note's position within an octave, 0-11, where C is 0.
static auto midi_get_octave_number(const uint8_t note) -> uint8_t
Returns this note's octave number.
static auto midi_is_short_message_type(const midi_byte_t short_msg[3], const midi_byte_t type) -> bool
Returns whether the given first byte of a MIDI event is of the given type hex.
auto midi_get_note_name(const midi_byte_t note) -> CONST const char*
Returns the note name (eg, "C") for a value between 0 and 127.
static auto midi_get_14_bit_value(const midi_byte_t short_msg[3]) -> uint32_t
Used for MIDI controls whose values are split between MSB/LSB.
static auto midi_get_meta_event_data(const midi_byte_t** data, const midi_byte_t* msg, const size_t msg_sz) -> size_t