audio/midi.h file

MIDI related structs, defines and enums.

Contents

Classes

struct MidiEvent
Backend-agnostic MIDI event descriptor.
struct MidiEvents
Container for passing midi events through ports.

Enums

enum MidiEventType { MIDI_EVENT_TYPE_PITCHBEND, MIDI_EVENT_TYPE_CONTROLLER, MIDI_EVENT_TYPE_NOTE_ON, MIDI_EVENT_TYPE_NOTE_OFF, MIDI_EVENT_TYPE_ALL_NOTES_OFF }
Type of MIDI event.

Typedefs

using MidiEventType = enum MidiEventType
Type of MIDI event.
using MidiEvent = struct MidiEvent
Backend-agnostic MIDI event descriptor.
using MidiEvents = struct MidiEvents
Container for passing midi events through ports.

Functions

void midi_events_init(MidiEvents* self)
Inits the MidiEvents struct.
auto midi_events_new(Port* port) -> MidiEvents*
Allocates and inits a MidiEvents struct.
static void midi_event_copy(MidiEvent* src, MidiEvent* dest)
Copies the members from one MidiEvent to another.
void midi_events_append(MidiEvents* src, MidiEvents* dest, const int start_frame, const int nframes, int queued)
Appends the events from src to dest.
static void midi_events_add_note_on(MidiEvents* self, uint8_t channel, uint8_t note_pitch, uint8_t velocity, uint32_t time, int queued)
Adds a note on event to the given MidiEvents.
auto midi_events_has_note_on(MidiEvents* self, int check_main, int check_queued) -> int
Returrns if the MidiEvents have any note on events.
void midi_events_add_event_from_buf(MidiEvents* self, uint32_t time, uint8_t* buf, int buf_size)
Parses a MidiEvent from a raw MIDI buffer.
static void midi_events_add_note_off(MidiEvents* self, uint8_t channel, uint8_t note_pitch, uint32_t time, int queued)
Adds a note off event to the given MidiEvents.
static void midi_events_add_control_change(MidiEvents* self, uint8_t channel, uint8_t controller, uint8_t control, uint32_t time, int queued)
Adds a control event to the given MidiEvents.
static void midi_events_add_pitchbend(MidiEvents* self, uint8_t channel, int pitchbend, uint32_t time, int queued)
Adds a control event to the given MidiEvents.
void midi_events_panic(MidiEvents* self, int queued)
Queues MIDI note off to event queue.
void midi_events_clear(MidiEvents* midi_events, int queued)
Clears midi events.
void midi_events_dequeue(MidiEvents* midi_events)
Copies the queue contents to the original struct.
auto midi_events_check_for_note_on(MidiEvents* midi_events, int note, int queued) -> int
Returns if a note on event for the given note exists in the given events.
auto midi_events_delete_note_on(MidiEvents* midi_events, int note, int queued) -> int
Deletes the midi event with a note on signal from the queue, and returns if it deleted or not.
void midi_panic_all(int queued)
Queues MIDI note off to event queues.