Audio module

The audio module contains DSP and audio related code.

DSP and audio related code.

Modules

module Sub Group

Classes

struct AutomationCurve
The curve between two AutomationPoint's.
struct AutomationPoint
An automation point living inside an AutomationTrack.
struct Channel
A Channel is part of a Track (excluding Tracks that don't have Channels) and contains information related to routing and the Mixer.
struct ChordDescriptor
A ChordDescriptor describes a chord and is not linked to any specific object by itself.
struct ChordObject
A ChordObject to be shown in the TimelineArrangerWidget.
struct Fader
A Fader is a processor that is used for volume controls and pan.
struct Marker
Marker for the MarkerTrack.
struct Metronome
Metronome settings.
struct MidiEvent
Backend-agnostic MIDI event descriptor.
struct MidiEvents
Container for passing midi events through ports.
struct MidiNote
A MIDI note living inside a Region and shown on the piano roll.
struct PortIdentifier
Struct used to identify Ports in the project.
struct Port
Must ONLY be created via port_new()
struct StereoPorts
L & R port, for convenience.
struct Position
A Position is made up of bars.beats.sixteenths.ticks.
struct Region
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
struct SamplePlayback
A sample playback handle to be used by the engine.
struct SampleProcessor
A processor to be used in the routing graph for playing samples independent of the timeline.
struct MusicalScale
To be generated at the beginning, and then copied and reused.
struct ScaleObject
A ScaleObject to be shown in the TimelineArrangerWidget.
struct TrackLane
A TrackLane belongs to a Track (can have many TrackLanes in a Track) and contains Regions.
struct Tracklist
The Tracklist contains all the tracks in the Project.
struct Transport
The transport.
struct Velocity
The MidiNote velocity.

Enums

enum AutomationCurveType { AUTOMATION_CURVE_TYPE_BOOL, AUTOMATION_CURVE_TYPE_STEP, AUTOMATION_CURVE_TYPE_FLOAT }
Type of AutomationCurve.
enum ChannelType { CT_AUDIO, CT_MIDI, CT_BUS, CT_MASTER }
Type of Channel.
enum ChordType { CHORD_TYPE_MAJ, CHORD_TYPE_MIN, CHORD_TYPE_DIM, CHORD_TYPE_SUS4, CHORD_TYPE_SUS2, CHORD_TYPE_AUG, NUM_CHORD_TYPES }
Chord type.
enum ChordAccent { CHORD_ACC_NONE, CHORD_ACC_7, CHORD_ACC_j7, CHORD_ACC_b9, CHORD_ACC_9, CHORD_ACC_S9, CHORD_ACC_11, CHORD_ACC_b5_S11, CHORD_ACC_S5_b13, CHORD_ACC_6_13, NUM_CHORD_ACCENTS }
Chord accents.
enum FaderType { FADER_TYPE_CHANNEL, FADER_TYPE_GENERIC }
enum MarkerType { MARKER_TYPE_START, MARKER_TYPE_END, MARKER_TYPE_CUSTOM }
Marker type.
enum MetronomeType { METRONOME_TYPE_NONE, METRONOME_TYPE_EMPHASIS, METRONOME_TYPE_NORMAL }
The type of the metronome sound.
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.
enum MidiNoteCloneFlag { MIDI_NOTE_CLONE_COPY_MAIN, MIDI_NOTE_CLONE_COPY, MIDI_NOTE_CLONE_LINK }
enum PortFlow { FLOW_UNKNOWN, FLOW_INPUT, FLOW_OUTPUT }
Direction of the signal.
enum PortType { TYPE_UNKNOWN, TYPE_CONTROL, TYPE_AUDIO, TYPE_EVENT, TYPE_CV }
Type of signals the Port handles.
enum PortOwnerType { PORT_OWNER_TYPE_BACKEND, PORT_OWNER_TYPE_PLUGIN, PORT_OWNER_TYPE_TRACK, PORT_OWNER_TYPE_FADER, PORT_OWNER_TYPE_SAMPLE_PROCESSOR }
Type of owner.
enum PortFlags { PORT_FLAG_STEREO_L = 0x01, PORT_FLAG_STEREO_R = 0x02, PORT_FLAG_PIANO_ROLL = 0x04, PORT_FLAG_SIDECHAIN = 0x08, PORT_FLAG_MAIN_PORT = 0x10, PORT_FLAG_MANUAL_PRESS = 0x20, OPT_F = 0x40 }
Port flags.
enum PortInternalType { INTERNAL_NONE, INTERNAL_LV2_PORT, INTERNAL_JACK_PORT, INTERNAL_PA_PORT }
What the internal data is.
enum RegionType { REGION_TYPE_MIDI = 0x01, REGION_TYPE_AUDIO = 0x02, REGION_TYPE_AUTOMATION = 0x04, REGION_TYPE_CHORD = 0x08 }
Type of Region.
enum RegionCloneFlag { REGION_CLONE_COPY_MAIN, REGION_CLONE_COPY, REGION_CLONE_LINK }
Flag do indicate how to clone the Region.
enum MusicalScaleType { SCALE_CHROMATIC, SCALE_IONIAN, SCALE_AEOLIAN, SCALE_HARMONIC_MINOR, SCALE_ACOUSTIC, SCALE_ALGERIAN, SCALE_ALTERED, SCALE_AUGMENTED, SCALE_BEBOP_DOMINANT, SCALE_BLUES, SCALE_CHINESE, SCALE_DIMINISHED, SCALE_DOMINANT_DIMINISHED, SCALE_DORIAN, SCALE_DOUBLE_HARMONIC, SCALE_EIGHT_TONE_SPANISH, SCALE_ENIGMATIC, SCALE_EGYPTIAN, SCALE_FLAMENCO, SCALE_GEEZ, SCALE_GYPSY, SCALE_HALF_DIMINISHED, SCALE_HARMONIC_MAJOR, SCALE_HINDU, SCALE_HIRAJOSHI, SCALE_HUNGARIAN_GYPSY, SCALE_HUNGARIAN_MINOR, SCALE_IN, SCALE_INSEN, SCALE_ISTRIAN, SCALE_IWATO, SCALE_LOCRIAN, SCALE_LYDIAN_AUGMENTED, SCALE_LYDIAN, SCALE_MAJOR_LOCRIAN, SCALE_MAJOR_PENTATONIC, SCALE_MAQAM, SCALE_MELODIC_MINOR, SCALE_MINOR_PENTATONIC, SCALE_MIXOLYDIAN, SCALE_NEAPOLITAN_MAJOR, SCALE_NEAPOLITAN_MINOR, SCALE_OCTATONIC_HALF_WHOLE, SCALE_OCTATONIC_WHOLE_HALF, SCALE_ORIENTAL, SCALE_PERSIAN, SCALE_PHRYGIAN_DOMINANT, SCALE_PHRYGIAN, SCALE_PROMETHEUS, SCALE_ROMANIAN_MINOR, SCALE_TRITONE, SCALE_UKRANIAN_DORIAN, SCALE_WHOLE_TONE, SCALE_YO }
Scale type (name) eg Aeolian.
enum VelocityCloneFlag { VELOCITY_CLONE_COPY_MAIN, VELOCITY_CLONE_COPY }

Typedefs

using AutomationCurveType = enum AutomationCurveType
Type of AutomationCurve.
using AutomationCurve = struct AutomationCurve
The curve between two AutomationPoint's.
using AutomationPoint = struct AutomationPoint
An automation point living inside an AutomationTrack.
using ChannelType = enum ChannelType
Type of Channel.
using Channel = struct Channel
A Channel is part of a Track (excluding Tracks that don't have Channels) and contains information related to routing and the Mixer.
using ChordType = enum ChordType
Chord type.
using ChordAccent = enum ChordAccent
Chord accents.
using ChordDescriptor = struct ChordDescriptor
A ChordDescriptor describes a chord and is not linked to any specific object by itself.
using ChordObject = struct ChordObject
A ChordObject to be shown in the TimelineArrangerWidget.
using Fader = struct Fader
A Fader is a processor that is used for volume controls and pan.
using MarkerType = enum MarkerType
Marker type.
using Marker = struct Marker
Marker for the MarkerTrack.
using MarkerTrack = struct Track
MarkerTrack is just a Track.
using MetronomeType = enum MetronomeType
The type of the metronome sound.
using Metronome = struct Metronome
Metronome settings.
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.
using MidiNote = struct MidiNote
A MIDI note living inside a Region and shown on the piano roll.
using PortFlow = enum PortFlow
Direction of the signal.
using PortType = enum PortType
Type of signals the Port handles.
using PortOwnerType = enum PortOwnerType
Type of owner.
using PortFlags = enum PortFlags
Port flags.
using PortInternalType = enum PortInternalType
What the internal data is.
using PortIdentifier = struct PortIdentifier
Struct used to identify Ports in the project.
using Port = struct Port
Must ONLY be created via port_new()
using StereoPorts = struct StereoPorts
L & R port, for convenience.
using Position = struct Position
A Position is made up of bars.beats.sixteenths.ticks.
using RegionType = enum RegionType
Type of Region.
using RegionCloneFlag = enum RegionCloneFlag
Flag do indicate how to clone the Region.
using Region = struct Region
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
using SamplePlayback = struct SamplePlayback
A sample playback handle to be used by the engine.
using SampleProcessor = struct SampleProcessor
A processor to be used in the routing graph for playing samples independent of the timeline.
using MusicalScaleType = enum MusicalScaleType
Scale type (name) eg Aeolian.
using MusicalScale = struct MusicalScale
To be generated at the beginning, and then copied and reused.
using ScaleObject = struct ScaleObject
A ScaleObject to be shown in the TimelineArrangerWidget.
using TrackLane = struct TrackLane
A TrackLane belongs to a Track (can have many TrackLanes in a Track) and contains Regions.
using Tracklist = struct Tracklist
The Tracklist contains all the tracks in the Project.
using Transport = struct Transport
The transport.
using Velocity = struct Velocity
The MidiNote velocity.
using MidiEvents = struct MidiEvents
Container for passing midi events through ports.

Functions

auto audio_region_new(const char* filename, const Position* start_pos, const int is_main) -> AudioRegion*
Creates a Region for audio data.
void audio_region_free_members(AudioRegion* self)
Frees members only but not the audio region itself.
auto automation_curve_new(const AutomatableType a_type, const Position* pos) -> AutomationCurve*
Creates an AutomationCurve.
auto automation_curve_get_normalized_value(AutomationCurve* ac, double x) -> double
The function to return a point on the curve.
void automation_curve_set_curviness(AutomationCurve* ac, float curviness)
Sets the curviness of the AutomationCurve.
void automation_curve_free(AutomationCurve* ap)
Frees the automation point.
auto automation_point_find(AutomationPoint* src) -> AutomationPoint*
Finds the automation point in the project matching the params of the given one.
auto automation_point_new_float(const float value, const Position* pos, int is_main) -> AutomationPoint*
Creates an AutomationPoint in the given AutomationTrack at the given Position.
void automation_point_update_fvalue(AutomationPoint* ap, float fval, ArrangerObjectUpdateFlag update_flag)
Updates the value and notifies interested parties.
void automation_point_set_region_and_index(AutomationPoint* _ap, Region* region, int index)
Sets the Region and the index in the region that the AutomationPoint belongs to, in all its counterparts.
auto automation_point_get_normalized_value(AutomationPoint* ap) -> float
Returns the normalized value (0.0 to 1.0).
auto automation_point_clone(AutomationPoint* src, AutomationPointCloneFlag flag) -> AutomationPoint*
Clones the atuomation point.
auto automation_point_get_track(AutomationPoint* ap) -> Track*
Returns the Track this AutomationPoint is in.
void automation_point_free(AutomationPoint* ap)
Frees the automation point.
auto automation_region_new(const Position* start_pos, const Position* end_pos, const int is_main) -> Region*
Creates a new Region for automation.
void automation_region_print_automation(Region* self)
Prints the automation in this Region.
void automation_region_force_sort(Region* self)
Forces sort of the automation points.
void automation_region_add_ap(Region* self, AutomationPoint* ap, int gen_curves)
Adds automation point and optionally generates curve points accordingly.
void automation_region_add_ac(Region* self, AutomationCurve* ac)
Adds the given AutomationCurve.
auto automation_region_get_prev_ap(Region* self, AutomationPoint* ap) -> AutomationPoint*
Returns the AutomationPoint before the position.
auto automation_region_get_next_ap(Region* self, AutomationPoint* ap) -> AutomationPoint*
Returns the AutomationPoint after the position.
auto automation_region_get_ap_before_curve(Region* self, AutomationCurve* ac) -> AutomationPoint*
Returns the AutomationPoint before the given AutomationCurve.
auto automation_region_get_ap_after_curve(Region* self, AutomationCurve* ac) -> AutomationPoint*
Returns the ap after the curve point.
auto automation_region_get_next_curve_ac(Region* self, AutomationPoint* ap) -> AutomationCurve*
Returns the curve point right after the given ap.
void automation_region_remove_ap(Region* self, AutomationPoint* ap, int free)
Removes the given AutomationPoint from the Region.
void automation_region_remove_ac(Region* self, AutomationCurve* ac, int free)
Removes the given AutomationCurve from the Region.
void automation_region_free_members(Region* self)
Frees members only but not the Region itself.
void channel_handle_recording(Channel* self)
Handles the recording logic inside the process cycle.
void channel_connect(Channel* ch)
Connects the channel's ports.
void channel_add_pan(void* _channel, float pan)
Adds to (or subtracts from) the pan.
void channel_prepare_for_serialization(Channel* ch)
Prepares the Channel for serialization.
void channel_reset_fader(Channel* channel)
Sets fader to 0.0.
void channel_prepare_process(Channel* channel)
Prepares the channel for processing.
auto channel_new(ChannelType type, Track* track) -> Channel*
Creates a channel of the given type with the given label.
void channel_remove_ats_from_automation_tracklist(Channel* ch)
Removes the AutomationTrack's associated with this channel from the AutomationTracklist in the corresponding Track.
void channel_process(Channel* channel)
The process function prototype.
auto channel_add_plugin(Channel* channel, int pos, Plugin* plugin, int confirm, int gen_automatables, int recalc_graph) -> int
Adds given plugin to given position in the strip.
void channel_update_output(Channel* ch, Track* output)
Updates the output of the Channel (where the Channel routes to.
auto channel_get_last_active_slot_index(Channel* channel) -> int
Returns the index of the last active slot.
auto channel_get_index(Channel* channel) -> int
Returns the index on the mixer.
auto channel_get_plugin_index(Channel* channel, Plugin* plugin) -> int
Returns the plugin's strip index on the channel.
void channel_reattach_midi_editor_manual_press_port(Channel* channel, int connect)
Connects or disconnects the MIDI editor key press port to the channel's first plugin.
auto channel_get_first_plugin(Channel* channel) -> Plugin*
Convenience method to get the first active plugin in the channel.
auto channel_get_automatable(Channel* channel, AutomatableType type) -> Automatable*
Convenience function to get the fader automatable of the channel.
void channel_generate_automation_tracks(Channel* channel)
Generates automatables for the channel.
void channel_remove_plugin(Channel* channel, int pos, int deleting_plugin, int deleting_channel, int recalc_graph)
Removes a plugin at pos from the channel.
auto channel_clone(Channel* ch, Track* track) -> Channel*
Clones the channel recursively.
void channel_disconnect(Channel* channel, int remove_pl, int recalc_graph)
Disconnects the channel from the processing chain.
void channel_free(Channel* channel)
Frees the channel.
auto chord_descriptor_new(MusicalNote root, int has_bass, MusicalNote bass, ChordType type, ChordAccent accent, int inversion) -> ChordDescriptor*
Creates a ChordDescriptor.
auto chord_descriptor_is_key_in_chord(ChordDescriptor* chord, MusicalNote key) -> int
Returns if the given key is in the chord represented by the given ChordDescriptor.
auto chord_descriptor_clone(ChordDescriptor* src) -> ChordDescriptor*
Clones the given ChordDescriptor.
auto chord_descriptor_chord_type_to_string(ChordType type) -> const char*
Returns the chord type as a string (eg.
auto chord_descriptor_chord_accent_to_string(ChordAccent accent) -> const char*
Returns the chord accent as a string (eg.
auto chord_descriptor_note_to_string(MusicalNote note) -> const char*
Returns the musical note as a string (eg.
auto chord_descriptor_to_string(ChordDescriptor* chord) -> char*
Returns the chord in human readable string.
void chord_descriptor_free(ChordDescriptor* self)
Frees the ChordDescriptor.
void chord_object_init_loaded(ChordObject* self)
Init the ChordObject after the Project is loaded.
auto chord_object_new(int index, int is_main) -> ChordObject*
Creates a ChordObject.
void chord_object_set_region(ChordObject* self, Region* region)
Sets the Track of the chord.
auto chord_object_get_chord_descriptor(ChordObject* self) -> ChordDescriptor*
Returns the ChordDescriptor associated with this ChordObject.
auto chord_object_find(ChordObject* clone) -> ChordObject*
Finds the ChordObject in the project corresponding to the given one.
auto chord_object_find_by_pos(ChordObject* clone) -> ChordObject*
Finds the ChordObject in the project corresponding to the given one's position.
auto chord_object_clone(ChordObject* src, ChordObjectCloneFlag flag) -> ChordObject*
Clones the given chord.
void chord_object_free(ChordObject* self)
Frees the ChordObject.
auto chord_region_new(const Position* start_pos, const Position* end_pos, const int is_main) -> Region*
Creates a new Region for chords.
void chord_region_add_chord_object(Region* self, ChordObject* chord)
Adds a ChordObject to the Region.
void chord_region_remove_chord_object(Region* self, ChordObject* chord, int free)
Removes a ChordObject from the Region.
void chord_region_free_members(Region* self)
Frees members only but not the Region itself.
auto chord_track_new() -> ChordTrack*
Creates a new chord Track.
void chord_track_add_scale(ChordTrack* track, ScaleObject* chord)
Adds a ChordObject to the Track.
void chord_track_remove_scale(ChordTrack* self, ScaleObject* scale, int free)
Removes a scale from the chord Track.
auto chord_track_get_chord_at_pos(const Track* ct, const Position* pos) -> ChordObject*
Returns the ChordObject at the given Position in the TimelineArranger.
auto chord_track_get_scale_at_pos(const Track* ct, const Position* pos) -> ScaleObject*
Returns the ScaleObject at the given Position in the TimelineArranger.
void chord_track_free(ChordTrack* self)
Frees the chord Track.
void engine_realloc_port_buffers(AudioEngine* self, int buf_size)
void engine_init(AudioEngine* self, int loading)
Init audio engine.
void engine_update_frames_per_tick(int beats_per_bar, int bpm, int sample_rate)
Updates frames per tick based on the time sig, the BPM, and the sample rate.
void engine_process_prepare(AudioEngine* self, uint32_t nframes)
To be called by each implementation to prepare the structures before processing.
auto engine_process(AudioEngine* self, uint32_t nframes) -> int
Processes current cycle.
void engine_post_process()
To be called after processing for common logic.
void engine_tear_down()
Closes any connections and free's data.
void fader_init(Fader* self, FaderType type, Channel* ch)
Inits fader to default values.
void fader_set_amp(void* self, float amp)
Sets the amplitude of the fader.
void fader_add_amp(void* self, float amp)
Adds (or subtracts if negative) to the amplitude of the fader (clamped at 0.0 to 2.0).
auto fader_get_amp(void* self) -> float
Gets the fader amplitude (not db) FIXME is void * necessary? do it in the caller.
void fader_set_fader_val(Fader* self, float fader_val)
Sets the fader levels from a normalized value 0.0-1.0 (such as in widgets).
void fader_copy(Fader* src, Fader* dest)
Copy the struct members from source to dest.
void fader_process(Fader* self, long g_frames, int nframes)
Process the Fader.
void instrument_track_init(Track* track)
Initializes an instrument track.
auto instrument_track_fill_midi_events(InstrumentTrack* track, const long g_start_frame, const int local_start_frame, uint32_t nframes, MidiEvents* midi_events) -> REALTIME void
Fills MIDI event queue from track.
void instrument_track_free(InstrumentTrack* track)
Frees the track.
auto marker_new(const char* name, int is_main) -> Marker*
Creates a Marker.
auto marker_is_equal(Marker* a, Marker* b) -> int
Returns if the two Marker's are equal.
void marker_set_track(Marker* marker, Track* track)
Sets the Track of the Marker.
void marker_set_name(Marker* marker, const char* name)
Sets the name to all the Marker's counterparts.
auto marker_find(Marker* clone) -> Marker*
Finds the marker in the project corresponding to the given one.
void marker_free(Marker* self)
Frees the Marker.
auto marker_track_default() -> MarkerTrack*
Creates the default marker track.
void marker_track_add_marker(MarkerTrack* self, Marker* marker)
Adds a Marker to the Track.
void marker_track_remove_marker(MarkerTrack* self, Marker* marker, int free)
Removes a marker, optionally freeing it.
void marker_track_free(MarkerTrack* self)
Frees the MarkerTrack.
void master_track_free(Track* track)
Frees the track.
void metronome_init(Metronome* self)
Initializes the Metronome by loading the samples into memory.
void metronome_fill_buffer(Metronome* self, float* buf, const long g_start_frame, const int nframes)
Fills the given frame buffer with metronome audio based on the current position.
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.
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(MidiRegion* region, Position* start_pos, Position* end_pos, int val, int vel, int is_main) -> MidiNote*
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.
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, 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.
void midi_note_set_val(MidiNote* midi_note, int val, ArrangerObjectUpdateFlag update_flag)
Sets the pitch of the MidiNote.
void midi_note_free(MidiNote* self)
Frees a single MidiNote and its components.
auto midi_region_new(const Position* start_pos, const Position* end_pos, int is_main) -> MidiRegion*
Creates a new Region for MIDI notes.
void midi_region_add_midi_note(MidiRegion* region, MidiNote* midi_note)
Adds midi note to region.
auto midi_region_find_unended_note(MidiRegion* self, int pitch) -> MidiNote*
Returns the midi note with the given pitch from the unended notes.
void midi_region_print_midi_notes(Region* self)
Prints the MidiNotes in the Region.
auto midi_region_get_first_midi_note(MidiRegion* region) -> MidiNote*
Gets first midi note.
auto midi_region_get_last_midi_note(MidiRegion* region) -> MidiNote*
Gets last midi note.
auto midi_region_get_highest_midi_note(MidiRegion* region) -> MidiNote*
Gets highest midi note.
auto midi_region_get_lowest_midi_note(MidiRegion* region) -> MidiNote*
Gets lowest midi note.
void midi_region_remove_midi_note(Region* region, MidiNote* midi_note, int free, int pub_event)
Removes the MIDI note from the Region.
void midi_region_remove_all_midi_notes(MidiRegion* region)
Removes all MIDI ntoes and their components completely.
void midi_region_free_members(MidiRegion* self)
Returns the midi note at given position with the given pitch.
void port_init_loaded(Port* port)
This function finds the Ports corresponding to the PortIdentifiers for srcs and dests.
auto port_find_from_identifier(PortIdentifier* id) -> Port*
Finds the Port corresponding to the identifier.
auto port_new(char* label) -> Port*
Creates port.
auto port_new_with_type(PortType type, PortFlow flow, char* label) -> Port*
Creates port.
auto port_new_with_data(PortInternalType internal_type, PortType type, PortFlow flow, char* label, void* data) -> Port*
Creates port and adds given data to it.
auto stereo_ports_new(Port* l, Port* r) -> StereoPorts*
Creates stereo ports.
void port_get_all(Port** ports, int* size)
Gathers all ports in the project and puts them in the given array and size.
static auto port_get_dest_index(Port* port, Port* dest) -> int
Returns the index of the destination in the dest array.
static void port_set_multiplier_by_index(Port* port, int idx, float val)
Set the multiplier for a destination by its index in the dest array.
static auto port_get_multiplier_by_index(Port* port, int idx) -> float
Get the multiplier for a destination by its index in the dest array.
void port_free(Port* port)
Deletes port, doing required cleanup and updating counters.
auto port_connect(Port* src, Port* dest) -> int
Connets src to dest.
auto port_disconnect(Port* src, Port* dest) -> int
Disconnects src from dest.
static auto port_disconnect_dests(Port* src) -> int
Disconnects dests of port.
void port_apply_fader(Port* port, float amp, const int start_frame, const int nframes)
Apply given fader value to port.
void port_sum_signal_from_inputs(Port* port, const int start_frame, const int nframes, const int noroll)
First sets port buf to 0, then sums the given port signal from its inputs.
void port_set_owner_track(Port* port, Track* track)
Sets the owner track & its ID.
void port_set_owner_sample_processor(Port* port, SampleProcessor* sample_processor)
Sets the owner sample processor.
void port_set_owner_fader(Port* port, Fader* fader)
Sets the owner fader & its ID.
void port_set_owner_plugin(Port* port, Plugin* pl)
Sets the owner plugin & its ID.
static void ports_disconnect(Port** ports, int num_ports, int deleting)
Disconnects all the given ports.
auto ports_remove(Port** ports, int* num_ports) -> int
Removes all the given ports from the project, optionally freeing them.
void port_print_connections_all()
Prints all connections.
void port_clear_buffer(Port* port)
Clears the port buffer.
auto port_disconnect_all(Port* port) -> int
Disconnects all srcs and dests from port.
void port_apply_pan_stereo(Port* l, Port* r, float pan, PanLaw pan_law, PanAlgorithm pan_algo)
Applies the pan to the given L/R ports.
void port_apply_pan(Port* port, float pan, PanLaw pan_law, PanAlgorithm pan_algo, const int start_frame, const int nframes)
Applies the pan to the given port.
void position_init(Position* position)
Initializes given position to all 0.
void position_set_to_bar(Position* position, int bar_no)
Sets position to given bar.
void position_set_tick(Position* position, int tick)
Sets the tick of the Position.
void position_sort_array(Position* array, const int size)
Sorts an array of Position's.
void position_set_to_pos(Position* position, const Position* target)
Sets position to target position.
auto position_to_frames(Position* position) -> long
Converts position bars/beats/quarter beats/ticks to frames.
void position_from_seconds(Position* position, double secs)
Converts seconds to position and puts the result in the given Position.
auto position_compare(const Position* p1, const Position* p2) -> int
Compares 2 positions.
void position_from_ticks(Position* pos, long ticks)
Sets position to the given total tick count.
void position_snap(const Position* prev_pos, Position* pos, Track* track, Region* region, const SnapGrid* sg)
Snaps position using given options.
void position_set_min_size(Position* start_pos, Position* end_pos, SnapGrid* snap)
Sets the end position to be 1 snap point away from the start pos.
void position_update_frames(Position* position)
Updates frames.
void position_get_midway_pos(Position* start_pos, Position* end_pos, Position* pos)
Calculates the midway point between the two Positions and sets it on pos.
auto position_get_ticks_diff(const Position* end_pos, const Position* start_pos, const SnapGrid* sg) -> long
Returns the difference in ticks between the two Position's, snapped based on the given SnapGrid (if any).
auto position_stringize(const Position* pos) -> char*
Creates a string in the form of "0.0.0.0" from the given position.
void position_print_simple(const Position* pos)
Prints the Position in the "0.0.0.0" form.
auto position_get_total_bars(const Position* pos) -> int
Returns the total number of bars not including the current one.
auto position_get_total_beats(const Position* pos) -> int
Returns the total number of beats not including the current one.
void quantize_options_update_quantize_points(QuantizeOptions* self)
Updates snap points.
auto quantize_options_stringize(NoteLength note_length, NoteType note_type) -> char*
Returns the grid intensity as a human-readable string.
auto quantize_options_clone(const QuantizeOptions* src) -> QuantizeOptions*
Clones the QuantizeOptions.
auto quantize_options_quantize_position(QuantizeOptions* self, Position* pos) -> int
Quantizes the given Position using the given QuantizeOptions.
void quantize_options_free(QuantizeOptions* self)
Free's the QuantizeOptions.
void region_init(Region* region, const Position* start_pos, const Position* end_pos, const int is_main)
Only to be used by implementing structs.
void region_init_loaded(Region* region)
Inits freshly loaded region.
auto region_find(Region* r) -> Region*
Finds the region corresponding to the given one.
auto region_find_by_name(const char* name) -> Region*
Looks for the Region under the given name.
void region_split(Region* region, const Position* pos, const int pos_is_local, Region** r1, Region** r2)
Splits the given Region at the given Position, deletes the original Region and adds 2 new Regions in the same parent (Track or AutomationTrack).
void region_unsplit(Region* r1, Region* r2, Region** region)
Undoes what region_split() did.
auto region_find_midi_note(Region* r, MidiNote* _mn) -> MidiNote*
Returns the MidiNote matching the properties of the given MidiNote.
auto region_get_full_length_in_ticks(Region* region) -> long
Returns the full length as it appears on the timeline in ticks.
auto region_get_full_length_in_frames(const Region* region) -> long
Returns the full length as it appears on the timeline in frames.
auto region_get_true_length_in_ticks(Region* region) -> long
Returns the true length as it appears on the piano roll (not taking into account any looping) in ticks.
auto region_get_loop_length_in_frames(Region* region) -> long
Returns the length of the loop in frames.
auto region_get_loop_length_in_ticks(Region* region) -> long
Returns the length of the loop in ticks.
auto region_timeline_frames_to_local(const Region* region, const long timeline_frames, const int normalize) -> long
Converts frames on the timeline (global) to local frames (in the clip).
auto region_get_track(Region* region) -> Track*
Returns the Track this Region is in.
auto region_get_num_loops(Region* region, int count_incomplete_loops) -> int
Returns the number of loops in the region, optionally including incomplete ones.
void region_set_lane(Region* region, TrackLane* lane)
Sets the track lane.
void region_set_automation_track(Region* region, AutomationTrack* at)
Sets the automation track.
void region_copy(Region* src, Region* dest)
Copies the data from src to dest.
void region_set_true_end_pos(Region* region, const Position* pos, ArrangerObjectUpdateFlag update_flag)
Checks if position is valid then sets it.
void region_set_loop_end_pos(Region* region, const Position* pos, ArrangerObjectUpdateFlag update_flag)
Checks if position is valid then sets it.
void region_set_loop_start_pos(Region* region, const Position* pos, ArrangerObjectUpdateFlag update_flag)
Checks if position is valid then sets it.
void region_set_clip_start_pos(Region* region, const Position* pos, ArrangerObjectUpdateFlag update_flag)
Checks if position is valid then sets it.
auto region_is_selected(Region* self) -> int
Returns if Region is in MidiArrangerSelections.
auto region_is_hit(const Region* region, const long gframes) -> int
Returns if the position is inside the region or not.
auto region_is_hit_by_range(const Region* region, const long gframes_start, const long gframes_end) -> int
Returns if any part of the Region is inside the given range, inclusive.
auto region_at_position(Track* track, Position* pos) -> Region*
Returns the region at the given position in the given Track.
auto region_generate_filename(Region* region) -> char*
Generates the filename for this region.
auto region_get_start_region(Region** regions, int num_regions) -> Region*
Returns the region with the earliest start point.
void region_set_name(Region* region, char* name)
Sets Region name (without appending anything to it) to all associated regions.
void region_remove_midi_note(Region* region, MidiNote* midi_note)
Removes the MIDI note and its components completely.
auto region_clone(Region* region, RegionCloneFlag flag) -> Region*
Clone region.
void region_disconnect(Region* self)
Disconnects the region and anything using it.
void region_free_all(Region* region)
Frees each Region stored in obj_info.
void region_free(Region* region)
Frees a single Region and its components.
void sample_playback_init(SamplePlayback* self, float** buf, long buf_size, int channels, float vol, int start_offset)
Initializes a SamplePlayback with a sample to play back.
void sample_processor_init(SampleProcessor* self)
Initializes a SamplePlayback with a sample to play back.
void sample_processor_prepare_process(SampleProcessor* self, const int nframes)
Clears the buffers.
void sample_processor_process(SampleProcessor* self, const int offset, const int nframes)
Process the samples for the given number of frames.
void sample_processor_remove_sample_playback(SampleProcessor* self, SamplePlayback* sp)
Removes a SamplePlayback from the array.
void sample_processor_queue_metronome(SampleProcessor* self, MetronomeType type, int offset)
Queues a metronomem tick at the given local offset.
void sample_processor_queue_sample_from_file(SampleProcessor* self, const char* path)
Adds a sample to play to the queue from a file path.
auto musical_scale_new(MusicalScaleType type, MusicalNote root) -> MusicalScale*
Creates new scale using type and root note.
auto musical_scale_clone(MusicalScale* src) -> MusicalScale*
Clones the scale.
auto musical_scale_to_string(MusicalScale* scale) -> char*
Prints the MusicalScale to a string.
static auto musical_scale_is_equal(MusicalScale* a, MusicalScale* b) -> int
Returns 1 if the scales are equal.
auto musical_scale_is_chord_in_scale(MusicalScale* scale, ChordDescriptor* chord) -> int
Returns if all of the chord's notes are in the scale.
auto musical_scale_is_accent_in_scale(MusicalScale* scale, MusicalNote chord_root, ChordType type, ChordAccent chord_accent) -> int
Returns if the accent is in the scale.
auto musical_scale_is_key_in_scale(MusicalScale* scale, MusicalNote key) -> int
Returns if the given key is in the given MusicalScale.
auto musical_scale_as_string(MusicalScale* scale) -> char*
Returns the scale in human readable string.
void musical_scale_free(MusicalScale* scale)
Frees the MusicalScale.
void scale_object_init_loaded(ScaleObject* self)
Init the ScaleObject after the Project is loaded.
auto scale_object_new(MusicalScale* descr, int is_main) -> ScaleObject*
Creates a ScaleObject.
auto scale_object_get_track(ScaleObject* self) -> Track*
Returns the Track this ScaleObject is in.
void scale_object_set_track(ScaleObject* self, Track* track)
Sets the Track of the scale.
auto scale_object_find(ScaleObject* clone) -> ScaleObject*
Finds the ScaleObject in the project corresponding to the given one.
auto scale_object_clone(ScaleObject* src, ScaleObjectCloneFlag flag) -> ScaleObject*
Clones the given scale.
void scale_object_free(ScaleObject* self)
Frees the ScaleObject.
void track_lane_init_loaded(TrackLane* lane)
Inits the TrackLane after a project was loaded.
auto track_lane_new(Track* track, int pos) -> TrackLane*
Creates a new TrackLane at the given pos in the given Track.
void track_lane_add_region(TrackLane* self, Region* region)
Adds a Region to the given TrackLane.
auto track_lane_clone(TrackLane* lane) -> TrackLane*
Clones the TrackLane.
void track_lane_free(TrackLane* lane)
Frees the TrackLane.
void tracklist_init_loaded(Tracklist* self)
Initializes the tracklist when loading a project.
void tracklist_get_visible_tracks(Tracklist* self, Track** visible_tracks, int* num_visible)
Finds visible tracks and puts them in given array.
void tracklist_print_tracks(Tracklist* self)
Prints the tracks (for debugging).
void tracklist_insert_track(Tracklist* self, Track* track, int pos, int publish_events, int recalc_graph)
Adds given track to given spot in tracklist.
void tracklist_remove_track(Tracklist* self, Track* track, int rm_pl, int free, int publish_events, int recalc_graph)
Removes a track from the Tracklist and the TracklistSelections.
void tracklist_move_track(Tracklist* self, Track* track, int pos, int publish_events, int recalc_graph)
Moves a track from its current position to the position given by pos.
void tracklist_append_track(Tracklist* self, Track* track, int publish_events, int recalc_graph)
Calls tracklist_insert_track with the given options.
static auto tracklist_track_name_is_unique(Tracklist* self, const char* name) -> int
Returns 1 if the track name is not taken.
void transport_init(Transport* self, int loading)
Initialize transport.
void transport_set_bpm(float bpm)
Sets BPM and does any necessary processing (like notifying interested parties).
void transport_set_beat_unit(Transport* self, int beat_unit)
Updates beat unit and anything depending on it.
void transport_set_metronome_enabled(Transport* self, const int enabled)
Sets whether metronome is enabled or not.
void transport_add_to_playhead(Transport* self, const int nframes)
Moves the playhead by the time corresponding to given samples, taking into account the loop end point.
void transport_set_playhead_pos(Transport* self, Position* pos)
Setter for playhead Position.
void transport_get_playhead_pos(Transport* self, Position* pos)
Getter for playhead Position.
void transport_move_playhead(Position* target, int panic)
Moves playhead to given pos.
void transport_set_loop(Transport* self, int enabled)
Enables or disables loop.
void transport_goto_prev_marker(Transport* self)
Moves the playhead to the prev Marker.
void transport_goto_next_marker(Transport* self)
Moves the playhead to the next Marker.
void transport_update_position_frames()
Updates the frames in all transport positions.
auto transport_frames_add_frames(const Transport* self, const long gframes, const int frames) -> long
Adds frames to the given global frames, while adjusting the new frames to loop back if the loop point was crossed.
void transport_position_add_frames(const Transport* self, Position* pos, const int frames)
Adds frames to the given position similar to position_add_frames, except that it adjusts the new Position if the loop end point was crossed.
void velocity_init_loaded(Velocity* self)
Init after loading a Project.
auto velocity_new(MidiNote* midi_note, int vel, int is_main) -> Velocity*
Creates a new Velocity with the given value.
void velocity_set_midi_note(Velocity* velocity, MidiNote* midi_note)
Sets the MidiNote the Velocity belongs to.
void velocity_set_cache_vel(Velocity* velocity, const int vel)
Sets the cached value for use in live actions.
auto velocity_find(Velocity* clone) -> Velocity*
Finds the actual Velocity in the project from the given clone.
auto velocity_clone(Velocity* src, VelocityCloneFlag flag) -> Velocity*
Clones the Velocity.
auto velocity_is_equal(Velocity* src, Velocity* dest) -> int
Returns 1 if the Velocity's match, 0 if not.
void velocity_shift(Velocity* self, int delta)
Changes the Velocity by the given amount of values (delta).
void velocity_set_val(Velocity* self, int val, ArrangerObjectUpdateFlag update_flag)
Sets the velocity to the given value.
void velocity_free(Velocity* self)
Destroys the velocity instance.

Defines

#define automation_point_get_main_automation_point(r)
Gets the main counterpart of the AutomationPoint.
#define automation_point_get_main_trans_automation_point(r)
Gets the transient counterpart of the AutomationPoint.
#define chord_object_get_main_chord_object(r)
Gets the main counterpart of the ChordObject.
#define chord_object_get_main_trans_chord_object(r)
Gets the transient counterpart of the ChordObject.
#define chord_track_get_chord_at_playhead(ct)
Returns the current chord.
#define chord_track_get_scale_at_playhead(ct)
Returns the current scale.
#define marker_get_main_marker(r)
Gets the main counterpart of the Marker.
#define marker_get_main_trans_marker(r)
Gets the transient counterpart of the Marker.
#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.
#define PORT_NOT_OWNED
Special ID for owner_pl, owner_ch, etc.
#define position_is_before(_pos, _cmp)
Checks if _pos is before _cmp.
#define position_is_before_or_equal(_pos, _cmp)
Checks if _pos is before or equal to _cmp.
#define position_is_equal(_pos, _cmp)
Checks if _pos is equal to _cmp.
#define position_is_after(_pos, _cmp)
Checks if _pos is after _cmp.
#define position_is_after_or_equal(_pos, _cmp)
Checks if _pos is after or equal to _cmp.
#define position_is_between(_pos, _start, _end)
Returns if _pos is after or equal to _start and before _end.
#define DEFINE_START_POS
Start Position to be used in calculations.
#define POSITION_MOVE_BY_TICKS(_tmp_pos, _use_cached, _obj, _pos_name, _ticks, _update_flag)
Moves the Position of an object only has a start position defined by the argument pos_name and a cache position named cache_##pos_name by the given amount of ticks.
#define POSITION_MOVE_BY_TICKS_W_LENGTH(_tmp_pos, _use_cached, _obj, _ticks, _update_flag)
Moves the Position of an object that has a start and end position named start_pos and end_pos and cached positions named cache_start_pos and cache_end_pos by given amount of ticks.
#define region_get_lane_region(r)
Gets the TrackLane counterpart of the Region.
#define region_get_main_region(r)
Gets the non-TrackLane counterpart of the Region.
#define region_get_lane_trans_region(r)
Gets the TrackLane counterpart of the Region (transient).
#define region_get_main_trans_region(r)
Gets the non-TrackLane counterpart of the Region (transient).
#define region_should_be_visible(mn)
Returns if Region is (should be) visible.
#define scale_object_get_main_scale_object(r)
Gets the main counterpart of the ScaleObject.
#define scale_object_get_main_trans_scale_object(r)
Gets the transient counterpart of the ScaleObject.
#define VELOCITY_DEFAULT
Default velocity.
#define velocity_get_main_trans_velocity(r)
Gets the transient counterpart of the Velocity.
#define velocity_get_main_velocity(r)
Gets the main counterpart of the Velocity.
#define velocity_is_selected(vel)
Wrapper that calls midi_note_is_selected().
#define velocity_should_be_visible(vel)
Returns if Velocity is (should be) visible.

Enum documentation

enum ChannelType

Type of Channel.

Enumerators
CT_AUDIO

audio generated by audio data in region

CT_MIDI

audio generated by plugin

CT_BUS

audio received from input

CT_MASTER

master (behaves like a bus)

enum ChordAccent

Chord accents.

Enumerators
CHORD_ACC_NONE
CHORD_ACC_7

b7 is 10 semitones from chord root, or 9 if the chord is diminished.

CHORD_ACC_j7

Maj7 is 11 semitones from the root.

CHORD_ACC_b9

13 semitones.

CHORD_ACC_9

14 semitones.

CHORD_ACC_S9

15 semitones.

CHORD_ACC_11

17 semitones.

CHORD_ACC_b5_S11

6 and 18 semitones.

CHORD_ACC_S5_b13

8 and 16 semitones.

CHORD_ACC_6_13

9 and 21 semitones.

NUM_CHORD_ACCENTS

enum FaderType

Enumerators
FADER_TYPE_CHANNEL

For Channel's.

FADER_TYPE_GENERIC

For generic uses.

enum MarkerType

Marker type.

Enumerators
MARKER_TYPE_START

Song start Marker that cannot be deleted.

MARKER_TYPE_END

Song end Marker that cannot be deleted.

MARKER_TYPE_CUSTOM

Custom Marker.

enum MidiNoteCloneFlag

Enumerators
MIDI_NOTE_CLONE_COPY_MAIN

Create a new MidiNote to be added to a Region as a main MidiNote.

MIDI_NOTE_CLONE_COPY

Create a new MidiNote that will not be used as a main MidiNote.

MIDI_NOTE_CLONE_LINK

enum PortInternalType

What the internal data is.

Enumerators
INTERNAL_NONE
INTERNAL_LV2_PORT

Lv2Port.

INTERNAL_JACK_PORT

jack_port_t

INTERNAL_PA_PORT

port audio

enum RegionType

Type of Region.

Bitfield instead of plain enum so multiple values can be passed to some functions (eg to collect all Regions of the given types in a Track).

enum RegionCloneFlag

Flag do indicate how to clone the Region.

Enumerators
REGION_CLONE_COPY_MAIN

Create a new Region to be added to a Track as a main Region.

REGION_CLONE_COPY

Create a new Region that will not be used as a main Region.

REGION_CLONE_LINK

TODO.

enum MusicalScaleType

Scale type (name) eg Aeolian.

Enumerators
SCALE_CHROMATIC

all keys

SCALE_IONIAN

major

SCALE_AEOLIAN

natural minor

SCALE_HARMONIC_MINOR
SCALE_ACOUSTIC
SCALE_ALGERIAN
SCALE_ALTERED
SCALE_AUGMENTED
SCALE_BEBOP_DOMINANT
SCALE_BLUES
SCALE_CHINESE
SCALE_DIMINISHED
SCALE_DOMINANT_DIMINISHED
SCALE_DORIAN
SCALE_DOUBLE_HARMONIC
SCALE_EIGHT_TONE_SPANISH
SCALE_ENIGMATIC
SCALE_EGYPTIAN
SCALE_FLAMENCO
SCALE_GEEZ
SCALE_GYPSY
SCALE_HALF_DIMINISHED
SCALE_HARMONIC_MAJOR
SCALE_HINDU
SCALE_HIRAJOSHI
SCALE_HUNGARIAN_GYPSY
SCALE_HUNGARIAN_MINOR
SCALE_IN
SCALE_INSEN
SCALE_ISTRIAN
SCALE_IWATO
SCALE_LOCRIAN
SCALE_LYDIAN_AUGMENTED
SCALE_LYDIAN
SCALE_MAJOR_LOCRIAN
SCALE_MAJOR_PENTATONIC
SCALE_MAQAM
SCALE_MELODIC_MINOR
SCALE_MINOR_PENTATONIC
SCALE_MIXOLYDIAN
SCALE_NEAPOLITAN_MAJOR
SCALE_NEAPOLITAN_MINOR
SCALE_OCTATONIC_HALF_WHOLE
SCALE_OCTATONIC_WHOLE_HALF
SCALE_ORIENTAL
SCALE_PERSIAN
SCALE_PHRYGIAN_DOMINANT
SCALE_PHRYGIAN
SCALE_PROMETHEUS
SCALE_ROMANIAN_MINOR
SCALE_TRITONE
SCALE_UKRANIAN_DORIAN
SCALE_WHOLE_TONE
SCALE_YO

enum VelocityCloneFlag

Enumerators
VELOCITY_CLONE_COPY_MAIN

Create a new Velocity to be added to a MidiNote as a main Velocity.

VELOCITY_CLONE_COPY

Create a new Velocity that will not be used as a main Velocity.

Typedef documentation

typedef struct ChordDescriptor ChordDescriptor

A ChordDescriptor describes a chord and is not linked to any specific object by itself.

Chord objects should include a ChordDescriptor.

typedef struct Fader Fader

A Fader is a processor that is used for volume controls and pan.

It does not necessarily have to correspond to a FaderWidget. It can be used as a backend to KnobWidget's.

typedef struct MidiEvents MidiEvents

Container for passing midi events through ports.

This should be passed in the data field of MIDI Ports

typedef struct PortIdentifier PortIdentifier

Struct used to identify Ports in the project.

This should include some members of the original struct enough to identify the port. To be used for sources and dests.

This must be filled in before saving and read from while loading to fill in the srcs/dests.

typedef struct StereoPorts StereoPorts

L & R port, for convenience.

Must ONLY be created via stereo_ports_new()

typedef enum RegionType RegionType

Type of Region.

Bitfield instead of plain enum so multiple values can be passed to some functions (eg to collect all Regions of the given types in a Track).

typedef struct Region Region

A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.

It is uniquely identified using its name (and ArrangerObjectInfo type), so name must be unique throughout the Project.

Each main Region must have its obj_info member filled in with clones.

typedef struct TrackLane TrackLane

A TrackLane belongs to a Track (can have many TrackLanes in a Track) and contains Regions.

Only Tracks that have Regions can have TrackLanes, such as InstrumentTrack and AudioTrack.

typedef struct Tracklist Tracklist

The Tracklist contains all the tracks in the Project.

There should be a clear separation between the Tracklist and the Mixer. The Tracklist should be concerned with Tracks in the arranger, and the Mixer should be concerned with Channels, routing and Port connections.

typedef struct MidiEvents MidiEvents

Container for passing midi events through ports.

This should be passed in the data field of MIDI Ports

Function documentation

void audio_region_free_members(AudioRegion* self)

Frees members only but not the audio region itself.

Regions should be free'd using region_free.

AutomationCurve* automation_curve_new(const AutomatableType a_type, const Position* pos)

Creates an AutomationCurve.

Parameters
a_type The AutomationType, used to figure out the AutomationCurve type.
pos

double automation_curve_get_normalized_value(AutomationCurve* ac, double x)

The function to return a point on the curve.

Parameters
ac The start point (0, 0).
x Normalized x.

See https://stackoverflow.com/questions/17623152/how-map-tween-a-number-based-on-a-dynamic-curve

void automation_curve_free(AutomationCurve* ap)

Frees the automation point.

Frees the automation point.

AutomationPoint* automation_point_new_float(const float value, const Position* pos, int is_main)

Creates an AutomationPoint in the given AutomationTrack at the given Position.

Parameters
value
pos
is_main Whether this AutomationPoint will be the main counterpart (see ArrangerObjectInfo).

void automation_point_update_fvalue(AutomationPoint* ap, float fval, ArrangerObjectUpdateFlag update_flag)

Updates the value and notifies interested parties.

Updates the value and notifies interested parties.

void automation_point_free(AutomationPoint* ap)

Frees the automation point.

Frees the automation point.

Region* automation_region_new(const Position* start_pos, const Position* end_pos, const int is_main)

Creates a new Region for automation.

Parameters
start_pos
end_pos
is_main If this is 1 it will create the additional Region ( main_transient).

void automation_region_add_ac(Region* self, AutomationCurve* ac)

Adds the given AutomationCurve.

double array size if full

AutomationPoint* automation_region_get_prev_ap(Region* self, AutomationPoint* ap)

Returns the AutomationPoint before the position.

Returns the AutomationPoint before the position.

AutomationPoint* automation_region_get_next_ap(Region* self, AutomationPoint* ap)

Returns the AutomationPoint after the position.

Returns the AutomationPoint after the position.

void automation_region_remove_ap(Region* self, AutomationPoint* ap, int free)

Removes the given AutomationPoint from the Region.

Parameters
self
ap
free Optionally free the AutomationPoint.

Removes the given AutomationPoint from the Region.

void automation_region_remove_ac(Region* self, AutomationCurve* ac, int free)

Removes the given AutomationCurve from the Region.

Parameters
self
ac
free Optionally free the AutomationCurve.

Removes the given AutomationCurve from the Region.

void automation_region_free_members(Region* self)

Frees members only but not the Region itself.

Regions should be free'd using region_free.

void channel_handle_recording(Channel* self)

Handles the recording logic inside the process cycle.

The MidiEvents are already dequeued at this point.

void channel_prepare_process(Channel* channel)

Prepares the channel for processing.

To be called before the main cycle each time on all channels.

void channel_process(Channel* channel)

The process function prototype.

Channels must implement this. It is used to perform processing of the audio signal at every cycle.

Normally, the channel will call the process func on each of its plugins in order.

int channel_add_plugin(Channel* channel, int pos, Plugin* plugin, int confirm, int gen_automatables, int recalc_graph)

Adds given plugin to given position in the strip.

Parameters
channel The Channel.
pos The position in the strip starting from 0.
plugin The plugin to add.
confirm Confirm if an existing plugin will be overwritten.
gen_automatables Generatate plugin automatables. To be used when creating a new plugin only.
recalc_graph Recalculate mixer graph.
Returns 1 if plugin added, 0 if not.

The plugin must be already instantiated at this point.

int channel_get_index(Channel* channel)

Returns the index on the mixer.

where is this used?

void channel_reattach_midi_editor_manual_press_port(Channel* channel, int connect)

Connects or disconnects the MIDI editor key press port to the channel's first plugin.

Parameters
channel
connect Connect or not.

Automatable* channel_get_automatable(Channel* channel, AutomatableType type)

Convenience function to get the fader automatable of the channel.

Convenience function to get the fader automatable of the channel.

void channel_generate_automation_tracks(Channel* channel)

Generates automatables for the channel.

Should be called as soon as the track is created.

Generates automatables for the channel.

Should be called as soon as the track is created.

void channel_remove_plugin(Channel* channel, int pos, int deleting_plugin, int deleting_channel, int recalc_graph)

Removes a plugin at pos from the channel.

Parameters
channel
pos
deleting_plugin
deleting_channel
recalc_graph Recalculate mixer graph.

If deleting_channel is 1, the automation tracks associated with he plugin are not deleted at this time.

This function will always recalculate the graph in order to avoid situations where the plugin might be used during processing.

If deleting_channel is 1, the automation tracks associated with the plugin are not deleted at this time.

This function will always recalculate the graph in order to avoid situations where the plugin might be used during processing.

Channel* channel_clone(Channel* ch, Track* track)

Clones the channel recursively.

Parameters
ch
track The track to use for getting the name.

Note the given track is not cloned.

void channel_disconnect(Channel* channel, int remove_pl, int recalc_graph)

Disconnects the channel from the processing chain.

Parameters
channel
remove_pl Remove the Plugin from the Channel. Useful when deleting the channel.
recalc_graph Recalculate mixer graph.

This should be called immediately when the channel is getting deleted, and channel_free should be designed to be called later after an arbitrary delay.

void channel_free(Channel* channel)

Frees the channel.

Channels should never be free'd by themselves in normal circumstances. Use track_free to free them.

int chord_descriptor_is_key_in_chord(ChordDescriptor* chord, MusicalNote key)

Returns if the given key is in the chord represented by the given ChordDescriptor.

Parameters
chord
key A note inside a single octave (0-11).

const char* chord_descriptor_chord_type_to_string(ChordType type)

Returns the chord type as a string (eg.

"aug").

const char* chord_descriptor_chord_accent_to_string(ChordAccent accent)

Returns the chord accent as a string (eg.

"j7").

const char* chord_descriptor_note_to_string(MusicalNote note)

Returns the musical note as a string (eg.

"C3").

char* chord_descriptor_to_string(ChordDescriptor* chord)

Returns the chord in human readable string.

MUST be free'd by caller.

ChordObject* chord_object_find_by_pos(ChordObject* clone)

Finds the ChordObject in the project corresponding to the given one's position.

Used in actions.

Region* chord_region_new(const Position* start_pos, const Position* end_pos, const int is_main)

Creates a new Region for chords.

Parameters
start_pos
end_pos
is_main If this is 1 it will create the additional Region ( main_transient).

void chord_region_remove_chord_object(Region* self, ChordObject* chord, int free)

Removes a ChordObject from the Region.

Parameters
self
chord
free Optionally free the ChordObject.

void chord_region_free_members(Region* self)

Frees members only but not the Region itself.

Regions should be free'd using region_free.

ChordTrack* chord_track_new()

Creates a new chord Track.

Creates a new chord Track.

void engine_realloc_port_buffers(AudioEngine* self, int buf_size)

reallocate port buffers to new size

void engine_init(AudioEngine* self, int loading)

Init audio engine.

loading is 1 if loading a project.

void engine_process_prepare(AudioEngine* self, uint32_t nframes)

To be called by each implementation to prepare the structures before processing.

Clears buffers, marks all as unprocessed, etc.

int engine_process(AudioEngine* self, uint32_t nframes)

Processes current cycle.

To be called by each implementation in its callback.

void fader_init(Fader* self, FaderType type, Channel* ch)

Inits fader to default values.

Parameters
self The Fader to init.
type The FaderType.
ch Channel, if this is a channel Fader.

This assumes that the channel has no plugins.

void fader_set_amp(void* self, float amp)

Sets the amplitude of the fader.

(0.0 to 2.0)

void fader_process(Fader* self, long g_frames, int nframes)

Process the Fader.

Parameters
self
g_frames The global start frames.
nframes The number of frames to process.

REALTIME void instrument_track_fill_midi_events(InstrumentTrack* track, const long g_start_frame, const int local_start_frame, uint32_t nframes, MidiEvents* midi_events)

Fills MIDI event queue from track.

Parameters
track
g_start_frame Global start frame.
local_start_frame The start frame offset from 0 in this cycle.
nframes Number of frames at start Position.
midi_events MidiEvents to fill (from Piano Roll Port for example).

The events are dequeued right after the call to this function.

void instrument_track_free(InstrumentTrack* track)

Frees the track.

TODO

Marker* marker_find(Marker* clone)

Finds the marker in the project corresponding to the given one.

Finds the marker in the project corresponding to the given one.

void marker_track_add_marker(MarkerTrack* self, Marker* marker)

Adds a Marker to the Track.

\

Generates a widget for the Marker.

void master_track_free(Track* track)

Frees the track.

TODO

void metronome_fill_buffer(Metronome* self, float* buf, const long g_start_frame, const int nframes)

Fills the given frame buffer with metronome audio based on the current position.

Parameters
self
buf The frame buffer.
g_start_frame The global start position in frames.
nframes Number of frames to fill. These must not exceed the buffer size.

MidiEvents* midi_events_new(Port* port)

Allocates and inits a MidiEvents struct.

Parameters
port Owner Port.

void midi_events_append(MidiEvents* src, MidiEvents* dest, const int start_frame, const int nframes, int queued)

Appends the events from src to dest.

Parameters
src
dest
start_frame The start frame offset from 0 in this cycle.
nframes Number of frames to process.
queued Append queued events instead of main events.

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.

queued Add to queued events instead.

int midi_events_has_note_on(MidiEvents* self, int check_main, int check_queued)

Returrns if the MidiEvents have any note on events.

Parameters
self
check_main Check the main events.
check_queued Check the queued events.

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.

Parameters
self
channel
note_pitch
time
queued Add to queued events instead.

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.

queued Add to queued events instead.

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.

queued Add to queued events instead.

void midi_events_clear(MidiEvents* midi_events, int queued)

Clears midi events.

Parameters
midi_events
queued Clear queued events instead.

void midi_panic_all(int queued)

Queues MIDI note off to event queues.

Parameters
queued Send the event to queues instead of main events.

void midi_note_get_global_start_pos(MidiNote* self, Position* pos)

Gets the global Position of the MidiNote's start_pos.

Parameters
self
pos Position to fill in.

MidiNote* midi_note_new(MidiRegion* region, Position* start_pos, Position* end_pos, int val, int vel, int is_main)

Parameters
region
start_pos
end_pos
val
vel
is_main Is main MidiNote. If this is 1 then arranger_object_info_init_main() is called to create a transient midi note in obj_info.

int midi_note_is_equal(MidiNote* src, MidiNote* dest)

Returns 1 if the MidiNotes match, 0 if not.

Returns 1 if the MidiNotes match, 0 if not.

void midi_note_shift_pitch(MidiNote* self, int delta, ArrangerObjectUpdateFlag update_flag)

Shifts MidiNote's position and/or value.

Parameters
self
delta Y (0-127)
update_flag

void midi_note_notes_to_events(MidiNote** midi_notes, int num_notes, Position* pos, MidiEvents* events)

Converts an array of MIDI notes to MidiEvents.

Parameters
midi_notes Array of MidiNote's.
num_notes Number of notes in array.
pos Position to offset time from.
events Preallocated struct to fill.

MidiRegion* midi_region_new(const Position* start_pos, const Position* end_pos, int is_main)

Creates a new Region for MIDI notes.

Parameters
start_pos
end_pos
is_main Is main Region. If this is 1 it will create the 3 additional Regions (lane, lane_transient & main_transient).

void midi_region_add_midi_note(MidiRegion* region, MidiNote* midi_note)

Adds midi note to region.

Adds midi note to region.

MidiNote* midi_region_find_unended_note(MidiRegion* self, int pitch)

Returns the midi note with the given pitch from the unended notes.

Used when recording.

void midi_region_print_midi_notes(Region* self)

Prints the MidiNotes in the Region.

Used for debugging.

void midi_region_remove_midi_note(Region* region, MidiNote* midi_note, int free, int pub_event)

Removes the MIDI note from the Region.

Parameters
region
midi_note
free Also free the MidiNote.
pub_event Publish an event.

void midi_region_free_members(MidiRegion* self)

Returns the midi note at given position with the given pitch.

Used when recording. Frees members only but not the midi region itself.

Regions should be free'd using region_free.

Returns the midi note at given position with the given pitch.

Regions should be free'd using region_free.

void port_init_loaded(Port* port)

This function finds the Ports corresponding to the PortIdentifiers for srcs and dests.

Should be called after the ports are loaded from yml.

Port* port_find_from_identifier(PortIdentifier* id)

Finds the Port corresponding to the identifier.

Parameters
id The PortIdentifier to use for searching.

Port* port_new(char* label)

Creates port.

Sets id and updates appropriate counters.

Port* port_new_with_data(PortInternalType internal_type, PortType type, PortFlow flow, char* label, void* data)

Creates port and adds given data to it.

Parameters
internal_type The internal data format.
type
flow
label
data The data.

TODO semaphore

TODO end semaphore

void port_apply_fader(Port* port, float amp, const int start_frame, const int nframes)

Apply given fader value to port.

Parameters
port
amp
start_frame The start frame offset from 0 in this cycle.
nframes The number of frames to process.

void port_sum_signal_from_inputs(Port* port, const int start_frame, const int nframes, const int noroll)

First sets port buf to 0, then sums the given port signal from its inputs.

Parameters
port
start_frame The start frame offset from 0 in this cycle.
nframes The number of frames to process.
noroll Clear the port buffer in this range.

void port_set_owner_plugin(Port* port, Plugin* pl)

Sets the owner plugin & its ID.

Sets the owner plugin & its ID.

void port_print_connections_all()

Prints all connections.

src->owner_tr &&

src->owner_backend)

void port_apply_pan(Port* port, float pan, PanLaw pan_law, PanAlgorithm pan_algo, const int start_frame, const int nframes)

Applies the pan to the given port.

Parameters
port
pan
pan_law
pan_algo
start_frame The start frame offset from 0 in this cycle.
nframes The number of frames to process.

void position_set_tick(Position* position, int tick)

Sets the tick of the Position.

If the tick exceeds the max ticks allowed on the positive or negative axis, it calls position_set_sixteenth until it is within range./

This function can handle both positive and negative Positions. Negative positions start at -1.-1.-1.-1 (one tick before zero) and positive Positions start at zero (1.1.1.0).

long position_to_frames(Position* position)

Converts position bars/beats/quarter beats/ticks to frames.

Note: transport must be setup by this point.

void position_from_seconds(Position* position, double secs)

Converts seconds to position and puts the result in the given Position.

TODO

int position_compare(const Position* p1, const Position* p2)

Compares 2 positions.

negative = p1 is earlier 0 = equal positive = p2 is earlier

negative = p1 < p2 0 = equal positive = p1 > p2

void position_snap(const Position* prev_pos, Position* pos, Track* track, Region* region, const SnapGrid* sg)

Snaps position using given options.

Parameters
prev_pos Previous Position.
pos Position moved to.
track Track at new Position (for Region moving) FIXME needed?.
region Region at new Position (for MidiNote moving) FIXME needed?.
sg SnapGrid options.

NOTE: Does not do negative Positions.

void position_set_min_size(Position* start_pos, Position* end_pos, SnapGrid* snap)

Sets the end position to be 1 snap point away from the start pos.

Parameters
start_pos Start Position.
end_pos Position to set.
snap The SnapGrid.

FIXME rename to something more meaningful.

FIXME rename to something more meaningful.

void position_get_midway_pos(Position* start_pos, Position* end_pos, Position* pos)

Calculates the midway point between the two Positions and sets it on pos.

Parameters
start_pos
end_pos
pos Position to set to.

Calculates the midway point between the two Positions and sets it on pos.

long position_get_ticks_diff(const Position* end_pos, const Position* start_pos, const SnapGrid* sg)

Returns the difference in ticks between the two Position's, snapped based on the given SnapGrid (if any).

Parameters
end_pos End position.
start_pos Start Position.
sg SnapGrid to snap with, or NULL to not snap.

char* position_stringize(const Position* pos)

Creates a string in the form of "0.0.0.0" from the given position.

Must be free'd by caller.

char* quantize_options_stringize(NoteLength note_length, NoteType note_type)

Returns the grid intensity as a human-readable string.

Must be free'd.

Returns the grid intensity as a human-readable string.

Must be free'd.

int quantize_options_quantize_position(QuantizeOptions* self, Position* pos)

Quantizes the given Position using the given QuantizeOptions.

Returns The amount of ticks moved (negative for backwards).

This assumes that the start/end check has been done already and it ignores the adjust_start and adjust_end options.

void region_init(Region* region, const Position* start_pos, const Position* end_pos, const int is_main)

Only to be used by implementing structs.

Parameters
region
start_pos
end_pos
is_main Is main Region. If this is 1 then arranger_object_info_init_main() is called to create 3 additional regions in obj_info.

Region* region_find(Region* r)

Finds the region corresponding to the given one.

This should be called when we have a copy or a clone, to get the actual region in the project.

Region* region_find_by_name(const char* name)

Looks for the Region under the given name.

Warning: very expensive function.

void region_split(Region* region, const Position* pos, const int pos_is_local, Region** r1, Region** r2)

Splits the given Region at the given Position, deletes the original Region and adds 2 new Regions in the same parent (Track or AutomationTrack).

Parameters
region The Region to split. This Region will be deleted.
pos The Position to split at.
pos_is_local If the position is local (1) or global (0).
r1 Address to hold the pointer to the newly created region 1.
r2 Address to hold the pointer to the newly created region 2.

The given region must be the main region, as this will create 2 new main regions.

void region_unsplit(Region* r1, Region* r2, Region** region)

Undoes what region_split() did.

Parameters
r1 The first region.
r2 The second Region.
region An address to store the newly created Region.

MidiNote* region_find_midi_note(Region* r, MidiNote* _mn)

Returns the MidiNote matching the properties of the given MidiNote.

Used to find the actual MidiNote in the region from a cloned MidiNote (e.g. when doing/undoing).

long region_timeline_frames_to_local(const Region* region, const long timeline_frames, const int normalize)

Converts frames on the timeline (global) to local frames (in the clip).

Parameters
region
timeline_frames Timeline position in frames.
normalize
Returns The local frames.

If normalize is 1 it will only return a position from 0 to loop_end (it will traverse the loops to find the appropriate position), otherwise it may exceed loop_end.

void region_copy(Region* src, Region* dest)

Copies the data from src to dest.

Used when doing/undoing changes in name, clip start point, loop start point, etc.

int region_is_hit(const Region* region, const long gframes)

Returns if the position is inside the region or not.

Parameters
region
gframes Global position in frames.

Region* region_at_position(Track* track, Position* pos)

Returns the region at the given position in the given Track.

Parameters
track The track to look in.
pos The position.

FIXME with lanes there can be multiple positions.

char* region_generate_filename(Region* region)

Generates the filename for this region.

MUST be free'd.

MUST be free'd.

FIXME logic needs changing

Region* region_clone(Region* region, RegionCloneFlag flag)

Clone region.

Creates a new region and either links to the original or copies every field.

void region_disconnect(Region* self)

Disconnects the region and anything using it.

Does not free the Region or its children's resources.

void sample_processor_process(SampleProcessor* self, const int offset, const int nframes)

Process the samples for the given number of frames.

Parameters
self
offset The local offset in the processing cycle.
nframes

char* musical_scale_to_string(MusicalScale* scale)

Prints the MusicalScale to a string.

MUST be free'd.

int musical_scale_is_key_in_scale(MusicalScale* scale, MusicalNote key)

Returns if the given key is in the given MusicalScale.

Parameters
scale
key A note inside a single octave (0-11).

char* musical_scale_as_string(MusicalScale* scale)

Returns the scale in human readable string.

MUST be free'd by caller.

TrackLane* track_lane_new(Track* track, int pos)

Creates a new TrackLane at the given pos in the given Track.

Parameters
track The Track to create the TrackLane for.
pos The position (index) in the Track that this lane will be placed in.

TrackLane* track_lane_clone(TrackLane* lane)

Clones the TrackLane.

Mainly used when cloning Track's.

void tracklist_insert_track(Tracklist* self, Track* track, int pos, int publish_events, int recalc_graph)

Adds given track to given spot in tracklist.

Parameters
self
track
pos
publish_events Publish UI events.
recalc_graph Recalculate routing graph.

void tracklist_remove_track(Tracklist* self, Track* track, int rm_pl, int free, int publish_events, int recalc_graph)

Removes a track from the Tracklist and the TracklistSelections.

Parameters
self
track
rm_pl Remove plugins or not.
free Free the track or not (free later).
publish_events Push a track deleted event to the UI.
recalc_graph Recalculate the mixer graph.

Also disconnects the channel.

void tracklist_move_track(Tracklist* self, Track* track, int pos, int publish_events, int recalc_graph)

Moves a track from its current position to the position given by pos.

Parameters
self
track
pos
publish_events Push UI update events or not.
recalc_graph Recalculate routing graph.

void transport_set_beat_unit(Transport* self, int beat_unit)

Updates beat unit and anything depending on it.

Regarding calculation: 3840 = TICKS_PER_QUARTER_NOTE * 4 to get the ticks per full note. Divide by beat unit (e.g. if beat unit is 2, it means it is a 1/2th note, so multiply 1/2 with the ticks per note

void transport_move_playhead(Position* target, int panic)

Moves playhead to given pos.

Parameters
target Position to set to.
panic Send MIDI panic or not.

This is only for moves other than while playing and for looping while playing.

long transport_frames_add_frames(const Transport* self, const long gframes, const int frames)

Adds frames to the given global frames, while adjusting the new frames to loop back if the loop point was crossed.

Returns The new frames adjusted.

void transport_position_add_frames(const Transport* self, Position* pos, const int frames)

Adds frames to the given position similar to position_add_frames, except that it adjusts the new Position if the loop end point was crossed.

Adds frames to the given position similar to position_add_frames, except that it adjusts the new Position if the loop end point was crossed.

Define documentation

#define PORT_NOT_OWNED

Special ID for owner_pl, owner_ch, etc.

to indicate that the port is not owned.

#define POSITION_MOVE_BY_TICKS(_tmp_pos, _use_cached, _obj, _pos_name, _ticks, _update_flag)

Moves the Position of an object only has a start position defined by the argument pos_name and a cache position named cache_##pos_name by the given amount of ticks.

Parameters
_tmp_pos A Position variable to use for calculations so we don't create one in the macro.
_use_cached An int variable set to 1 for using the cached positions or 0 for moving the normal positions.
_obj The object.
_pos_name The name of the position.
_ticks The number of ticks to move by.
_update_flag

This also assumes that there is a SET_POS defined. See audio/chord_object.c for an example.

This doesn't allow the start position to be less than 1.1.1.0.

#define POSITION_MOVE_BY_TICKS_W_LENGTH(_tmp_pos, _use_cached, _obj, _ticks, _update_flag)

Moves the Position of an object that has a start and end position named start_pos and end_pos and cached positions named cache_start_pos and cache_end_pos by given amount of ticks.

Parameters
_tmp_pos A Position variable to use for calculations so we don't create one in the macro.
_use_cached An int variable set to 1 for using the cached positions or 0 for moving the normal positions.
_obj The object.
_ticks The number of ticks to move by.
_update_flag ArrangerObjectUpdateFlag.

This also assumes that there is a SET_POS defined. See audio/region.c for an example.

This doesn't allow the start position to be less than 1.1.1.0.

#define region_get_lane_region(r)

Gets the TrackLane counterpart of the Region.

Only applies to Regions that have lanes.

#define region_get_lane_trans_region(r)

Gets the TrackLane counterpart of the Region (transient).

Only applies to Regions that have lanes.