audio/midi_note.h file

Contents

API for MIDI notes in the PianoRoll.

Classes

struct MidiNote
A MIDI note inside a ZRegion shown in the piano roll.

Typedefs

using MidiNote = struct MidiNote
A MIDI note inside a ZRegion shown in the piano roll.

Functions

void midi_note_get_global_start_pos(MidiNote* self, Position* pos)
Gets the global Position of the MidiNote's start_pos.
auto midi_note_new(RegionIdentifier* region_id, Position* start_pos, Position* end_pos, uint8_t val, uint8_t vel) -> MidiNote*
Creates a new MidiNote.
void midi_note_set_region_and_index(MidiNote* self, ZRegion* region, int idx)
Sets the region the MidiNote belongs to.
auto midi_note_is_equal(MidiNote* src, MidiNote* dest) -> int
Returns 1 if the MidiNotes match, 0 if not.
void midi_note_get_val_as_string(MidiNote* self, char* buf, const int use_markup)
Gets the MIDI note's value as a string (eg "C#4").
void midi_note_print(MidiNote* mn)
For debugging.
void midi_note_listen(MidiNote* mn, int listen)
Listen to the given MidiNote.
void midi_note_shift_pitch(MidiNote* self, const int delta)
Shifts MidiNote's position and/or value.
auto midi_note_hit(MidiNote* midi_note, const long gframes) -> int
Returns if the MIDI note is hit at given pos (in the timeline).
void midi_note_notes_to_events(MidiNote** midi_notes, int num_notes, Position* pos, MidiEvents* events)
Converts an array of MIDI notes to MidiEvents.
void midi_note_set_val(MidiNote* midi_note, const uint8_t val)
Sends a note off if currently playing and sets the pitch of the MidiNote.