audio/midi_note.h file

API for MIDI notes in the PianoRoll.



struct MidiNote
A MIDI note living inside a Region and shown on the piano roll.




using MidiNote = struct MidiNote
A MIDI note living inside a Region and shown on the piano roll.


void midi_note_get_global_start_pos(MidiNote* self, Position* pos)
Gets the global Position of the MidiNote's start_pos.
void midi_note_set_region(MidiNote* midi_note, Region* region)
Sets the Region the MidiNote belongs to.
auto midi_note_find(MidiNote* clone) -> MidiNote*
Finds the actual MidiNote in the project from the given clone.
auto midi_note_get_track(MidiNote* self) -> Track*
Gets the Track this MidiNote is in.
auto midi_note_clone(MidiNote* src, MidiNoteCloneFlag flag) -> MidiNote*
Deep clones the midi note.
void midi_note_update_frames(MidiNote* self)
Updates the frames of each position in each child of the MidiNote recursively.
auto midi_note_is_equal(MidiNote* src, MidiNote* dest) -> int
Returns 1 if the MidiNotes match, 0 if not.
void midi_note_print(MidiNote* mn)
For debugging.
void midi_note_shift_pitch(MidiNote* self, const int delta, ArrangerObjectUpdateFlag update_flag)
Shifts MidiNote's position and/or value.
auto midi_note_hit(const 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.
auto midi_note_get_length_in_ticks(const MidiNote* self) -> long
Returns the MidiNote length in ticks.
void midi_note_set_val(MidiNote* midi_note, const uint8_t val, ArrangerObjectUpdateFlag update_flag)
Sets the pitch of the MidiNote.
void midi_note_free(MidiNote* self)
Frees a single MidiNote and its components.


#define midi_note_get_main_trans_midi_note(r)
Gets the transient counterpart of the MidiNote.
#define midi_note_get_main_midi_note(r)
Gets the main counterpart of the MidiNote.
#define midi_note_should_be_visible(mn)
Returns if MidiNote is (should be) visible.