audio/midi_region.h file


API for Region's specific to instrument Track's.


auto midi_region_new(const Position* start_pos, const Position* end_pos, int track_pos, int lane_pos, int idx_inside_lane) -> ZRegion*
Creates a new ZRegion for MIDI notes.
auto midi_region_new_from_midi_file(const Position* start_pos, const char* abs_path, int track_pos, int lane_pos, int idx_inside_lane, int idx) -> ZRegion*
Creates a MIDI region from the given MIDI file path, starting at the given Position.
auto midi_region_new_from_chord_descr(const Position* pos, ChordDescriptor* descr, int track_pos, int lane_pos, int idx_inside_lane) -> ZRegion*
Create a region from the chord descriptor.
void midi_region_insert_midi_note(ZRegion* region, MidiNote* midi_note, int idx, int pub_events)
Inserts the MidiNote to the given ZRegion.
void midi_region_start_unended_note(ZRegion* self, Position* start_pos, Position* end_pos, int pitch, int vel, int pub_events)
Starts an unended note with the given pitch and velocity and adds it to ZRegion::midi_notes.
auto midi_region_pop_unended_note(ZRegion* self, int pitch) -> MidiNote*
Returns the midi note with the given pitch from the unended notes.
void midi_region_print_midi_notes(ZRegion* self)
Prints the MidiNotes in the Region.
auto midi_region_get_first_midi_note(ZRegion* region) -> MidiNote*
Gets first midi note.
auto midi_region_get_last_midi_note(ZRegion* region) -> MidiNote*
Gets last midi note.
auto midi_region_get_highest_midi_note(ZRegion* region) -> MidiNote*
Gets highest midi note.
auto midi_region_get_lowest_midi_note(ZRegion* region) -> MidiNote*
Gets lowest midi note.
void midi_region_remove_midi_note(ZRegion* region, MidiNote* midi_note, int free, int pub_event)
Removes the MIDI note from the Region.
void midi_region_remove_all_midi_notes(ZRegion* region)
Removes all MIDI ntoes and their components completely.
void midi_region_write_to_midi_file(ZRegion* self, MIDI_FILE* mf, const int add_region_start, bool export_full, bool use_track_pos)
Returns the midi note at given position with the given pitch.
void midi_region_export_to_midi_file(ZRegion* self, const char* full_path, int midi_version, const int export_full)
Exports the ZRegion to a specified MIDI file.
auto midi_region_get_midi_ch(const ZRegion* self) -> uint8_t
Returns the MIDI channel that this region should be played on, starting from 1.
auto midi_region_get_as_events(ZRegion* self, const int add_region_start, const int full) -> MidiEvents*
Returns a newly initialized MidiEvents with the contents of the region converted into events.
void midi_region_free_members(ZRegion* self)
Frees members only but not the midi region itself.


#define midi_region_add_midi_note(region, midi_note, pub_events)
Adds the MidiNote to the given ZRegion.