Module project
Provide implementation for Project functions.
Info:
- License: MIT
- Author: Nomad Monad
ReaWrap Custom Methods
| Project:new (project_idx) | Create new Project instance. |
| Project:log (...) | Log messages with the Project logger. |
| Project:__tostring () | String representation of the Project instance. |
| Project:get_selected_tracks (master) | Get all selected tracks. |
| Project:iter_selected_tracks (master) | Iterate over selected tracks. |
| Project:has_selected_tracks (master) | Whether there is at least one selected track. |
| Project:get_selected_media_items () | Get all selected media items. |
| Project:iter_selected_media_items () | Iterate over selected media items. |
| Project:has_selected_media_items () | Whether there are any selected media items. |
| Project:get_tracks () | Get all tracks in the project. |
| Project:iter_tracks () | Iterate over all tracks in the project. |
| Project:has_tracks () | Whether there is at least one track in the project. |
| Project:get_tcp_fx_params () | Get all TCP FX params. |
| Project:iter_tcp_fx_params () | Iterate over all TCP FX params in the project. |
| Project:has_tcp_fx_params () | Whether there is at least one TCP FX Param in the project. |
ReaScript Wrapped Methods
Constants
| Project.NudgeConstants.FLAG | Flags for nudge operations. |
| Project.NudgeConstants.WHAT | Targets for nudge operations. |
| Project.NudgeConstants.UNIT | Units for nudge operations. |
| Project.GetSetProjectInfoConstants | Constants for Project:get_set_project_info. |
| Project.GetSetProjectInfoStringConstants | Constants for Project:get_set_project_info_string. |
ReaWrap Custom Methods
- Project:new (project_idx)
-
Create new Project instance.
Parameters:
- project_idx number Optional. The index of the project
Returns:
-
table Project instance
- Project:log (...)
-
Log messages with the Project logger.
Parameters:
- ... (varargs) Messages to log.
- Project:__tostring ()
-
String representation of the Project instance.
Returns:
-
string
- Project:get_selected_tracks (master)
-
Get all selected tracks.
Parameters:
- master boolean Whether to include the master track. Optional (Default is false).
Returns:
-
table array
- Project:iter_selected_tracks (master)
-
Iterate over selected tracks.
Parameters:
- master boolean Whether to include the master track. Optional (Default is false).
Returns:
-
function iterator
- Project:has_selected_tracks (master)
-
Whether there is at least one selected track.
Parameters:
- master boolean Whether to include the master track. Optional (Default is false).
Returns:
-
boolean
- Project:get_selected_media_items ()
-
Get all selected media items.
Returns:
-
table array of Item objects
- Project:iter_selected_media_items ()
-
Iterate over selected media items.
Returns:
-
function iterator
- Project:has_selected_media_items ()
-
Whether there are any selected media items.
Returns:
-
boolean
- Project:get_tracks ()
-
Get all tracks in the project.
Returns:
-
table array of Track objects
- Project:iter_tracks ()
-
Iterate over all tracks in the project.
Returns:
-
function iterator
- Project:has_tracks ()
-
Whether there is at least one track in the project.
Returns:
-
boolean
- Project:get_tcp_fx_params ()
-
Get all TCP FX params.
Returns:
-
table array
- Project:iter_tcp_fx_params ()
-
Iterate over all TCP FX params in the project.
Returns:
-
function iterator
- Project:has_tcp_fx_params ()
-
Whether there is at least one TCP FX Param in the project.
Returns:
-
boolean
ReaScript Wrapped Methods
- Project:add_project_marker (is_rgn, pos, rgn_end, name, want_idx, color)
-
Add Project Marker. Wraps AddProjectMarker2.
Returns the index of the created marker/region, or -1 on failure. Supply
want_idx>=0 if you want a particular index number, but you'll get a different
index number a region and want_idx is already in use. color should be 0 (default
color), or ColorToNative(r,g,b)|0x1000000
Parameters:
- is_rgn boolean
- pos number
- rgn_end number
- name string
- want_idx number
- color number
Returns:
-
number
- Project:any_track_solo ()
-
Any Track Solo. Wraps AnyTrackSolo.
Returns:
-
boolean
- Project.NudgeConstants
-
Project.NudgeConstants: A table of constants for nudge operations.
Fields:
- FLAG table<#string, #number> Flags for nudge operations.
- WHAT table<#string, #number> Targets for nudge operations.
- UNIT table<#string, #number> Units for nudge operations.
- Project:apply_nudge (nudge_flag, nudge_what, nudge_units, value, reverse, copies)
-
Apply Nudge. Wraps ApplyNudge.
Parameters:
- nudge_flag number Project.NudgeConstants.FLAG
- nudge_what number Project.NudgeConstants.WHAT.
- nudge_units number Project.NudgeConstants.UNIT.
- value number
- reverse boolean
- copies number
Returns:
-
boolean
See also:
- Project:count_media_items ()
-
Count Media Items. Wraps CountMediaItems.
count the number of items in the project (proj=0 for active project)
Returns:
-
number
- Project:count_project_markers ()
-
Count Project Markers. Wraps CountProjectMarkers.
num_markersOut and num_regionsOut may be NULL.
Returns:
- number num_markers
- number num_regions
- Project:count_selected_tracks (want_master)
-
Count Selected Tracks. Wraps CountSelectedTracks2.
Count the number of selected tracks in the project (proj=0 for active project).
Parameters:
- want_master boolean Optional
Returns:
-
number
- Project:count_tcp_fx_params (track)
-
Count TCP FX Params. Wraps CountTCPFXParms.
Count the number of FX parameter knobs displayed on the track control panel.
Parameters:
- track table Track object
Returns:
-
number
- Project:count_tempo_time_sig_markers ()
-
Count Tempo Time Sig Markers. Wraps CountTempoTimeSigMarkers.
Count the number of tempo/time signature markers in the project.
Returns:
-
number
See also:
- Project:count_tracks ()
-
Count Tracks. Wraps CountTracks.
count the number of tracks in the project (proj=0 for active project)
Returns:
-
number
- Project:delete_track (track_idx)
-
Delete Track. Wraps DeleteTrack.
Deletes a track.
Parameters:
- track_idx number
- Project:delete_project_marker (mark_rgn_idx, is_rgn)
-
Delete Project Marker. Wraps DeleteProjectMarker.
Delete a marker. proj==NULL for the active project.
Parameters:
- mark_rgn_idx number
- is_rgn boolean
Returns:
-
boolean
- Project:delete_project_marker_by_index (mark_rgn_idx)
-
Delete Project Marker By Index. Wraps DeleteProjectMarkerByIndex.
Differs from DeleteProjectMarker only in that mark_rgn_idx is 0 for the first
marker/region, 1 for the next, etc (see EnumProjectMarkers3), rather than
representing the displayed marker/region ID number (see SetProjectMarker4).
Parameters:
- mark_rgn_idx number
Returns:
-
boolean
- Project:delete_tempo_time_sig_marker (marker_idx)
-
Delete Tempo Time Sig Marker. Wraps DeleteTempoTimeSigMarker.
Delete a tempo/time signature marker.
Parameters:
- marker_idx number
Returns:
-
boolean
- Project:edit_tempo_time_sig_marker (marker_idx)
-
Edit Tempo Time Sig Marker. Wraps EditTempoTimeSigMarker.
Open the tempo/time signature marker editor dialog.
Parameters:
- marker_idx number
Returns:
-
boolean
- Project:enum_project_markers (idx)
-
Enum Project Markers. Wraps EnumProjectMarkers3.
Parameters:
- idx number
Returns:
- boolean is_rgn
- number pos
- number rgn_end
- string name
- number mark_rgn_idx
- number color
- Project:enum_proj_ext_state (ext_name, idx)
-
Enum Proj Ext State. Wraps EnumProjExtState.
Enumerate the data stored with the project for a specific extname. Returns false
when there is no more data.
Parameters:
- ext_name string
- idx number
Returns:
- string key
- string val
See also:
- Project:enum_region_render_matrix (region_idx, render_track)
-
Enum Region Render Matrix. Wraps EnumRegionRenderMatrix.
Enumerate which tracks will be rendered within this region when using the region
render matrix. When called with render_track==0, the function returns the first
track that will be rendered (which may be the master track); render_track==1 will
return the next track rendered, and so on. The function returns NULL when there
are no more tracks that will be rendered within this region.
Parameters:
- region_idx number
- render_track number
Returns:
-
table Track object
- Project:enum_track_midi_program_names_ex (track, program_number, program_name)
-
Enum Track Midi Program Names Ex. Wraps EnumTrackMIDIProgramNamesEx.
returns false if there are no plugins on the track that support MIDI programs,or
if all programs have been enumerated
Parameters:
- track table Track object
- program_number number
- program_name string
Returns:
-
string program_name
- Project:find_tempo_time_sig_marker (time)
-
Find Tempo Time Sig Marker. Wraps FindTempoTimeSigMarker.
Find the tempo/time signature marker that falls at or before this time position
(the marker that is in effect as of this time position).
Parameters:
- time number
Returns:
-
number
- Project:get_all_project_play_states ()
-
Get All Project Play States. Wraps GetAllProjectPlayStates.
returns the bitwise OR of all project play states (1=playing, 2=pause,
4=recording)
Returns:
-
number
- Project:get_cursor_position_ex ()
-
Get Cursor Position Ex. Wraps GetCursorPositionEx.
edit cursor position
Returns:
-
number
- Project:get_free_disk_space_for_record_path (path_idx)
-
Get Free Disk Space For Record Path. Wraps GetFreeDiskSpaceForRecordPath.
returns free disk space in megabytes, pathIdx 0 for normal, 1 for alternate.
Parameters:
- path_idx number
Returns:
-
number
- Project:get_last_marker_and_cur_region (time)
-
Get Last Marker And Cur Region. Wraps GetLastMarkerAndCurRegion.
Get the last project marker before time, and/or the project region that includes
time. marker_idx and region_idx are returned not necessarily as the displayed
marker/region index, but as the index that can be passed to Project:enum_project_markers.
Either or both of marker_idx and region_idx may be NULL.
Parameters:
- time number
Returns:
- number marker_idx
- number region_idx
See also:
- Project:get_master_track ()
-
Get Master Track. Wraps GetMasterTrack.
Returns:
-
table Track object
- Project:get_media_item (item_idx)
-
Get Media Item. Wraps GetMediaItem.
get an item from a project by item count (zero-based) (proj=0 for active
project)
Parameters:
- item_idx number
Returns:
-
table Item object
- Project:get_media_item_take_by_guid (guid)
-
Get Media Item Take By Guid. Wraps GetMediaItemTakeByGUID.
Parameters:
- guid string
Returns:
-
table Take object
- Project:get_play_position ()
-
Get Play Position. Wraps GetPlayPosition2Ex.
returns position of next audio block being processed
Returns:
-
number
- Project:get_play_position_lat_comp ()
-
Get Play Position Lat Comp. Wraps GetPlayPositionEx.
returns latency-compensated actual-what-you-hear position
Returns:
-
number
- Project:get_play_state_ex ()
-
Get Play State Ex. Wraps GetPlayStateEx.
&1=playing, &2=paused, &4=is recording
Returns:
-
number
- Project:get_project_length ()
-
Get Project Length. Wraps GetProjectLength.
returns length of project (maximum of end of media item, markers, end of
regions, tempo map
Returns:
-
number
- Project:get_name ()
-
Get Name. Wraps GetProjectName.
Returns:
-
string name
- Project:get_project_path_ex ()
-
Get Project Path Ex. Wraps GetProjectPathEx.
Get the project recording path.
Returns:
-
string path
- Project:get_project_state_change_count ()
-
Get Project State Change Count. Wraps GetProjectStateChangeCount.
returns an integer that changes when the project state changes
Returns:
-
number
- Project:get_project_time_offset (rnd_frame)
-
Get Project Time Offset. Wraps GetProjectTimeOffset.
Gets project time offset in seconds (project settings - project start time). If
rnd_frame is true, the offset is rounded to a multiple of the project frame size.
Parameters:
- rnd_frame boolean
Returns:
-
number
- Project:get_project_time_signature ()
-
Get Project Time Signature. Wraps GetProjectTimeSignature2.
Gets basic time signature (beats per minute, numerator of time signature in bpi)
this does not reflect tempo envelopes but is purely what is set in the project
settings.
Returns:
- number bpm
- number bpi
- Project:get_proj_ext_state (ext_name, key)
-
Get Proj Ext State. Wraps GetProjExtState.
Get the value previously associated with this extname and key, the last time the
project was saved.
Parameters:
- ext_name string
- key string
Returns:
-
string value
See also:
- Project:get_selected_envelope ()
-
Get Selected Envelope. Wraps GetSelectedEnvelope.
Get the currently selected envelope, returns NULL/nil if no envelope is selected.
Returns:
-
table Envelope object
- Project:get_selected_track (seltrack_idx, want_master)
-
Get Selected Track. Wraps GetSelectedTrack2.
Get a selected track from a project (proj=0 for active project) by selected
track count (zero-based).
Parameters:
- seltrack_idx number
- want_master boolean Optional
Returns:
-
table Track object
- Project:get_selected_track_envelope ()
-
Get Selected Track Envelope. Wraps GetSelectedTrackEnvelope.
get the currently selected track envelope, returns NULL/nil if no envelope is
selected
Returns:
-
table Envelope object
- Project:get_set_arrange_view2 (is_set, screen_x_start, screen_x_end, start_time, end_time)
-
Get Set Arrange View2. Wraps GetSet_ArrangeView2.
Gets or sets the arrange view start/end time for screen coordinates. use
screen_x_start=screen_x_end=0 to use the full arrange view's start/end time
Parameters:
- is_set boolean
- screen_x_start number
- screen_x_end number
- start_time number
- end_time number
Returns:
- number start_time
- number end_time
- Project:get_set_loop_time_range2 (is_set, is_loop, start, end_, allowautoseek)
-
Get Set Loop Time Range2. Wraps GetSet_LoopTimeRange2.
Parameters:
- is_set boolean
- is_loop boolean
- start number
- end_ number
- allowautoseek boolean
Returns:
- number start
- number end_
- Project:get_set_project_grid (set, division, swingmode, swingamt)
-
Get Set Project Grid. Wraps GetSetProjectGrid.
Get or set the arrange view grid division. 0.25=quarter note, 1.0/3.0=half note
triplet, etc. swingmode can be 1 for swing enabled, swingamt is -1..1. swingmode
can be 3 for measure-grid. Returns grid configuration flags
Parameters:
- set boolean
- division number Optional
- swingmode integer Optional
- swingamt number Optional
Returns:
- number division
- integer swingmode
- number swingamt
- Project:get_set_project_info (desc, value, is_set)
-
Get Set Project Info. Wraps GetSetProjectInfo.
Get or set project information.
Parameters:
- desc string Project.GetSetProjectInfoConstants
- value number
- is_set boolean
Returns:
-
number
- Project:get_set_project_info_string (desc, valuestr, is_set)
-
Get Set Project Info String. Wraps GetSetProjectInfo_String.
Get or set project information.GetProjectPathEx()RENDER_FORMAT2 : base64-encoded
secondary sink configuration. Callers can also pass a simple 4-byte string (non-
base64-encoded), e.g. "evaw" or "l3pm", to use default settings for that sink
type, or "" to disable secondary render.Formats available on this machine:"wave"
"aiff" "caff" "raw " "iso " "ddp " "flac" "mp3l" "oggv" "OggS" "FFMP" "WMF "
"GIF " "LCF " "wvpk"
Parameters:
- desc string Project.GetSetProjectInfoStringConstants
- valuestr string
- is_set boolean
Returns:
-
string valuestr
- Project:get_set_project_notes (is_set, notes)
-
Get Set Project Notes. Wraps GetSetProjectNotes.
gets or sets project notes, notesNeedBig_sz is ignored when setting
Parameters:
- is_set boolean
- notes string
Returns:
-
string
- Project:get_set_repeat_ex (val)
-
Get Set Repeat Ex. Wraps GetSetRepeatEx.
-1 == query,0=clear,1=set,>1=toggle . returns new value
Parameters:
- val number
Returns:
-
number
- Project:get_set_tempo_time_sig_marker_flag (point_index, flag, is_set)
-
Get Set Tempo Time Sig Marker Flag. Wraps GetSetTempoTimeSigMarkerFlag.
Gets or sets the attribute flag of a tempo/time signature marker. flag &1=sets
time signature and starts new measure, &2=does not set tempo, &4=allow previous
partial measure if starting new measure, &8=set new metronome pattern if
starting new measure, &16=reset ruler grid if starting new measure
Parameters:
- point_index number
- flag number
- is_set boolean
Returns:
-
number
- Project:get_tcp_fx_param (track, index)
-
Get TCP FX Param. Wraps GetTCPFXParm.
Get information about a specific FX parameter knob (see CountTCPFXParms).
Parameters:
- track table Track object
- index number
Returns:
- number fx_idx
- number param_idx
- Project:get_tempo_time_sig_marker (pt_idx)
-
Get Tempo Time Sig Marker. Wraps GetTempoTimeSigMarker.
Get information about a tempo/time signature marker.
Parameters:
- pt_idx number
Returns:
- number time_pos
- number measure_pos
- number beat_pos
- number bpm
- number time_sig_num
- number time_sig_denom
- boolean linear_tempo
See also:
- Project:get_track (track_idx)
-
Get Track. Wraps GetTrack.
get a track from a project by track count (zero-based) (proj=0 for active
project)
Parameters:
- track_idx number
Returns:
-
table Track object
- Project:get_track_midi_note_name_ex (track, pitch, chan)
-
Get Track Midi Note Name Ex. Wraps GetTrackMIDINoteNameEx.
Get note/CC name. pitch 128 for CC0 name, 129 for CC1 name, etc.
Parameters:
- track table Track object
- pitch number
- chan number
Returns:
-
string
See also:
- Project:get_track_midi_note_range (track)
-
Get Track Midi Note Range. Wraps GetTrackMIDINoteRange.
Parameters:
- track table Track object
Returns:
- number note_lo
- number note_hi
- Project:go_to_marker (marker_index, use_timeline_order)
-
Go To Marker. Wraps GoToMarker.
Go to marker. If use_timeline_order==true, marker_index 1 refers to the first
marker on the timeline. If use_timeline_order==false, marker_index 1 refers to
the first marker with the user-editable index of 1.
Parameters:
- marker_index number
- use_timeline_order boolean
- Project:go_to_region (region_index, use_timeline_order)
-
Go To Region. Wraps GoToRegion.
Seek to region after current region finishes playing (smooth seek). If
use_timeline_order==true, region_index 1 refers to the first region on the
timeline. If use_timeline_order==false, region_index 1 refers to the first
region with the user-editable index of 1.
Parameters:
- region_index number
- use_timeline_order boolean
- Project:has_track_midi_programs (track)
-
Has Track Midi Programs. Wraps HasTrackMIDIProgramsEx.
returns name of track plugin that is supplying MIDI programs,or NULL if there is none
Parameters:
- track table Track object
Returns:
-
string
- Project:insert_track_in_project (idx, flags)
-
Insert Track In Project. Wraps InsertTrackInProject.
inserts a track in project proj at idx, this will be clamped to
0..CountTracks(proj). flags&1 for default envelopes/FX, otherwise no enabled
fx/envelopes will be added.
Parameters:
- idx number
- flags number
- Project:is_project_dirty ()
-
Is Project Dirty. Wraps IsProjectDirty.
Is the project dirty (needing save)? Always returns 0 if 'undo/prompt to save'
is disabled in preferences.
Returns:
-
number
- Project:on_arrow (direction)
-
On Arrow. Wraps Loop_OnArrow.
Move the loop selection left or right. Returns true if snap is enabled.
Parameters:
- direction number
Returns:
-
boolean
- Project:save_project (force_save_as_in)
-
Save Project. Wraps Main_SaveProject.
Save the project.
Parameters:
- force_save_as_in boolean
- Project:save_project_ex (file_name, options)
-
Save Project Ex. Wraps Main_SaveProjectEx.
Save the project. options: &1=save selected tracks as track template, &2=include
media with track template, &4=include envelopes with track template.
Parameters:
- file_name string
- options number
- Project:mark_project_dirty ()
- Mark Project Dirty. Wraps MarkProjectDirty. Marks project as dirty (needing save) if 'undo/prompt to save' is enabled in preferences.
- Project:get_play_rate ()
-
Get Play Rate. Wraps Master_GetPlayRate.
Returns:
-
number
- Project:on_pause_button_ex ()
- On Pause Button Ex. Wraps OnPauseButtonEx. direct way to simulate pause button hit
- Project:on_play_button_ex ()
- On Play Button Ex. Wraps OnPlayButtonEx. direct way to simulate play button hit
- Project:on_stop_button_ex ()
- On Stop Button Ex. Wraps OnStopButtonEx. direct way to simulate stop button hit
- Project:select_all_media_items (selected)
-
Select All Media Items. Wraps SelectAllMediaItems.
Parameters:
- selected boolean
- Project:select_project_instance ()
- Select Project Instance. Wraps SelectProjectInstance.
- Project:set_current_bpm (bpm, want_undo)
-
Set Current Bpm. Wraps SetCurrentBPM.
set current BPM in project, set wantUndo=true to add undo point
Parameters:
- bpm number
- want_undo boolean
- Project:set_edit_cur_pos2 (time, moveview, seekplay)
-
Set Edit Cur Pos2. Wraps SetEditCurPos2.
Parameters:
- time number
- moveview boolean
- seekplay boolean
- Project:set_midi_editor_grid (division)
-
Set Midi Editor Grid. Wraps SetMIDIEditorGrid.
Set the MIDI editor grid division. 0.25=quarter note, 1.0/3.0=half note tripet,
etc.
Parameters:
- division number
- Project:set_project_grid (division)
-
Set Project Grid. Wraps SetProjectGrid.
Set the arrange view grid division. 0.25=quarter note, 1.0/3.0=half note
triplet, etc.
Parameters:
- division number
- Project:set_project_marker2 (markr_rgn_idx, is_rgn, pos, rgn_end, name)
-
Set Project Marker2. Wraps SetProjectMarker2.
Note: this function can't clear a marker's name (an empty string will leave the
name unchanged), see SetProjectMarker4.
Parameters:
- markr_rgn_idx number
- is_rgn boolean
- pos number
- rgn_end number
- name string
Returns:
-
boolean
- Project:set_project_marker3 (markr_rgn_idx, is_rgn, pos, rgn_end, name, color)
-
Set Project Marker3. Wraps SetProjectMarker3.
Note: this function can't clear a marker's name (an empty string will leave the
name unchanged), see SetProjectMarker4.
Parameters:
- markr_rgn_idx number
- is_rgn boolean
- pos number
- rgn_end number
- name string
- color number
Returns:
-
boolean
- Project:set_project_marker4 (markr_rgn_idx, is_rgn, pos, rgn_end, name, color, flags)
-
Set Project Marker4. Wraps SetProjectMarker4.
color should be 0 to not change, or ColorToNative(r,g,b)|0x1000000, flags&1 to
clear name
Parameters:
- markr_rgn_idx number
- is_rgn boolean
- pos number
- rgn_end number
- name string
- color number
- flags number
Returns:
-
boolean
- Project:set_project_marker_by_index (mark_rgn_idx, is_rgn, pos, rgn_end, id_num, name, color)
-
Set Project Marker By Index. Wraps SetProjectMarkerByIndex.
Parameters:
- mark_rgn_idx number
- is_rgn boolean
- pos number
- rgn_end number
- id_num number
- name string
- color number
Returns:
-
boolean
See also:
- Project:set_project_marker_by_index2 (mark_rgn_idx, is_rgn, pos, rgn_end, id_num, name, color, flags)
-
Set Project Marker By Index2. Wraps SetProjectMarkerByIndex2.
Differs from SetProjectMarker4 in that mark_rgn_idx is 0 for the first
marker/region, 1 for the next, etc (see EnumProjectMarkers3), rather than
representing the displayed marker/region ID number (see SetProjectMarker3).
Function will fail if attempting to set a duplicate ID number for a region
(duplicate ID numbers for markers are OK).flags&1 to clear name. If flags&2,
markers will not be re-sorted, and after making updates, you MUST call
SetProjectMarkerByIndex2 with mark_rgn_idx=-1 and flags&2 to force re-sort/UI
updates.
Parameters:
- mark_rgn_idx number
- is_rgn boolean
- pos number
- rgn_end number
- id_num number
- name string
- color number
- flags number
Returns:
-
boolean
See also:
- Project:set_proj_ext_state (ext_name, key, value)
-
Set Proj Ext State. Wraps SetProjExtState.
Save a key/value pair for a specific extension, to be restored the next time
this specific project is loaded. Typically extname will be the name of a
reascript or extension section. If key is NULL or "", all extended data for that
extname will be deleted. If val is NULL or "", the data previously associated
with that key will be deleted. Returns the size of the state for this extname.
Parameters:
- ext_name string
- key string
- value string
Returns:
-
number
See also:
- Project:set_region_render_matrix (region_idx, track, flag)
-
Set Region Render Matrix. Wraps SetRegionRenderMatrix.
Add (flag > 0) or remove (flag < 0) a track from this region when using the
region render matrix. If adding, flag==2 means force mono, flag==4 means force
stereo, flag==N means force N/2 channels.
Parameters:
- region_idx number
- track table Track object
- flag number
- Project:set_tempo_time_sig_marker (pt_idx, time_pos, measure_pos, beat_pos, bpm, time_sig_num, time_sig_denom, linear_tempo)
-
Set Tempo Time Sig Marker. Wraps SetTempoTimeSigMarker.
Set parameters of a tempo/time signature marker. Provide either time_pos (with
measure_pos=-1, beat_pos=-1), or measure_pos and beat_pos (with time_pos=-1). If
time_sig_num and time_sig_denom are zero, the previous time signature will be
used. pt_idx=-1 will insert a new tempo/time signature marker. AddTempoTimeSigMarker.
Parameters:
- pt_idx number
- time_pos number
- measure_pos number
- beat_pos number
- bpm number
- time_sig_num number
- time_sig_denom number
- linear_tempo boolean
Returns:
-
boolean
See also:
- Project:set_track_midi_note_name_ex (track, pitch, chan, name)
-
Set Track Midi Note Name Ex. Wraps SetTrackMIDINoteNameEx.
channel < 0 assigns note name to all channels. pitch 128 assigns name for CC0,
pitch 129 for CC1, etc.
Parameters:
- track table Track object
- pitch number
- chan number
- name string
Returns:
-
boolean
- Project:snap_to_grid (time_pos)
-
Snap To Grid. Wraps SnapToGrid.
Parameters:
- time_pos number
Returns:
-
number
- Project:beats_to_time (tpos, measures)
-
Beats To Time. Wraps TimeMap2_beatsToTime.
convert a beat position (or optionally a beats+measures if measures is non-NULL)
to time.
Parameters:
- tpos number
- measures integer Optional
Returns:
-
number
- Project:get_divided_bpm_at_time (time)
-
Get Divided Bpm At Time. Wraps TimeMap2_GetDividedBpmAtTime.
get the effective BPM at the time (seconds) position (i.e. 2x in /8 signatures)
Parameters:
- time number
Returns:
-
number
- Project:get_next_change_time (time)
-
Get Next Change Time. Wraps TimeMap2_GetNextChangeTime.
when does the next time map (tempo or time sig) change occur
Parameters:
- time number
Returns:
-
number
- Project:qn_to_time (qn)
-
Qn To Time. Wraps TimeMap2_QNToTime.
converts project QN position to time.
Parameters:
- qn number
Returns:
-
number
- Project:time_to_beats (tpos)
-
Time To Beats. Wraps TimeMap2_timeToBeats.
convert a time into beats. if measures is non-NULL, measures will be set to the
measure count, return value will be beats since measure. if cml is non-NULL,
will be set to current measure length in beats (i.e. time signature numerator)
if full_beats is non-NULL, and measures is non-NULL, full_bats will get the full
beat count (same value returned if measures is NULL). if cdenom is non-NULL,
will be set to the current time signature denominator.
Parameters:
- tpos number
Returns:
- number measures
- number cml
- number full_beats
- number cdenom
- Project:time_to_qn (tpos)
-
Time To Qn. Wraps TimeMap2_timeToQN.
converts project time position to QN position.
Parameters:
- tpos number
Returns:
-
number
- Project:cur_frame_rate ()
-
Cur Frame Rate. Wraps TimeMap_curFrameRate.
Gets project framerate, and optionally whether it is drop-frame timecode
Returns:
-
boolean drop_frame
- Project:get_measure_info (measure)
-
Get Measure Info. Wraps TimeMap_GetMeasureInfo.
Get the QN position and time signature information for the start of a measure.
Return the time in seconds of the measure start.
Parameters:
- measure number
Returns:
- number qn_start
- number qn_end
- number num
- number time_sig_denom
- number tempo
- Project:get_metronome_pattern (time, pattern)
-
Get Metronome Pattern. Wraps TimeMap_GetMetronomePattern.
Fills in a string representing the active metronome pattern. For example, in a
7/8 measure divided 3+4, the pattern might be "1221222". The length of the
string is the time signature numerator, and the function returns the time
signature denominator.
Parameters:
- time number
- pattern string
Returns:
-
string pattern
- Project:get_time_sig_at_time (time)
-
Get Time Sig At Time. Wraps TimeMap_GetTimeSigAtTime.
get the effective time signature and tempo
Parameters:
- time number
Returns:
- number num
- number time_sig_denom
- number tempo
- Project:qn_to_measures (qn)
-
Qn To Measures. Wraps TimeMap_QNToMeasures.
Find which measure the given QN position falls in.
Parameters:
- qn number
Returns:
- number qn_measure_start
- number qn_measure_end
- Project:qn_to_time_abs (qn)
-
Qn To Time Abs. Wraps TimeMap_QNToTime_abs.
Converts project quarter note count (QN) to time. QN is counted from the start
of the project, regardless of any partial measures.
Parameters:
- qn number
Returns:
-
number
See also:
- Project:time_to_qn_abs (tpos)
-
Time To Qn Abs. Wraps TimeMap_timeToQN_abs.
Converts project time position to quarter note count (QN). QN is counted from
the start of the project, regardless of any partial measures.
Parameters:
- tpos number
Returns:
-
number
See also:
- Project:undo_begin_block2 ()
- Undo Begin Block2. Wraps Undo_BeginBlock2. call to start a new block
- Project:undo_can_redo2 ()
-
Undo Can Redo2. Wraps Undo_CanRedo2.
returns string of next action,if able, NULL if not
Returns:
-
string
- Project:undo_can_undo2 ()
-
Undo Can Undo2. Wraps Undo_CanUndo2.
returns string of last action,if able,NULL if not
Returns:
-
string
- Project:undo_do_redo2 ()
-
Undo Do Redo2. Wraps Undo_DoRedo2.
nonzero if success
Returns:
-
number
- Project:undo_do_undo2 ()
-
Undo Do Undo2. Wraps Undo_DoUndo2.
nonzero if success
Returns:
-
number
- Project:undo_end_block2 (desc_change, extraflags)
-
Undo End Block2. Wraps Undo_EndBlock2.
call to end the block,with extra flags if any,and a description
Parameters:
- desc_change string
- extraflags number
- Project:undo_on_state_change2 (desc_change)
-
Undo On State Change2. Wraps Undo_OnStateChange2.
limited state change to items
Parameters:
- desc_change string
- Project:undo_on_state_change_item (name, item)
-
Undo On State Change Item. Wraps Undo_OnStateChange_Item.
Parameters:
- name string
- item table Item object
- Project:undo_on_state_change_ex2 (desc_change, which_state, track_param)
-
Undo On State Change Ex2. Wraps Undo_OnStateChangeEx2.
track_param=-1 by default,or if updating one fx chain,you can specify track index
Parameters:
- desc_change string
- which_state number
- track_param number
- Project:update_item_lanes ()
-
Update Item Lanes. Wraps UpdateItemLanes.
Recalculate lane arrangement for fixed lane tracks, including auto-removing
empty lanes at the bottom of the track
Returns:
-
boolean
- Project:validate_ptr (identifier, ctype_name)
-
Validate Pointer. Wraps ValidatePtr2.
Return true if the pointer is a valid object of the right type in proj (proj is
ignored if pointer is itself a project). Supported types are: ReaProject*,
MediaTrack*, MediaItem*, MediaItem_Take*, TrackEnvelope* and PCM_source*.
Parameters:
- identifier userdata
- ctype_name string
Returns:
-
boolean
- Project:get_media_item_by_guid (guid_string_in)
-
Get Media Item By Guid. Wraps BR_GetMediaItemByGUID.
[BR] Get media item from GUID string. Note that the GUID must be enclosed in
braces {}. To get item's GUID as a string, see BR_GetMediaItemGUID.
Parameters:
- guid_string_in string
Returns:
-
table Item object
- Project:get_media_track_by_guid (guid_string_in)
-
Get Media Track By Guid. Wraps BR_GetMediaTrackByGUID.
[BR] Get media track from GUID string. Note that the GUID must be enclosed in
braces {}. To get track's GUID as a string, see GetSetMediaTrackInfo_String.
Parameters:
- guid_string_in string
Returns:
-
table Track object
- Project:get_sws_extra_project_notes ()
-
Get Sws Extra Project Notes. Wraps JB_GetSWSExtraProjectNotes.
Returns:
-
string
- Project:set_sws_extra_project_notes (str)
-
Set Sws Extra Project Notes. Wraps JB_SetSWSExtraProjectNotes.
Parameters:
- str string
- Project:get_double_config_var_ex (var_name, err_value)
-
Get Double Config Var Ex. Wraps SNM_GetDoubleConfigVarEx.
Parameters:
- var_name string
- err_value number
Returns:
-
number
- Project:get_int_config_var_ex (var_name, err_value)
-
Get Int Config Var Ex. Wraps SNM_GetIntConfigVarEx.
Parameters:
- var_name string
- err_value number
Returns:
-
number
- Project:get_long_config_var_ex (var_name)
-
Get Long Config Var Ex. Wraps SNM_GetLongConfigVarEx.
Parameters:
- var_name string
Returns:
- number high
- number low
- Project:get_project_marker_name (num, is_rgn, name)
-
Get Project Marker Name. Wraps SNM_GetProjectMarkerName.
Gets a marker/region name. Returns true if marker/region found.
Parameters:
- num number
- is_rgn boolean
- name userdata WDL_FastString
Returns:
-
boolean
- Project:set_double_config_var_ex (var_name, new_value)
-
Set Double Config Var Ex. Wraps SNM_SetDoubleConfigVarEx.
Parameters:
- var_name string
- new_value number
Returns:
-
boolean
- Project:set_int_config_var_ex (var_name, new_value)
-
Set Int Config Var Ex. Wraps SNM_SetIntConfigVarEx.
Parameters:
- var_name string
- new_value number
Returns:
-
boolean
- Project:set_long_config_var_ex (var_name, new_high_value, new_low_value)
-
Set Long Config Var Ex. Wraps SNM_SetLongConfigVarEx.
Parameters:
- var_name string
- new_high_value number
- new_low_value number
Returns:
-
boolean
Constants
- Project.NudgeConstants.FLAG
-
Flags for nudge operations.
Fields:
- SET_TO_VALUE number The "Set to value" flag.
- SNAP number The "Snap" flag.
- Project.NudgeConstants.WHAT
-
Targets for nudge operations.
Fields:
- POSITION number The position target.
- LEFT_TRIM number The left trim target.
- LEFT_EDGE number The left edge target.
- RIGHT_EDGE number The right edge target.
- CONTENTS number The contents target.
- DUPLICATE number The duplicate target.
- EDIT_CURSOR number The edit cursor target.
- Project.NudgeConstants.UNIT
-
Units for nudge operations.
Fields:
- MS number Milliseconds unit.
- SECONDS number Seconds unit.
- GRID number Grid unit.
- _256TH_NOTES number 256th notes unit.
- _1 number Whole note unit.
- MEASURES_BEATS number Measures and beats unit.
- SAMPLES number Samples unit.
- FRAMES number Frames unit.
- PIXELS number Pixels unit.
- ITEM_LENGTHS number Item lengths unit.
- ITEM_SELECTIONS number Item selections unit.
- Project.GetSetProjectInfoConstants
-
Constants for Project:get_set_project_info.
Fields:
- RENDER_SETTINGS &(1|2)=0: master mix, &1=stems+master mix, &2=stems only, &4=multichannel tracks to multichannel files, &8=use render matrix, &16=tracks with only mono media to mono files, &32=selected media items, &64=selected media items via master, &128=selected tracks via master, &256=embed transients if format supports, &512=embed metadata if format supports, &1024=embed take markers if format supports, &2048=2nd pass render
- RENDER_BOUNDSFLAG any: 0=custom time bounds, 1=entire project, 2=time selection, 3=all project regions, 4=selected media items, 5=selected project regions, 6=all project markers, 7=selected project markers
- RENDER_CHANNELS number: number of channels in rendered file
- RENDER_SRATE any: sample rate of rendered file (or 0 for project sample rate)
- RENDER_STARTPOS any: render start time when RENDER_BOUNDSFLAG=0
- RENDER_ENDPOS any: render end time when RENDER_BOUNDSFLAG=0
- RENDER_TAILFLAG apply render tail setting when rendering: &1=custom time bounds, &2=entire project, &4=time selection, &8=all project markers/regions, &16=selected media items, &32=selected project markers/regions
- RENDER_TAILMS any: tail length in ms to render (only used if RENDER_BOUNDSFLAG and RENDER_TAILFLAG are set)
- RENDER_ADDTOPROJ any: &1=add rendered files to project, &2=do not render files that are likely silent
- RENDER_DITHER any: &1=dither, &2=noise shaping, &4=dither stems, &8=noise shaping on stems
- RENDER_NORMALIZE any: &1=enable, (&14==0)=LUFS-I, (&14==2)=RMS, (&14==4)=peak, (&14==6)=true peak, (&14==8)=LUFS-M max, (&14==10)=LUFS-S max, (&4128==32)=normalize stems to common gain based on master, &64=enable brickwall limit, &128=brickwall limit true peak, (&2304==256)=only normalize files that are too loud, (&2304==2048)=only normalize files that are too quiet, &512=apply fade-in, &1024=apply fade-out, (&4128==4096)=normalize to loudest file, (&4128==4128)=normalize as if one long file, &8192=adjust mono media additional -3dB
- RENDER_NORMALIZE_TARGET any: render normalization target as amplitude, so 0.5 means -6.02dB, 0.25 means -12.04dB, etc
- RENDER_BRICKWALL any: render brickwall limit as amplitude, so 0.5 means -6.02dB, 0.25 means -12.04dB, etc
- RENDER_FADEIN any: render fade-in (0.001 means 1 ms, requires RENDER_NORMALIZE&512)
- RENDER_FADEOUT any: render fade-out (0.001 means 1 ms, requires RENDER_NORMALIZE&1024)
- RENDER_FADEINSHAPE any: render fade-in shape
- RENDER_FADEOUTSHAPE any: render fade-out shape
- PROJECT_SRATE any: sample rate (ignored unless PROJECT_SRATE_USE set)
- PROJECT_SRATE_USE any: set to 1 if project sample rate is used
- Project.GetSetProjectInfoStringConstants
-
Constants for Project:get_set_project_info_string.
Fields:
- PROJECT_NAME any: project file name (read-only, is_set will be ignored)
- PROJECT_TITLE any: title field from Project Settings/Notes dialog
- PROJECT_AUTHOR any: author field from Project Settings/Notes dialog
- TRACK_GROUP_NAME X: track group name, X should be 1..64
- MARKER_GUID X: get the GUID (unique ID) of the marker or region with index X, where X is the index passed to EnumProjectMarkers, not necessarily the displayed number (read-only)
- MARKER_INDEX_FROM_GUID {GUID}: get the GUID index of the marker or region with GUID {GUID} (read-only)
- OPENCOPY_CFGIDX any: integer for the configuration of format to use when creating copies/applying FX. 0=wave (auto-depth), 1=APPLYFX_FORMAT, 2=RECORD_FORMAT
- RECORD_PATH any: recording directory -- may be blank or a relative path, to get the effective path see
- RECORD_PATH_SECONDARY any: secondary recording directory
- RECORD_FORMAT string: base64-encoded sink configuration (see project files, etc). Callers can also pass a simple 4-byte string (non-base64-encoded), e.g. "evaw" or "l3pm", to use default settings for that sink type.
- APPLYFX_FORMAT string: base64-encoded sink configuration (see project files, etc). Used only if RECFMT_OPENCOPY is set to 1. Callers can also pass a simple 4-byte string (non-base64-encoded), e.g. "evaw" or "l3pm", to use default settings for that sink type.
- RENDER_FILE any: render directory
- RENDER_PATTERN any: render file name (may contain wildcards)
- RENDER_METADATA get or set the metadata saved with the project (not metadata embedded in project media). Example, ID3 album name metadata: get or set the metadata saved with the project (not metadata embedded in project media). Example, ID3 album name metadatavaluestr="ID3TALB" to get, valuestr="ID3TALB|my album name" to set. Call with valuestr="" and is_set=false to get a semicolon-separated list of defined project metadata identifiers.
- RENDER_TARGETS any: semicolon separated list of files that would be written if the project is rendered using the most recent render settings
- RENDER_STATS any: (read-only) semicolon separated list of statistics for the most recently rendered files. call with valuestr="XXX" to run an action (for example, "42437"=dry run render selected items) before returning statistics.
- RENDER_FORMAT string: base64-encoded sink configuration (see project files, etc). Callers can also pass a simple 4-byte string (non-base64-encoded), e.g. "evaw" or "l3pm", to use default settings for that sink type.