ReaScript API — Documentation

REAPER v5.96 / SWS v2.9.8.0 / Reapack v1.2.2 / js_ReaScript 0.93
Last update: 14/10/2018 02:33:43

This is a custom version made by X-Raym, for demonstration purpose. Be careful: it may not be up-to-date.
More infos about it on Cockos forum: Documentation: Reascripthelp with Styles and Filtering Tables.

Based on Bootstrap Simple Sidebar template by Start Bootstrap.
Lists filtered with List-js.

Changelog

  1. 2018-06-22
    • Now generated directly from the original reascript.html! No more manual addition of functions!
    • See REAPER and extension changelog for new functions.
  2. 2018-04-16
    • Extra parameters for drawstr()
  3. 2018-03-05
    • v5.76 / SWS v2.9.8.0 / Reapack v1.2.1
    • # API: add GetSetTrackGroupMembershipHigh, GetUnderrunTime, CF_GetClipboardBig, CF_LocateInExplorer, CF_ShellExecute, NF_GetMediaItemPeakRMS_NonWindowed, NF_GetMediaItemPeakRMS_Windowed, NF_GetSWSTrackNotes, NF_SetSWSTrackNotes, NF_TakeFX_GetOffline, NF_TakeFX_SetOffline, NF_TrackFX_GetOffline, NF_TrackFX_SetOffline, ReaPack_AboutInstalledPackage, ReaPack_AboutRepository, ReaPack_AddSetRepository, ReaPack_BrowsePackages, ReaPack_CompareVersions, ReaPack_EnumOwnedFiles, ReaPack_FreeEntry, ReaPack_GetEntryInfo, ReaPack_GetOwner, ReaPack_GetRepositoryInfo, ReaPack_ProcessQueue
  4. 2017-09-11
    • v5.50rc21 / SWS v2.9.6.0
    • # API: add BR_IsMidiOpenInInlineEditor, SN_FocusMIDIEditor, CF_GetClipboard, CF_SetClipboard, NF_AnalyzeTakeLoudness, NF_AnalyzeTakeLoudness2, NF_AnalyzeTakeLoudness_IntegratedOnly, NF_GetMediaItemAverageRMS, NF_GetMediaItemMaxPeak, SN_FocusMIDIEditor
    • Add doc to RecursiveCreateDirectory
  5. 2017-03-14
    • v5.40pre12
    • # API: add TakeFX_GetNamedConfigParm, TakeFX_SetNamedConfigParm, TrackFX_GetNamedConfigParm, TrackFX_SetNamedConfigParm
  6. 2017-03-07
    • v5.40pre10
    • # API: add InsertAutomationItem, GetSetAutomationItemInfo, CountEnvelopePointsEx, GetEnvelopePointEx, GetEnvelopePointByTimeEx, SetEnvelopePointEx, InsertEnvelopePointEx, DeleteEnvelopePointRangeEx, Envelope_SortPointsEx
    • GetSetProjectGrid (Not in the changelog !!)
  7. 2017-02-23
    • v5.34
    • See REAPER changelog
  8. 2017-01-03
    • v5.32 pre 4
    • New functions: GetMediaItemTake_Peaks, GetProjectLength, GetProjectName, GetSetProjectAuthor, GetTrackMIDILyrics, GetTrackName, joystick_create, joystick_destroy, joystick_enum, joystick_getaxis, joystick_getbuttonmask, joystick_getinfo, joystick_getpov, joystick_update, MIDI_GetAllEvts, MIDI_SetAllEvts, PCM_Source_GetPeaks, SetTrackMIDILyrics, lua_{reaper.array}.fft_real, lua_{reaper.array}.ifft_real
    • Deleted function: HiresPeaksFromSource
  9. 2016-11-23
    • v5.29
    • CSS Optimization
  10. 2016-10-15
    • Highlight matching terms from filter functions list.
  11. 2016-09-04
    • v5.24
    • REAPER version compatibility of new functions in functions lists.
  12. 2016-06-05
    • SWS functions added in lists (!!)
    • Fuzzy search
  13. 2016-31-05
    • More complete function Filter
    • Python filter
    • Filter setting simple coockie system

Introduction

REAPER provides an API (advanced programming interface) for users and third parties to create extended functionality. API functions can be called from a compiled C/C++ dynamic library that is loaded by REAPER, or at run-time by user-created ReaScripts that can be written using REAPER's own editor.

ReaScripts can be written in EEL, a specialized language that is also used to write JSFX; Lua, a popular scripting language; or Python, another scripting language. EEL and Lua are embedded within REAPER and require no additional downloads or settings. Python must be downloaded and installed separately, and enabled in REAPER preferences.

Learn more about ReaScript: http://www.cockos.com/reaper/sdk/reascript/reascript.php.

ReaScript/EEL API

ReaScript/EEL scripts can call API functions using functionname().

Parameters that return information are effectively passed by reference, not value. If an API returns a string value, it will usually be as the first parameter.

Examples:


// function returning a single (scalar) value:

sec = parse_timestr("1:12");

// function returning information in the first parameter (function returns void):

GetProjectPath(#string);

// lower volume of track 3 by half: tr = GetTrack(0, 2); GetTrackUIVolPan(tr, vol, pan); SetMediaTrackInfo_Value(tr, "D_VOL", vol*0.5);

ReaScript/EEL can import functions from other reascripts using @import filename.eel -- note that only the file's functions will be imported, normal code in that file will not be executed.

ReaScript/Lua API

ReaScript/Lua scripts can call API functions using reaper.functionname().

Some functions return multiple values. In many cases, some function parameters are ignored, especially when similarly named parameters are present in the returned values.

Examples:


-- function returning a single (scalar) value:

sec = reaper.parse_timestr("1:12")

-- function with an ignored (dummy) parameter:

path = reaper.GetProjectPath("")

-- lower volume of track 3 by half: tr = reaper.GetTrack(0, 2) ok, vol, pan = reaper.GetTrackUIVolPan(tr, 0, 0) reaper.SetMediaTrackInfo_Value(tr, "D_VOL", vol*0.5)
ReaScript/Lua can import functions from other ReaScripts using require. If the files are not being found, it is probably a path problem (remember that lua paths are wildcard patterns, not just directory listings, see details here).

ReaScript/Python API

ReaScript/Python requires a recent version of Python installed on this machine. Python is available from multiple sources as a free download. After installing Python, REAPER may detect the Python dynamic library automatically. If not, you can enter the path in the ReaScript preferences page, at Options/Preferences/Plug-Ins/ReaScript.

ReaScript/Python scripts can call API functions using RPR_functionname().

All parameters are passed by value, not reference. API functions that cannot return information in the parameter list will return a single value. API functions that can return any information in the parameter list will return a list of values; The first value in the list will be the function return value (unless the function is declared to return void).

Examples:


# function returning a single (scalar) value:

sec = RPR_parse_timestr("1:12")

# function returning information in the first parameter (function returns void):

(str) = RPR_GetProjectPath("", 512)

# lower volume of track 3 by half (RPR_GetTrackUIVolPan returns Bool): tr = RPR_GetTrack(0, 2) (ok, tr, vol, pan) = RPR_GetTrackUIVolPan(tr, 0, 0) # this also works, if you only care about one of the returned values: vol = RPR_GetTrackUIVolPan(tr, 0, 0)[2] RPR_SetMediaTrackInfo_Value(tr, "D_VOL", vol*0.5)
You can create and save modules of useful functions that you can import into other ReaScripts. For example, if you create a file called reascript_utility.py that contains the function helpful_function(), you can import that file into any Python ReaScript with the line:

import reascript_utility
and call the function by using:

reascript_utility.helpful_function()
Note that ReaScripts must explicitly import the REAPER python module, even if the script is imported into another ReaScript:

from reaper_python import *

Functions Definitions

MediaItem* AddMediaItemToTrack(MediaTrack* tr)
MediaItem AddMediaItemToTrack(MediaTrack tr)
MediaItem reaper.AddMediaItemToTrack(MediaTrack tr)
MediaItem RPR_AddMediaItemToTrack(MediaTrack tr)

creates a new media item.

int AddProjectMarker(ReaProject* proj, bool isrgn, double pos, double rgnend, const char* name, int wantidx)
int AddProjectMarker(ReaProject proj, bool isrgn, pos, rgnend, "name", int wantidx)
integer reaper.AddProjectMarker(ReaProject proj, boolean isrgn, number pos, number rgnend, string name, integer wantidx)
Int RPR_AddProjectMarker(ReaProject proj, Boolean isrgn, Float pos, Float rgnend, String name, Int wantidx)

Returns the index of the created marker/region, or -1 on failure. Supply wantidx>=0 if you want a particular index number, but you'll get a different index number a region and wantidx is already in use.

int AddProjectMarker2(ReaProject* proj, bool isrgn, double pos, double rgnend, const char* name, int wantidx, int color)
int AddProjectMarker2(ReaProject proj, bool isrgn, pos, rgnend, "name", int wantidx, int color)
integer reaper.AddProjectMarker2(ReaProject proj, boolean isrgn, number pos, number rgnend, string name, integer wantidx, integer color)
Int RPR_AddProjectMarker2(ReaProject proj, Boolean isrgn, Float pos, Float rgnend, String name, Int wantidx, Int color)

Returns the index of the created marker/region, or -1 on failure. Supply wantidx>=0 if you want a particular index number, but you'll get a different index number a region and wantidx is already in use. color should be 0 (default color), or ColorToNative(r,g,b)|0x1000000

int AddRemoveReaScript(bool add, int sectionID, const char* scriptfn, bool commit)
int AddRemoveReaScript(bool add, int sectionID, "scriptfn", bool commit)
integer reaper.AddRemoveReaScript(boolean add, integer sectionID, string scriptfn, boolean commit)
Int RPR_AddRemoveReaScript(Boolean add, Int sectionID, String scriptfn, Boolean commit)

Add a ReaScript (return the new command ID, or 0 if failed) or remove a ReaScript (return >0 on success). Use commit==true when adding/removing a single script. When bulk adding/removing n scripts, you can optimize the n-1 first calls with commit==false and commit==true for the last call.

MediaItem_Take* AddTakeToMediaItem(MediaItem* item)
MediaItem_Take AddTakeToMediaItem(MediaItem item)
MediaItem_Take reaper.AddTakeToMediaItem(MediaItem item)
MediaItem_Take RPR_AddTakeToMediaItem(MediaItem item)

creates a new take in an item

bool AddTempoTimeSigMarker(ReaProject* proj, double timepos, double bpm, int timesig_num, int timesig_denom, bool lineartempochange)
bool AddTempoTimeSigMarker(ReaProject proj, timepos, bpm, int timesig_num, int timesig_denom, bool lineartempochange)
boolean reaper.AddTempoTimeSigMarker(ReaProject proj, number timepos, number bpm, integer timesig_num, integer timesig_denom, boolean lineartempochange)
Boolean RPR_AddTempoTimeSigMarker(ReaProject proj, Float timepos, Float bpm, Int timesig_num, Int timesig_denom, Boolean lineartempochange)

Deprecated. Use SetTempoTimeSigMarker with ptidx=-1.

void adjustZoom(double amt, int forceset, bool doupd, int centermode)
adjustZoom(amt, int forceset, bool doupd, int centermode)
reaper.adjustZoom(number amt, integer forceset, boolean doupd, integer centermode)
RPR_adjustZoom(Float amt, Int forceset, Boolean doupd, Int centermode)

forceset=0,doupd=true,centermode=-1 for default

bool AnyTrackSolo(ReaProject* proj)
bool AnyTrackSolo(ReaProject proj)
boolean reaper.AnyTrackSolo(ReaProject proj)
Boolean RPR_AnyTrackSolo(ReaProject proj)
bool APIExists(const char* function_name)
bool APIExists("function_name")
boolean reaper.APIExists(string function_name)
Boolean RPR_APIExists(String function_name)

Returns true if function_name exists in the REAPER API

void APITest()
APITest()
reaper.APITest()
RPR_APITest()

Displays a message window if the API was successfully called.

bool ApplyNudge(ReaProject* project, int nudgeflag, int nudgewhat, int nudgeunits, double value, bool reverse, int copies)
bool ApplyNudge(ReaProject project, int nudgeflag, int nudgewhat, int nudgeunits, value, bool reverse, int copies)
boolean reaper.ApplyNudge(ReaProject project, integer nudgeflag, integer nudgewhat, integer nudgeunits, number value, boolean reverse, integer copies)
Boolean RPR_ApplyNudge(ReaProject project, Int nudgeflag, Int nudgewhat, Int nudgeunits, Float value, Boolean reverse, Int copies)
nudgeflag: &1=set to value (otherwise nudge by value), &2=snap
nudgewhat: 0=position, 1=left trim, 2=left edge, 3=right edge, 4=contents, 5=duplicate, 6=edit cursor
nudgeunit: 0=ms, 1=seconds, 2=grid, 3=256th notes, ..., 15=whole notes, 16=measures.beats (1.15 = 1 measure + 1.5 beats), 17=samples, 18=frames, 19=pixels, 20=item lengths, 21=item selections
value: amount to nudge by, or value to set to
reverse: in nudge mode, nudges left (otherwise ignored)

copies: in nudge duplicate mode, number of copies (otherwise ignored)

void ArmCommand(int cmd, const char* sectionname)
ArmCommand(int cmd, "sectionname")
reaper.ArmCommand(integer cmd, string sectionname)
RPR_ArmCommand(Int cmd, String sectionname)

arms a command (or disarms if 0 passed) in section sectionname (empty string for main)

void Audio_Init()
Audio_Init()
reaper.Audio_Init()
RPR_Audio_Init()

open all audio and MIDI devices, if not open

int Audio_IsPreBuffer()
int Audio_IsPreBuffer()
integer reaper.Audio_IsPreBuffer()
Int RPR_Audio_IsPreBuffer()

is in pre-buffer? threadsafe

int Audio_IsRunning()
int Audio_IsRunning()
integer reaper.Audio_IsRunning()
Int RPR_Audio_IsRunning()

is audio running at all? threadsafe

void Audio_Quit()
Audio_Quit()
reaper.Audio_Quit()
RPR_Audio_Quit()

close all audio and MIDI devices, if open

bool AudioAccessorValidateState(AudioAccessor* accessor)
bool AudioAccessorValidateState(AudioAccessor accessor)
boolean reaper.AudioAccessorValidateState(AudioAccessor accessor)
Boolean RPR_AudioAccessorValidateState(AudioAccessor accessor)

Validates the current state of the audio accessor -- must ONLY call this from the main thread. Returns true if the state changed.

void BypassFxAllTracks(int bypass)
BypassFxAllTracks(int bypass)
reaper.BypassFxAllTracks(integer bypass)
RPR_BypassFxAllTracks(Int bypass)

-1 = bypass all if not all bypassed,otherwise unbypass all

void ClearAllRecArmed()
ClearAllRecArmed()
reaper.ClearAllRecArmed()
RPR_ClearAllRecArmed()
void ClearConsole()
ClearConsole()
reaper.ClearConsole()
RPR_ClearConsole()

Clear the ReaScript console. See ShowConsoleMsg

void ClearPeakCache()
ClearPeakCache()
reaper.ClearPeakCache()
RPR_ClearPeakCache()

resets the global peak caches

void ColorFromNative(int col, int* rOut, int* gOut, int* bOut)
ColorFromNative(int col, int &r, int &g, int &b)
number r, number g, number b = reaper.ColorFromNative(integer col)
(Int col, Int rOut, Int gOut, Int bOut) = RPR_ColorFromNative(col, rOut, gOut, bOut)

Extract RGB values from an OS dependent color. See ColorToNative.

int ColorToNative(int r, int g, int b)
int ColorToNative(int r, int g, int b)
integer reaper.ColorToNative(integer r, integer g, integer b)
Int RPR_ColorToNative(Int r, Int g, Int b)

Make an OS dependent color from RGB values (e.g. RGB() macro on Windows). r,g and b are in [0..255]. See ColorFromNative.

int CountAutomationItems(TrackEnvelope* env)
int CountAutomationItems(TrackEnvelope env)
integer reaper.CountAutomationItems(TrackEnvelope env)
Int RPR_CountAutomationItems(TrackEnvelope env)

Returns the number of automation items on this envelope. See GetSetAutomationItemInfo

int CountEnvelopePoints(TrackEnvelope* envelope)
int CountEnvelopePoints(TrackEnvelope envelope)
integer reaper.CountEnvelopePoints(TrackEnvelope envelope)
Int RPR_CountEnvelopePoints(TrackEnvelope envelope)

Returns the number of points in the envelope.

int CountEnvelopePointsEx(TrackEnvelope* envelope, int autoitem_idx)
int CountEnvelopePointsEx(TrackEnvelope envelope, int autoitem_idx)
integer reaper.CountEnvelopePointsEx(TrackEnvelope envelope, integer autoitem_idx)
Int RPR_CountEnvelopePointsEx(TrackEnvelope envelope, Int autoitem_idx)

Returns the number of points in the envelope. autoitem_idx==-1 for the underlying envelope, 0 for the first automation item on the envelope, etc.

int CountMediaItems(ReaProject* proj)
int CountMediaItems(ReaProject proj)
integer reaper.CountMediaItems(ReaProject proj)
Int RPR_CountMediaItems(ReaProject proj)

count the number of items in the project (proj=0 for active project)

int CountProjectMarkers(ReaProject* proj, int* num_markersOut, int* num_regionsOut)
int CountProjectMarkers(ReaProject proj, int &num_markers, int &num_regions)
integer retval, number num_markers, number num_regions = reaper.CountProjectMarkers(ReaProject proj)
(Int retval, ReaProject proj, Int num_markersOut, Int num_regionsOut) = RPR_CountProjectMarkers(proj, num_markersOut, num_regionsOut)

num_markersOut and num_regionsOut may be NULL.

int CountSelectedMediaItems(ReaProject* proj)
int CountSelectedMediaItems(ReaProject proj)
integer reaper.CountSelectedMediaItems(ReaProject proj)
Int RPR_CountSelectedMediaItems(ReaProject proj)

count the number of selected items in the project (proj=0 for active project)

int CountSelectedTracks(ReaProject* proj)
int CountSelectedTracks(ReaProject proj)
integer reaper.CountSelectedTracks(ReaProject proj)
Int RPR_CountSelectedTracks(ReaProject proj)

Count the number of selected tracks in the project (proj=0 for active project). This function ignores the master track, see CountSelectedTracks2.

int CountSelectedTracks2(ReaProject* proj, bool wantmaster)
int CountSelectedTracks2(ReaProject proj, bool wantmaster)
integer reaper.CountSelectedTracks2(ReaProject proj, boolean wantmaster)
Int RPR_CountSelectedTracks2(ReaProject proj, Boolean wantmaster)

Count the number of selected tracks in the project (proj=0 for active project).

int CountTakeEnvelopes(MediaItem_Take* take)
int CountTakeEnvelopes(MediaItem_Take take)
integer reaper.CountTakeEnvelopes(MediaItem_Take take)
Int RPR_CountTakeEnvelopes(MediaItem_Take take)

See GetTakeEnvelope

int CountTakes(MediaItem* item)
int CountTakes(MediaItem item)
integer reaper.CountTakes(MediaItem item)
Int RPR_CountTakes(MediaItem item)

count the number of takes in the item

int CountTCPFXParms(ReaProject* project, MediaTrack* track)
int CountTCPFXParms(ReaProject project, MediaTrack track)
integer reaper.CountTCPFXParms(ReaProject project, MediaTrack track)
Int RPR_CountTCPFXParms(ReaProject project, MediaTrack track)

Count the number of FX parameter knobs displayed on the track control panel.

int CountTempoTimeSigMarkers(ReaProject* proj)
int CountTempoTimeSigMarkers(ReaProject proj)
integer reaper.CountTempoTimeSigMarkers(ReaProject proj)
Int RPR_CountTempoTimeSigMarkers(ReaProject proj)

Count the number of tempo/time signature markers in the project. See GetTempoTimeSigMarker, SetTempoTimeSigMarker, AddTempoTimeSigMarker.

int CountTrackEnvelopes(MediaTrack* track)
int CountTrackEnvelopes(MediaTrack track)
integer reaper.CountTrackEnvelopes(MediaTrack track)
Int RPR_CountTrackEnvelopes(MediaTrack track)

see GetTrackEnvelope

int CountTrackMediaItems(MediaTrack* track)
int CountTrackMediaItems(MediaTrack track)
integer reaper.CountTrackMediaItems(MediaTrack track)
Int RPR_CountTrackMediaItems(MediaTrack track)

count the number of items in the track

int CountTracks(ReaProject* proj)
int CountTracks(ReaProject proj)
integer reaper.CountTracks(ReaProject proj)
Int RPR_CountTracks(ReaProject proj)

count the number of tracks in the project (proj=0 for active project)

MediaItem* CreateNewMIDIItemInProj(MediaTrack* track, double starttime, double endtime, const bool* qnInOptional)
MediaItem CreateNewMIDIItemInProj(MediaTrack track, starttime, endtime, optional bool qnIn)
MediaItem reaper.CreateNewMIDIItemInProj(MediaTrack track, number starttime, number endtime, optional boolean qnIn)
MediaItem RPR_CreateNewMIDIItemInProj(MediaTrack track, Float starttime, Float endtime, const bool qnInOptional)

Create a new MIDI media item, containing no MIDI events. Time is in seconds unless qn is set.

AudioAccessor* CreateTakeAudioAccessor(MediaItem_Take* take)
AudioAccessor CreateTakeAudioAccessor(MediaItem_Take take)
AudioAccessor reaper.CreateTakeAudioAccessor(MediaItem_Take take)
AudioAccessor RPR_CreateTakeAudioAccessor(MediaItem_Take take)

Create an audio accessor object for this take. Must only call from the main thread. See CreateTrackAudioAccessor, DestroyAudioAccessor, GetAudioAccessorHash, GetAudioAccessorStartTime, GetAudioAccessorEndTime, GetAudioAccessorSamples.

AudioAccessor* CreateTrackAudioAccessor(MediaTrack* track)
AudioAccessor CreateTrackAudioAccessor(MediaTrack track)
AudioAccessor reaper.CreateTrackAudioAccessor(MediaTrack track)
AudioAccessor RPR_CreateTrackAudioAccessor(MediaTrack track)

Create an audio accessor object for this track. Must only call from the main thread. See CreateTakeAudioAccessor, DestroyAudioAccessor, GetAudioAccessorHash, GetAudioAccessorStartTime, GetAudioAccessorEndTime, GetAudioAccessorSamples.

int CreateTrackSend(MediaTrack* tr, MediaTrack* desttrInOptional)
int CreateTrackSend(MediaTrack tr, MediaTrack desttrIn)
integer reaper.CreateTrackSend(MediaTrack tr, MediaTrack desttrIn)
Int RPR_CreateTrackSend(MediaTrack tr, MediaTrack desttrInOptional)

Create a send/receive (desttrInOptional!=NULL), or a hardware output (desttrInOptional==NULL) with default properties, return >=0 on success (== new send/receive index). See RemoveTrackSend, GetSetTrackSendInfo, GetTrackSendInfo_Value, SetTrackSendInfo_Value.

void CSurf_FlushUndo(bool force)
CSurf_FlushUndo(bool force)
reaper.CSurf_FlushUndo(boolean force)
RPR_CSurf_FlushUndo(Boolean force)

call this to force flushing of the undo states after using CSurf_On*Change()

bool CSurf_GetTouchState(MediaTrack* trackid, int isPan)
bool CSurf_GetTouchState(MediaTrack trackid, int isPan)
boolean reaper.CSurf_GetTouchState(MediaTrack trackid, integer isPan)
Boolean RPR_CSurf_GetTouchState(MediaTrack trackid, Int isPan)
void CSurf_GoEnd()
CSurf_GoEnd()
reaper.CSurf_GoEnd()
RPR_CSurf_GoEnd()
void CSurf_GoStart()
CSurf_GoStart()
reaper.CSurf_GoStart()
RPR_CSurf_GoStart()
int CSurf_NumTracks(bool mcpView)
int CSurf_NumTracks(bool mcpView)
integer reaper.CSurf_NumTracks(boolean mcpView)
Int RPR_CSurf_NumTracks(Boolean mcpView)
void CSurf_OnArrow(int whichdir, bool wantzoom)
CSurf_OnArrow(int whichdir, bool wantzoom)
reaper.CSurf_OnArrow(integer whichdir, boolean wantzoom)
RPR_CSurf_OnArrow(Int whichdir, Boolean wantzoom)
void CSurf_OnFwd(int seekplay)
CSurf_OnFwd(int seekplay)
reaper.CSurf_OnFwd(integer seekplay)
RPR_CSurf_OnFwd(Int seekplay)
bool CSurf_OnFXChange(MediaTrack* trackid, int en)
bool CSurf_OnFXChange(MediaTrack trackid, int en)
boolean reaper.CSurf_OnFXChange(MediaTrack trackid, integer en)
Boolean RPR_CSurf_OnFXChange(MediaTrack trackid, Int en)
int CSurf_OnInputMonitorChange(MediaTrack* trackid, int monitor)
int CSurf_OnInputMonitorChange(MediaTrack trackid, int monitor)
integer reaper.CSurf_OnInputMonitorChange(MediaTrack trackid, integer monitor)
Int RPR_CSurf_OnInputMonitorChange(MediaTrack trackid, Int monitor)
int CSurf_OnInputMonitorChangeEx(MediaTrack* trackid, int monitor, bool allowgang)
int CSurf_OnInputMonitorChangeEx(MediaTrack trackid, int monitor, bool allowgang)
integer reaper.CSurf_OnInputMonitorChangeEx(MediaTrack trackid, integer monitor, boolean allowgang)
Int RPR_CSurf_OnInputMonitorChangeEx(MediaTrack trackid, Int monitor, Boolean allowgang)
bool CSurf_OnMuteChange(MediaTrack* trackid, int mute)
bool CSurf_OnMuteChange(MediaTrack trackid, int mute)
boolean reaper.CSurf_OnMuteChange(MediaTrack trackid, integer mute)
Boolean RPR_CSurf_OnMuteChange(MediaTrack trackid, Int mute)
bool CSurf_OnMuteChangeEx(MediaTrack* trackid, int mute, bool allowgang)
bool CSurf_OnMuteChangeEx(MediaTrack trackid, int mute, bool allowgang)
boolean reaper.CSurf_OnMuteChangeEx(MediaTrack trackid, integer mute, boolean allowgang)
Boolean RPR_CSurf_OnMuteChangeEx(MediaTrack trackid, Int mute, Boolean allowgang)
double CSurf_OnPanChange(MediaTrack* trackid, double pan, bool relative)
double CSurf_OnPanChange(MediaTrack trackid, pan, bool relative)
number reaper.CSurf_OnPanChange(MediaTrack trackid, number pan, boolean relative)
Float RPR_CSurf_OnPanChange(MediaTrack trackid, Float pan, Boolean relative)
double CSurf_OnPanChangeEx(MediaTrack* trackid, double pan, bool relative, bool allowGang)
double CSurf_OnPanChangeEx(MediaTrack trackid, pan, bool relative, bool allowGang)
number reaper.CSurf_OnPanChangeEx(MediaTrack trackid, number pan, boolean relative, boolean allowGang)
Float RPR_CSurf_OnPanChangeEx(MediaTrack trackid, Float pan, Boolean relative, Boolean allowGang)
void CSurf_OnPause()
CSurf_OnPause()
reaper.CSurf_OnPause()
RPR_CSurf_OnPause()
void CSurf_OnPlay()
CSurf_OnPlay()
reaper.CSurf_OnPlay()
RPR_CSurf_OnPlay()
void CSurf_OnPlayRateChange(double playrate)
CSurf_OnPlayRateChange(playrate)
reaper.CSurf_OnPlayRateChange(number playrate)
RPR_CSurf_OnPlayRateChange(Float playrate)
bool CSurf_OnRecArmChange(MediaTrack* trackid, int recarm)
bool CSurf_OnRecArmChange(MediaTrack trackid, int recarm)
boolean reaper.CSurf_OnRecArmChange(MediaTrack trackid, integer recarm)
Boolean RPR_CSurf_OnRecArmChange(MediaTrack trackid, Int recarm)
bool CSurf_OnRecArmChangeEx(MediaTrack* trackid, int recarm, bool allowgang)
bool CSurf_OnRecArmChangeEx(MediaTrack trackid, int recarm, bool allowgang)
boolean reaper.CSurf_OnRecArmChangeEx(MediaTrack trackid, integer recarm, boolean allowgang)
Boolean RPR_CSurf_OnRecArmChangeEx(MediaTrack trackid, Int recarm, Boolean allowgang)
void CSurf_OnRecord()
CSurf_OnRecord()
reaper.CSurf_OnRecord()
RPR_CSurf_OnRecord()
double CSurf_OnRecvPanChange(MediaTrack* trackid, int recv_index, double pan, bool relative)
double CSurf_OnRecvPanChange(MediaTrack trackid, int recv_index, pan, bool relative)
number reaper.CSurf_OnRecvPanChange(MediaTrack trackid, integer recv_index, number pan, boolean relative)
Float RPR_CSurf_OnRecvPanChange(MediaTrack trackid, Int recv_index, Float pan, Boolean relative)
double CSurf_OnRecvVolumeChange(MediaTrack* trackid, int recv_index, double volume, bool relative)
double CSurf_OnRecvVolumeChange(MediaTrack trackid, int recv_index, volume, bool relative)
number reaper.CSurf_OnRecvVolumeChange(MediaTrack trackid, integer recv_index, number volume, boolean relative)
Float RPR_CSurf_OnRecvVolumeChange(MediaTrack trackid, Int recv_index, Float volume, Boolean relative)
void CSurf_OnRew(int seekplay)
CSurf_OnRew(int seekplay)
reaper.CSurf_OnRew(integer seekplay)
RPR_CSurf_OnRew(Int seekplay)
void CSurf_OnRewFwd(int seekplay, int dir)
CSurf_OnRewFwd(int seekplay, int dir)
reaper.CSurf_OnRewFwd(integer seekplay, integer dir)
RPR_CSurf_OnRewFwd(Int seekplay, Int dir)
void CSurf_OnScroll(int xdir, int ydir)
CSurf_OnScroll(int xdir, int ydir)
reaper.CSurf_OnScroll(integer xdir, integer ydir)
RPR_CSurf_OnScroll(Int xdir, Int ydir)
bool CSurf_OnSelectedChange(MediaTrack* trackid, int selected)
bool CSurf_OnSelectedChange(MediaTrack trackid, int selected)
boolean reaper.CSurf_OnSelectedChange(MediaTrack trackid, integer selected)
Boolean RPR_CSurf_OnSelectedChange(MediaTrack trackid, Int selected)
double CSurf_OnSendPanChange(MediaTrack* trackid, int send_index, double pan, bool relative)
double CSurf_OnSendPanChange(MediaTrack trackid, int send_index, pan, bool relative)
number reaper.CSurf_OnSendPanChange(MediaTrack trackid, integer send_index, number pan, boolean relative)
Float RPR_CSurf_OnSendPanChange(MediaTrack trackid, Int send_index, Float pan, Boolean relative)
double CSurf_OnSendVolumeChange(MediaTrack* trackid, int send_index, double volume, bool relative)
double CSurf_OnSendVolumeChange(MediaTrack trackid, int send_index, volume, bool relative)
number reaper.CSurf_OnSendVolumeChange(MediaTrack trackid, integer send_index, number volume, boolean relative)
Float RPR_CSurf_OnSendVolumeChange(MediaTrack trackid, Int send_index, Float volume, Boolean relative)
bool CSurf_OnSoloChange(MediaTrack* trackid, int solo)
bool CSurf_OnSoloChange(MediaTrack trackid, int solo)
boolean reaper.CSurf_OnSoloChange(MediaTrack trackid, integer solo)
Boolean RPR_CSurf_OnSoloChange(MediaTrack trackid, Int solo)
bool CSurf_OnSoloChangeEx(MediaTrack* trackid, int solo, bool allowgang)
bool CSurf_OnSoloChangeEx(MediaTrack trackid, int solo, bool allowgang)
boolean reaper.CSurf_OnSoloChangeEx(MediaTrack trackid, integer solo, boolean allowgang)
Boolean RPR_CSurf_OnSoloChangeEx(MediaTrack trackid, Int solo, Boolean allowgang)
void CSurf_OnStop()
CSurf_OnStop()
reaper.CSurf_OnStop()
RPR_CSurf_OnStop()
void CSurf_OnTempoChange(double bpm)
CSurf_OnTempoChange(bpm)
reaper.CSurf_OnTempoChange(number bpm)
RPR_CSurf_OnTempoChange(Float bpm)
void CSurf_OnTrackSelection(MediaTrack* trackid)
CSurf_OnTrackSelection(MediaTrack trackid)
reaper.CSurf_OnTrackSelection(MediaTrack trackid)
RPR_CSurf_OnTrackSelection(MediaTrack trackid)
double CSurf_OnVolumeChange(MediaTrack* trackid, double volume, bool relative)
double CSurf_OnVolumeChange(MediaTrack trackid, volume, bool relative)
number reaper.CSurf_OnVolumeChange(MediaTrack trackid, number volume, boolean relative)
Float RPR_CSurf_OnVolumeChange(MediaTrack trackid, Float volume, Boolean relative)
double CSurf_OnVolumeChangeEx(MediaTrack* trackid, double volume, bool relative, bool allowGang)
double CSurf_OnVolumeChangeEx(MediaTrack trackid, volume, bool relative, bool allowGang)
number reaper.CSurf_OnVolumeChangeEx(MediaTrack trackid, number volume, boolean relative, boolean allowGang)
Float RPR_CSurf_OnVolumeChangeEx(MediaTrack trackid, Float volume, Boolean relative, Boolean allowGang)
double CSurf_OnWidthChange(MediaTrack* trackid, double width, bool relative)
double CSurf_OnWidthChange(MediaTrack trackid, width, bool relative)
number reaper.CSurf_OnWidthChange(MediaTrack trackid, number width, boolean relative)
Float RPR_CSurf_OnWidthChange(MediaTrack trackid, Float width, Boolean relative)
double CSurf_OnWidthChangeEx(MediaTrack* trackid, double width, bool relative, bool allowGang)
double CSurf_OnWidthChangeEx(MediaTrack trackid, width, bool relative, bool allowGang)
number reaper.CSurf_OnWidthChangeEx(MediaTrack trackid, number width, boolean relative, boolean allowGang)
Float RPR_CSurf_OnWidthChangeEx(MediaTrack trackid, Float width, Boolean relative, Boolean allowGang)
void CSurf_OnZoom(int xdir, int ydir)
CSurf_OnZoom(int xdir, int ydir)
reaper.CSurf_OnZoom(integer xdir, integer ydir)
RPR_CSurf_OnZoom(Int xdir, Int ydir)
void CSurf_ResetAllCachedVolPanStates()
CSurf_ResetAllCachedVolPanStates()
reaper.CSurf_ResetAllCachedVolPanStates()
RPR_CSurf_ResetAllCachedVolPanStates()
void CSurf_ScrubAmt(double amt)
CSurf_ScrubAmt(amt)
reaper.CSurf_ScrubAmt(number amt)
RPR_CSurf_ScrubAmt(Float amt)
void CSurf_SetAutoMode(int mode, IReaperControlSurface* ignoresurf)
CSurf_SetAutoMode(int mode, IReaperControlSurface ignoresurf)
reaper.CSurf_SetAutoMode(integer mode, IReaperControlSurface ignoresurf)
RPR_CSurf_SetAutoMode(Int mode, IReaperControlSurface ignoresurf)
void CSurf_SetPlayState(bool play, bool pause, bool rec, IReaperControlSurface* ignoresurf)
CSurf_SetPlayState(bool play, bool pause, bool rec, IReaperControlSurface ignoresurf)
reaper.CSurf_SetPlayState(boolean play, boolean pause, boolean rec, IReaperControlSurface ignoresurf)
RPR_CSurf_SetPlayState(Boolean play, Boolean pause, Boolean rec, IReaperControlSurface ignoresurf)
void CSurf_SetRepeatState(bool rep, IReaperControlSurface* ignoresurf)
CSurf_SetRepeatState(bool rep, IReaperControlSurface ignoresurf)
reaper.CSurf_SetRepeatState(boolean rep, IReaperControlSurface ignoresurf)
RPR_CSurf_SetRepeatState(Boolean rep, IReaperControlSurface ignoresurf)
void CSurf_SetSurfaceMute(MediaTrack* trackid, bool mute, IReaperControlSurface* ignoresurf)
CSurf_SetSurfaceMute(MediaTrack trackid, bool mute, IReaperControlSurface ignoresurf)
reaper.CSurf_SetSurfaceMute(MediaTrack trackid, boolean mute, IReaperControlSurface ignoresurf)
RPR_CSurf_SetSurfaceMute(MediaTrack trackid, Boolean mute, IReaperControlSurface ignoresurf)
void CSurf_SetSurfacePan(MediaTrack* trackid, double pan, IReaperControlSurface* ignoresurf)
CSurf_SetSurfacePan(MediaTrack trackid, pan, IReaperControlSurface ignoresurf)
reaper.CSurf_SetSurfacePan(MediaTrack trackid, number pan, IReaperControlSurface ignoresurf)
RPR_CSurf_SetSurfacePan(MediaTrack trackid, Float pan, IReaperControlSurface ignoresurf)
void CSurf_SetSurfaceRecArm(MediaTrack* trackid, bool recarm, IReaperControlSurface* ignoresurf)
CSurf_SetSurfaceRecArm(MediaTrack trackid, bool recarm, IReaperControlSurface ignoresurf)
reaper.CSurf_SetSurfaceRecArm(MediaTrack trackid, boolean recarm, IReaperControlSurface ignoresurf)
RPR_CSurf_SetSurfaceRecArm(MediaTrack trackid, Boolean recarm, IReaperControlSurface ignoresurf)
void CSurf_SetSurfaceSelected(MediaTrack* trackid, bool selected, IReaperControlSurface* ignoresurf)
CSurf_SetSurfaceSelected(MediaTrack trackid, bool selected, IReaperControlSurface ignoresurf)
reaper.CSurf_SetSurfaceSelected(MediaTrack trackid, boolean selected, IReaperControlSurface ignoresurf)
RPR_CSurf_SetSurfaceSelected(MediaTrack trackid, Boolean selected, IReaperControlSurface ignoresurf)
void CSurf_SetSurfaceSolo(MediaTrack* trackid, bool solo, IReaperControlSurface* ignoresurf)
CSurf_SetSurfaceSolo(MediaTrack trackid, bool solo, IReaperControlSurface ignoresurf)
reaper.CSurf_SetSurfaceSolo(MediaTrack trackid, boolean solo, IReaperControlSurface ignoresurf)
RPR_CSurf_SetSurfaceSolo(MediaTrack trackid, Boolean solo, IReaperControlSurface ignoresurf)
void CSurf_SetSurfaceVolume(MediaTrack* trackid, double volume, IReaperControlSurface* ignoresurf)
CSurf_SetSurfaceVolume(MediaTrack trackid, volume, IReaperControlSurface ignoresurf)
reaper.CSurf_SetSurfaceVolume(MediaTrack trackid, number volume, IReaperControlSurface ignoresurf)
RPR_CSurf_SetSurfaceVolume(MediaTrack trackid, Float volume, IReaperControlSurface ignoresurf)
void CSurf_SetTrackListChange()
CSurf_SetTrackListChange()
reaper.CSurf_SetTrackListChange()
RPR_CSurf_SetTrackListChange()
MediaTrack* CSurf_TrackFromID(int idx, bool mcpView)
MediaTrack CSurf_TrackFromID(int idx, bool mcpView)
MediaTrack reaper.CSurf_TrackFromID(integer idx, boolean mcpView)
MediaTrack RPR_CSurf_TrackFromID(Int idx, Boolean mcpView)
int CSurf_TrackToID(MediaTrack* track, bool mcpView)
int CSurf_TrackToID(MediaTrack track, bool mcpView)
integer reaper.CSurf_TrackToID(MediaTrack track, boolean mcpView)
Int RPR_CSurf_TrackToID(MediaTrack track, Boolean mcpView)
double DB2SLIDER(double x)
double DB2SLIDER(x)
number reaper.DB2SLIDER(number x)
Float RPR_DB2SLIDER(Float x)
bool DeleteEnvelopePointRange(TrackEnvelope* envelope, double time_start, double time_end)
bool DeleteEnvelopePointRange(TrackEnvelope envelope, time_start, time_end)
boolean reaper.DeleteEnvelopePointRange(TrackEnvelope envelope, number time_start, number time_end)
Boolean RPR_DeleteEnvelopePointRange(TrackEnvelope envelope, Float time_start, Float time_end)

Delete a range of envelope points.

bool DeleteEnvelopePointRangeEx(TrackEnvelope* envelope, int autoitem_idx, double time_start, double time_end)
bool DeleteEnvelopePointRangeEx(TrackEnvelope envelope, int autoitem_idx, time_start, time_end)
boolean reaper.DeleteEnvelopePointRangeEx(TrackEnvelope envelope, integer autoitem_idx, number time_start, number time_end)
Boolean RPR_DeleteEnvelopePointRangeEx(TrackEnvelope envelope, Int autoitem_idx, Float time_start, Float time_end)

Delete a range of envelope points. autoitem_idx==-1 for the underlying envelope, 0 for the first automation item on the envelope, etc.

void DeleteExtState(const char* section, const char* key, bool persist)
DeleteExtState("section", "key", bool persist)
reaper.DeleteExtState(string section, string key, boolean persist)
RPR_DeleteExtState(String section, String key, Boolean persist)

Delete the extended state value for a specific section and key. persist=true means the value should remain deleted the next time REAPER is opened. See SetExtState, GetExtState, HasExtState.

bool DeleteProjectMarker(ReaProject* proj, int markrgnindexnumber, bool isrgn)
bool DeleteProjectMarker(ReaProject proj, int markrgnindexnumber, bool isrgn)
boolean reaper.DeleteProjectMarker(ReaProject proj, integer markrgnindexnumber, boolean isrgn)
Boolean RPR_DeleteProjectMarker(ReaProject proj, Int markrgnindexnumber, Boolean isrgn)

Delete a marker. proj==NULL for the active project.

bool DeleteProjectMarkerByIndex(ReaProject* proj, int markrgnidx)
bool DeleteProjectMarkerByIndex(ReaProject proj, int markrgnidx)
boolean reaper.DeleteProjectMarkerByIndex(ReaProject proj, integer markrgnidx)
Boolean RPR_DeleteProjectMarkerByIndex(ReaProject proj, Int markrgnidx)

Differs from DeleteProjectMarker only in that markrgnidx 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).

int DeleteTakeStretchMarkers(MediaItem_Take* take, int idx, const int* countInOptional)
int DeleteTakeStretchMarkers(MediaItem_Take take, int idx, optional int countIn)
integer reaper.DeleteTakeStretchMarkers(MediaItem_Take take, integer idx, optional number countIn)
Int RPR_DeleteTakeStretchMarkers(MediaItem_Take take, Int idx, const int countInOptional)

Deletes one or more stretch markers. Returns number of stretch markers deleted.

bool DeleteTempoTimeSigMarker(ReaProject* project, int markerindex)
bool DeleteTempoTimeSigMarker(ReaProject project, int markerindex)
boolean reaper.DeleteTempoTimeSigMarker(ReaProject project, integer markerindex)
Boolean RPR_DeleteTempoTimeSigMarker(ReaProject project, Int markerindex)

Delete a tempo/time signature marker.

void DeleteTrack(MediaTrack* tr)
DeleteTrack(MediaTrack tr)
reaper.DeleteTrack(MediaTrack tr)
RPR_DeleteTrack(MediaTrack tr)

deletes a track

bool DeleteTrackMediaItem(MediaTrack* tr, MediaItem* it)
bool DeleteTrackMediaItem(MediaTrack tr, MediaItem it)
boolean reaper.DeleteTrackMediaItem(MediaTrack tr, MediaItem it)
Boolean RPR_DeleteTrackMediaItem(MediaTrack tr, MediaItem it)
void DestroyAudioAccessor(AudioAccessor* accessor)
DestroyAudioAccessor(AudioAccessor accessor)
reaper.DestroyAudioAccessor(AudioAccessor accessor)
RPR_DestroyAudioAccessor(AudioAccessor accessor)

Destroy an audio accessor. Must only call from the main thread. See CreateTakeAudioAccessor, CreateTrackAudioAccessor, GetAudioAccessorHash, GetAudioAccessorStartTime, GetAudioAccessorEndTime, GetAudioAccessorSamples.

void Dock_UpdateDockID(const char* ident_str, int whichDock)
Dock_UpdateDockID("ident_str", int whichDock)
reaper.Dock_UpdateDockID(string ident_str, integer whichDock)
RPR_Dock_UpdateDockID(String ident_str, Int whichDock)

updates preference for docker window ident_str to be in dock whichDock on next open

int DockIsChildOfDock(HWND hwnd, bool* isFloatingDockerOut)
int DockIsChildOfDock(HWND hwnd, bool &isFloatingDocker)
integer retval, boolean isFloatingDocker = reaper.DockIsChildOfDock(HWND hwnd)
(Int retval, HWND hwnd, Boolean isFloatingDockerOut) = RPR_DockIsChildOfDock(hwnd, isFloatingDockerOut)

returns dock index that contains hwnd, or -1

void DockWindowActivate(HWND hwnd)
DockWindowActivate(HWND hwnd)
reaper.DockWindowActivate(HWND hwnd)
RPR_DockWindowActivate(HWND hwnd)
void DockWindowAdd(HWND hwnd, const char* name, int pos, bool allowShow)
DockWindowAdd(HWND hwnd, "name", int pos, bool allowShow)
reaper.DockWindowAdd(HWND hwnd, string name, integer pos, boolean allowShow)
RPR_DockWindowAdd(HWND hwnd, String name, Int pos, Boolean allowShow)
void DockWindowAddEx(HWND hwnd, const char* name, const char* identstr, bool allowShow)
DockWindowAddEx(HWND hwnd, "name", "identstr", bool allowShow)
reaper.DockWindowAddEx(HWND hwnd, string name, string identstr, boolean allowShow)
RPR_DockWindowAddEx(HWND hwnd, String name, String identstr, Boolean allowShow)
void DockWindowRefresh()
DockWindowRefresh()
reaper.DockWindowRefresh()
RPR_DockWindowRefresh()
void DockWindowRefreshForHWND(HWND hwnd)
DockWindowRefreshForHWND(HWND hwnd)
reaper.DockWindowRefreshForHWND(HWND hwnd)
RPR_DockWindowRefreshForHWND(HWND hwnd)
void DockWindowRemove(HWND hwnd)
DockWindowRemove(HWND hwnd)
reaper.DockWindowRemove(HWND hwnd)
RPR_DockWindowRemove(HWND hwnd)
bool EditTempoTimeSigMarker(ReaProject* project, int markerindex)
bool EditTempoTimeSigMarker(ReaProject project, int markerindex)
boolean reaper.EditTempoTimeSigMarker(ReaProject project, integer markerindex)
Boolean RPR_EditTempoTimeSigMarker(ReaProject project, Int markerindex)

Open the tempo/time signature marker editor dialog.

void EnsureNotCompletelyOffscreen(RECT* rInOut)
EnsureNotCompletelyOffscreen(int &rIn.left, int &rIn.top, int &rIn.right, int &rIn.bot)
numberrIn.left, numberrIn.top, numberrIn.right, numberrIn.bot = reaper.EnsureNotCompletelyOffscreen()
RPR_EnsureNotCompletelyOffscreen(RECT rInOut)

call with a saved window rect for your window and it'll correct any positioning info.

const char* EnumerateFiles(const char* path, int fileindex)
bool EnumerateFiles(#retval, "path", int fileindex)
string reaper.EnumerateFiles(string path, integer fileindex)
String RPR_EnumerateFiles(String path, Int fileindex)

List the files in the "path" directory. Returns NULL (or empty string, in Lua) when all files have been listed. See EnumerateSubdirectories

const char* EnumerateSubdirectories(const char* path, int subdirindex)
bool EnumerateSubdirectories(#retval, "path", int subdirindex)
string reaper.EnumerateSubdirectories(string path, integer subdirindex)
String RPR_EnumerateSubdirectories(String path, Int subdirindex)

List the subdirectories in the "path" directory. Returns NULL (or empty string, in Lua) when all subdirectories have been listed. See EnumerateFiles

bool EnumPitchShiftModes(int mode, const char** strOut)
bool EnumPitchShiftModes(int mode, #str)
boolean retval, string str = reaper.EnumPitchShiftModes(integer mode)
Boolean RPR_EnumPitchShiftModes(Int mode, String strOut)

Start querying modes at 0, returns FALSE when no more modes possible, sets strOut to NULL if a mode is currently unsupported

const char* EnumPitchShiftSubModes(int mode, int submode)
bool EnumPitchShiftSubModes(#retval, int mode, int submode)
string reaper.EnumPitchShiftSubModes(integer mode, integer submode)
String RPR_EnumPitchShiftSubModes(Int mode, Int submode)

Returns submode name, or NULL

int EnumProjectMarkers(int idx, bool* isrgnOut, double* posOut, double* rgnendOut, const char** nameOut, int* markrgnindexnumberOut)
int EnumProjectMarkers(int idx, bool &isrgn, &pos, &rgnend, #name, int &markrgnindexnumber)
integer retval, boolean isrgn, number pos, number rgnend, string name, number markrgnindexnumber = reaper.EnumProjectMarkers(integer idx)
(Int retval, Int idx, Boolean isrgnOut, Float posOut, Float rgnendOut, String nameOut, Int markrgnindexnumberOut) = RPR_EnumProjectMarkers(idx, isrgnOut, posOut, rgnendOut, nameOut, markrgnindexnumberOut)
int EnumProjectMarkers2(ReaProject* proj, int idx, bool* isrgnOut, double* posOut, double* rgnendOut, const char** nameOut, int* markrgnindexnumberOut)
int EnumProjectMarkers2(ReaProject proj, int idx, bool &isrgn, &pos, &rgnend, #name, int &markrgnindexnumber)
integer retval, boolean isrgn, number pos, number rgnend, string name, number markrgnindexnumber = reaper.EnumProjectMarkers2(ReaProject proj, integer idx)
(Int retval, ReaProject proj, Int idx, Boolean isrgnOut, Float posOut, Float rgnendOut, String nameOut, Int markrgnindexnumberOut) = RPR_EnumProjectMarkers2(proj, idx, isrgnOut, posOut, rgnendOut, nameOut, markrgnindexnumberOut)
int EnumProjectMarkers3(ReaProject* proj, int idx, bool* isrgnOut, double* posOut, double* rgnendOut, const char** nameOut, int* markrgnindexnumberOut, int* colorOut)
int EnumProjectMarkers3(ReaProject proj, int idx, bool &isrgn, &pos, &rgnend, #name, int &markrgnindexnumber, int &color)
integer retval, boolean isrgn, number pos, number rgnend, string name, number markrgnindexnumber, number color = reaper.EnumProjectMarkers3(ReaProject proj, integer idx)
(Int retval, ReaProject proj, Int idx, Boolean isrgnOut, Float posOut, Float rgnendOut, String nameOut, Int markrgnindexnumberOut, Int colorOut) = RPR_EnumProjectMarkers3(proj, idx, isrgnOut, posOut, rgnendOut, nameOut, markrgnindexnumberOut, colorOut)
ReaProject* EnumProjects(int idx, char* projfn, int projfn_sz)
ReaProject EnumProjects(int idx, #projfn)
ReaProject retval, string projfn = reaper.EnumProjects(integer idx, string projfn)
(ReaProject retval, Int idx, String projfn, Int projfn_sz) = RPR_EnumProjects(idx, projfn, projfn_sz)

idx=-1 for current project,projfn can be NULL if not interested in filename. use idx 0x40000000 for currently rendering project, if any.

bool EnumProjExtState(ReaProject* proj, const char* extname, int idx, char* keyOutOptional, int keyOutOptional_sz, char* valOutOptional, int valOutOptional_sz)
bool EnumProjExtState(ReaProject proj, "extname", int idx, optional #key, optional #val)
boolean retval, optional string key, optional string val = reaper.EnumProjExtState(ReaProject proj, string extname, integer idx)
(Boolean retval, ReaProject proj, String extname, Int idx, String keyOutOptional, Int keyOutOptional_sz, String valOutOptional, Int valOutOptional_sz) = RPR_EnumProjExtState(proj, extname, idx, keyOutOptional, keyOutOptional_sz, valOutOptional, valOutOptional_sz)

Enumerate the data stored with the project for a specific extname. Returns false when there is no more data. See SetProjExtState, GetProjExtState.

MediaTrack* EnumRegionRenderMatrix(ReaProject* proj, int regionindex, int rendertrack)
MediaTrack EnumRegionRenderMatrix(ReaProject proj, int regionindex, int rendertrack)
MediaTrack reaper.EnumRegionRenderMatrix(ReaProject proj, integer regionindex, integer rendertrack)
MediaTrack RPR_EnumRegionRenderMatrix(ReaProject proj, Int regionindex, Int rendertrack)

Enumerate which tracks will be rendered within this region when using the region render matrix. When called with rendertrack==0, the function returns the first track that will be rendered (which may be the master track); rendertrack==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.

bool EnumTrackMIDIProgramNames(int track, int programNumber, char* programName, int programName_sz)
bool EnumTrackMIDIProgramNames(int track, int programNumber, #programName)
boolean retval, string programName = reaper.EnumTrackMIDIProgramNames(integer track, integer programNumber, string programName)
(Boolean retval, Int track, Int programNumber, String programName, Int programName_sz) = RPR_EnumTrackMIDIProgramNames(track, programNumber, programName, programName_sz)

returns false if there are no plugins on the track that support MIDI programs,or if all programs have been enumerated

bool EnumTrackMIDIProgramNamesEx(ReaProject* proj, MediaTrack* track, int programNumber, char* programName, int programName_sz)
bool EnumTrackMIDIProgramNamesEx(ReaProject proj, MediaTrack track, int programNumber, #programName)
boolean retval, string programName = reaper.EnumTrackMIDIProgramNamesEx(ReaProject proj, MediaTrack track, integer programNumber, string programName)
(Boolean retval, ReaProject proj, MediaTrack track, Int programNumber, String programName, Int programName_sz) = RPR_EnumTrackMIDIProgramNamesEx(proj, track, programNumber, programName, programName_sz)

returns false if there are no plugins on the track that support MIDI programs,or if all programs have been enumerated

int Envelope_Evaluate(TrackEnvelope* envelope, double time, double samplerate, int samplesRequested, double* valueOutOptional, double* dVdSOutOptional, double* ddVdSOutOptional, double* dddVdSOutOptional)
int Envelope_Evaluate(TrackEnvelope envelope, time, samplerate, int samplesRequested, optional &value, optional &dVdS, optional &ddVdS, optional &dddVdS)
integer retval, optional number value, optional number dVdS, optional number ddVdS, optional number dddVdS = reaper.Envelope_Evaluate(TrackEnvelope envelope, number time, number samplerate, integer samplesRequested)
(Int retval, TrackEnvelope envelope, Float time, Float samplerate, Int samplesRequested, Float valueOutOptional, Float dVdSOutOptional, Float ddVdSOutOptional, Float dddVdSOutOptional) = RPR_Envelope_Evaluate(envelope, time, samplerate, samplesRequested, valueOutOptional, dVdSOutOptional, ddVdSOutOptional, dddVdSOutOptional)

Get the effective envelope value at a given time position. samplesRequested is how long the caller expects until the next call to Envelope_Evaluate (often, the buffer block size). The return value is how many samples beyond that time position that the returned values are valid. dVdS is the change in value per sample (first derivative), ddVdS is the seond derivative, dddVdS is the third derivative. See GetEnvelopeScalingMode.

void Envelope_FormatValue(TrackEnvelope* env, double value, char* bufOut, int bufOut_sz)
Envelope_FormatValue(TrackEnvelope env, value, #buf)
string buf = reaper.Envelope_FormatValue(TrackEnvelope env, number value)
(TrackEnvelope env, Float value, String bufOut, Int bufOut_sz) = RPR_Envelope_FormatValue(env, value, bufOut, bufOut_sz)

Formats the value of an envelope to a user-readable form

MediaItem_Take* Envelope_GetParentTake(TrackEnvelope* env, int* indexOutOptional, int* index2OutOptional)
MediaItem_Take Envelope_GetParentTake(TrackEnvelope env, optional int &index, optional int &index2)
MediaItem_Take retval, optional number index, optional number index2 = reaper.Envelope_GetParentTake(TrackEnvelope env)
(MediaItem_Take retval, TrackEnvelope env, Int indexOutOptional, Int index2OutOptional) = RPR_Envelope_GetParentTake(env, indexOutOptional, index2OutOptional)

If take envelope, gets the take from the envelope. If FX, indexOutOptional set to FX index, index2OutOptional set to parameter index, otherwise -1.

MediaTrack* Envelope_GetParentTrack(TrackEnvelope* env, int* indexOutOptional, int* index2OutOptional)
MediaTrack Envelope_GetParentTrack(TrackEnvelope env, optional int &index, optional int &index2)
MediaTrack retval, optional number index, optional number index2 = reaper.Envelope_GetParentTrack(TrackEnvelope env)
(MediaTrack retval, TrackEnvelope env, Int indexOutOptional, Int index2OutOptional) = RPR_Envelope_GetParentTrack(env, indexOutOptional, index2OutOptional)

If track envelope, gets the track from the envelope. If FX, indexOutOptional set to FX index, index2OutOptional set to parameter index, otherwise -1.

bool Envelope_SortPoints(TrackEnvelope* envelope)
bool Envelope_SortPoints(TrackEnvelope envelope)
boolean reaper.Envelope_SortPoints(TrackEnvelope envelope)
Boolean RPR_Envelope_SortPoints(TrackEnvelope envelope)

Sort envelope points by time. See SetEnvelopePoint, InsertEnvelopePoint.

bool Envelope_SortPointsEx(TrackEnvelope* envelope, int autoitem_idx)
bool Envelope_SortPointsEx(TrackEnvelope envelope, int autoitem_idx)
boolean reaper.Envelope_SortPointsEx(TrackEnvelope envelope, integer autoitem_idx)
Boolean RPR_Envelope_SortPointsEx(TrackEnvelope envelope, Int autoitem_idx)

Sort envelope points by time. autoitem_idx==-1 for the underlying envelope, 0 for the first automation item on the envelope, etc. See SetEnvelopePoint, InsertEnvelopePoint.

const char* ExecProcess(const char* cmdline, int timeoutmsec)
bool ExecProcess(#retval, "cmdline", int timeoutmsec)
string reaper.ExecProcess(string cmdline, integer timeoutmsec)
String RPR_ExecProcess(String cmdline, Int timeoutmsec)

Executes command line, returns NULL on total failure, otherwise the return value, a newline, and then the output of the command. If timeoutmsec is 0, command will be allowed to run indefinitely (recommended for large amounts of returned output). timeoutmsec is -1 for no wait/terminate, -2 for no wait and minimize

bool file_exists(const char* path)
bool file_exists("path")
boolean reaper.file_exists(string path)
Boolean RPR_file_exists(String path)

returns true if path points to a valid, readable file

int FindTempoTimeSigMarker(ReaProject* project, double time)
int FindTempoTimeSigMarker(ReaProject project, time)
integer reaper.FindTempoTimeSigMarker(ReaProject project, number time)
Int RPR_FindTempoTimeSigMarker(ReaProject project, Float time)

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).

void format_timestr(double tpos, char* buf, int buf_sz)
format_timestr(tpos, #buf)
string buf = reaper.format_timestr(number tpos, string buf)
(Float tpos, String buf, Int buf_sz) = RPR_format_timestr(tpos, buf, buf_sz)

Format tpos (which is time in seconds) as hh:mm:ss.sss. See format_timestr_pos, format_timestr_len.

void format_timestr_len(double tpos, char* buf, int buf_sz, double offset, int modeoverride)
format_timestr_len(tpos, #buf, offset, int modeoverride)
string buf = reaper.format_timestr_len(number tpos, string buf, number offset, integer modeoverride)
(Float tpos, String buf, Int buf_sz, Float offset, Int modeoverride) = RPR_format_timestr_len(tpos, buf, buf_sz, offset, modeoverride)
time formatting mode overrides: -1=proj default.
0=time
1=measures.beats + time
2=measures.beats
3=seconds
4=samples
5=h:m:s:f

offset is start of where the length will be calculated from

void format_timestr_pos(double tpos, char* buf, int buf_sz, int modeoverride)
format_timestr_pos(tpos, #buf, int modeoverride)
string buf = reaper.format_timestr_pos(number tpos, string buf, integer modeoverride)
(Float tpos, String buf, Int buf_sz, Int modeoverride) = RPR_format_timestr_pos(tpos, buf, buf_sz, modeoverride)
time formatting mode overrides: -1=proj default.
0=time
1=measures.beats + time
2=measures.beats
3=seconds
4=samples
5=h:m:s:f
void genGuid(GUID* g)
genGuid(#gGUID)
string gGUID = reaper.genGuid(string gGUID)
RPR_genGuid(GUID g)
const char* get_ini_file()
bool get_ini_file(#retval)
string reaper.get_ini_file()
String RPR_get_ini_file()

Get reaper.ini full filename.

MediaItem_Take* GetActiveTake(MediaItem* item)
MediaItem_Take GetActiveTake(MediaItem item)
MediaItem_Take reaper.GetActiveTake(MediaItem item)
MediaItem_Take RPR_GetActiveTake(MediaItem item)

get the active take in this item

int GetAllProjectPlayStates(ReaProject* ignoreProject)
int GetAllProjectPlayStates(ReaProject ignoreProject)
integer reaper.GetAllProjectPlayStates(ReaProject ignoreProject)
Int RPR_GetAllProjectPlayStates(ReaProject ignoreProject)

returns the bitwise OR of all project play states (1=playing, 2=pause, 4=recording)

const char* GetAppVersion()
bool GetAppVersion(#retval)
string reaper.GetAppVersion()
String RPR_GetAppVersion()
int GetArmedCommand(char* secOut, int secOut_sz)
int GetArmedCommand(#sec)
integer retval, string sec = reaper.GetArmedCommand()
(Int retval, String secOut, Int secOut_sz) = RPR_GetArmedCommand(secOut, secOut_sz)

gets the currently armed command and section name (returns 0 if nothing armed). section name is empty-string for main section.

double GetAudioAccessorEndTime(AudioAccessor* accessor)
double GetAudioAccessorEndTime(AudioAccessor accessor)
number reaper.GetAudioAccessorEndTime(AudioAccessor accessor)
Float RPR_GetAudioAccessorEndTime(AudioAccessor accessor)

Get the end time of the audio that can be returned from this accessor. See CreateTakeAudioAccessor, CreateTrackAudioAccessor, DestroyAudioAccessor, GetAudioAccessorHash, GetAudioAccessorStartTime, GetAudioAccessorSamples.

void GetAudioAccessorHash(AudioAccessor* accessor, char* hashNeed128)
GetAudioAccessorHash(AudioAccessor accessor, #hashNeed128)
string hashNeed128 = reaper.GetAudioAccessorHash(AudioAccessor accessor, string hashNeed128)
(AudioAccessor accessor, String hashNeed128) = RPR_GetAudioAccessorHash(accessor, hashNeed128)

Get a short hash string (128 chars or less) that will change only if the underlying samples change. See CreateTakeAudioAccessor, CreateTrackAudioAccessor, DestroyAudioAccessor, GetAudioAccessorStartTime, GetAudioAccessorEndTime, GetAudioAccessorSamples.

int GetAudioAccessorSamples(AudioAccessor* accessor, int samplerate, int numchannels, double starttime_sec, int numsamplesperchannel, double* samplebuffer)
int GetAudioAccessorSamples(AudioAccessor accessor, int samplerate, int numchannels, starttime_sec, int numsamplesperchannel, buffer_ptr samplebuffer)
integer reaper.GetAudioAccessorSamples(AudioAccessor accessor, integer samplerate, integer numchannels, number starttime_sec, integer numsamplesperchannel, reaper.array samplebuffer)
(Int retval, AudioAccessor accessor, Int samplerate, Int numchannels, Float starttime_sec, Int numsamplesperchannel, Float samplebuffer) = RPR_GetAudioAccessorSamples(accessor, samplerate, numchannels, starttime_sec, numsamplesperchannel, samplebuffer)
Get a block of samples from the audio accessor. Samples are extracted immediately pre-FX, and returned interleaved (first sample of first channel, first sample of second channel...). Returns 0 if no audio, 1 if audio, -1 on error. See CreateTakeAudioAccessor, CreateTrackAudioAccessor, DestroyAudioAccessor, GetAudioAccessorHash, GetAudioAccessorStartTime, GetAudioAccessorEndTime.

This function has special handling in Python, and only returns two objects, the API function return value, and the sample buffer. Example usage:

tr = RPR_GetTrack(0, 0)
aa = RPR_CreateTrackAudioAccessor(tr)
buf = list([0]*2*1024) # 2 channels, 1024 samples each, initialized to zero
pos = 0.0
(ret, buf) = GetAudioAccessorSamples(aa, 44100, 2, pos, 1024, buf)
# buf now holds the first 2*1024 audio samples from the track.
# typically GetAudioAccessorSamples() would be called within a loop, increasing pos each time.
double GetAudioAccessorStartTime(AudioAccessor* accessor)
double GetAudioAccessorStartTime(AudioAccessor accessor)
number reaper.GetAudioAccessorStartTime(AudioAccessor accessor)
Float RPR_GetAudioAccessorStartTime(AudioAccessor accessor)

Get the start time of the audio that can be returned from this accessor. See CreateTakeAudioAccessor, CreateTrackAudioAccessor, DestroyAudioAccessor, GetAudioAccessorHash, GetAudioAccessorEndTime, GetAudioAccessorSamples.

bool GetAudioDeviceInfo(const char* attribute, char* desc, int desc_sz)
bool GetAudioDeviceInfo("attribute", #desc)
boolean retval, string desc = reaper.GetAudioDeviceInfo(string attribute, string desc)
(Boolean retval, String attribute, String desc, Int desc_sz) = RPR_GetAudioDeviceInfo(attribute, desc, desc_sz)

get information about the currently open audio device. attribute can be MODE, IDENT_IN, IDENT_OUT, BSIZE, SRATE, BPS. returns false if unknown attribute or device not open.

int GetConfigWantsDock(const char* ident_str)
int GetConfigWantsDock("ident_str")
integer reaper.GetConfigWantsDock(string ident_str)
Int RPR_GetConfigWantsDock(String ident_str)

gets the dock ID desired by ident_str, if any

ReaProject* GetCurrentProjectInLoadSave()
ReaProject GetCurrentProjectInLoadSave()
ReaProject reaper.GetCurrentProjectInLoadSave()
ReaProject RPR_GetCurrentProjectInLoadSave()

returns current project if in load/save (usually only used from project_config_extension_t)

int GetCursorContext()
int GetCursorContext()
integer reaper.GetCursorContext()
Int RPR_GetCursorContext()

return the current cursor context: 0 if track panels, 1 if items, 2 if envelopes, otherwise unknown

int GetCursorContext2(bool want_last_valid)
int GetCursorContext2(bool want_last_valid)
integer reaper.GetCursorContext2(boolean want_last_valid)
Int RPR_GetCursorContext2(Boolean want_last_valid)

0 if track panels, 1 if items, 2 if envelopes, otherwise unknown (unlikely when want_last_valid is true)

double GetCursorPosition()
double GetCursorPosition()
number reaper.GetCursorPosition()
Float RPR_GetCursorPosition()

edit cursor position

double GetCursorPositionEx(ReaProject* proj)
double GetCursorPositionEx(ReaProject proj)
number reaper.GetCursorPositionEx(ReaProject proj)
Float RPR_GetCursorPositionEx(ReaProject proj)

edit cursor position

int GetDisplayedMediaItemColor(MediaItem* item)
int GetDisplayedMediaItemColor(MediaItem item)
integer reaper.GetDisplayedMediaItemColor(MediaItem item)
Int RPR_GetDisplayedMediaItemColor(MediaItem item)

see GetDisplayedMediaItemColor2.

int GetDisplayedMediaItemColor2(MediaItem* item, MediaItem_Take* take)
int GetDisplayedMediaItemColor2(MediaItem item, MediaItem_Take take)
integer reaper.GetDisplayedMediaItemColor2(MediaItem item, MediaItem_Take take)
Int RPR_GetDisplayedMediaItemColor2(MediaItem item, MediaItem_Take take)

Returns the custom take, item, or track color that is used (according to the user preference) to color the media item. The returned color is OS dependent|0x01000000 (i.e. ColorToNative(r,g,b)|0x01000000), so a return of zero means "no color", not black.

bool GetEnvelopeName(TrackEnvelope* env, char* buf, int buf_sz)
bool GetEnvelopeName(TrackEnvelope env, #buf)
boolean retval, string buf = reaper.GetEnvelopeName(TrackEnvelope env, string buf)
(Boolean retval, TrackEnvelope env, String buf, Int buf_sz) = RPR_GetEnvelopeName(env, buf, buf_sz)
bool GetEnvelopePoint(TrackEnvelope* envelope, int ptidx, double* timeOutOptional, double* valueOutOptional, int* shapeOutOptional, double* tensionOutOptional, bool* selectedOutOptional)
bool GetEnvelopePoint(TrackEnvelope envelope, int ptidx, optional &time, optional &value, optional int &shape, optional &tension, optional bool &selected)
boolean retval, optional number time, optional number value, optional number shape, optional number tension, optional boolean selected = reaper.GetEnvelopePoint(TrackEnvelope envelope, integer ptidx)
(Boolean retval, TrackEnvelope envelope, Int ptidx, Float timeOutOptional, Float valueOutOptional, Int shapeOutOptional, Float tensionOutOptional, Boolean selectedOutOptional) = RPR_GetEnvelopePoint(envelope, ptidx, timeOutOptional, valueOutOptional, shapeOutOptional, tensionOutOptional, selectedOutOptional)

Get the attributes of an envelope point. See GetEnvelopePointByTime, SetEnvelopePoint.

int GetEnvelopePointByTime(TrackEnvelope* envelope, double time)
int GetEnvelopePointByTime(TrackEnvelope envelope, time)
integer reaper.GetEnvelopePointByTime(TrackEnvelope envelope, number time)
Int RPR_GetEnvelopePointByTime(TrackEnvelope envelope, Float time)

Returns the envelope point at or immediately prior to the given time position. See GetEnvelopePoint, SetEnvelopePoint, Envelope_Evaluate.

int GetEnvelopePointByTimeEx(TrackEnvelope* envelope, int autoitem_idx, double time)
int GetEnvelopePointByTimeEx(TrackEnvelope envelope, int autoitem_idx, time)
integer reaper.GetEnvelopePointByTimeEx(TrackEnvelope envelope, integer autoitem_idx, number time)
Int RPR_GetEnvelopePointByTimeEx(TrackEnvelope envelope, Int autoitem_idx, Float time)

Returns the envelope point at or immediately prior to the given time position. autoitem_idx==-1 for the underlying envelope, 0 for the first automation item on the envelope, etc. See GetEnvelopePoint, SetEnvelopePoint, Envelope_Evaluate.

bool GetEnvelopePointEx(TrackEnvelope* envelope, int autoitem_idx, int ptidx, double* timeOutOptional, double* valueOutOptional, int* shapeOutOptional, double* tensionOutOptional, bool* selectedOutOptional)
bool GetEnvelopePointEx(TrackEnvelope envelope, int autoitem_idx, int ptidx, optional &time, optional &value, optional int &shape, optional &tension, optional bool &selected)
boolean retval, optional number time, optional number value, optional number shape, optional number tension, optional boolean selected = reaper.GetEnvelopePointEx(TrackEnvelope envelope, integer autoitem_idx, integer ptidx)
(Boolean retval, TrackEnvelope envelope, Int autoitem_idx, Int ptidx, Float timeOutOptional, Float valueOutOptional, Int shapeOutOptional, Float tensionOutOptional, Boolean selectedOutOptional) = RPR_GetEnvelopePointEx(envelope, autoitem_idx, ptidx, timeOutOptional, valueOutOptional, shapeOutOptional, tensionOutOptional, selectedOutOptional)

Get the attributes of an envelope point. autoitem_idx==-1 for the underlying envelope, 0 for the first automation item on the envelope, etc. See GetEnvelopePointByTime, SetEnvelopePoint.

int GetEnvelopeScalingMode(TrackEnvelope* env)
int GetEnvelopeScalingMode(TrackEnvelope env)
integer reaper.GetEnvelopeScalingMode(TrackEnvelope env)
Int RPR_GetEnvelopeScalingMode(TrackEnvelope env)

Returns the envelope scaling mode: 0=no scaling, 1=fader scaling. All API functions deal with raw envelope point values, to convert raw from/to scaled values see ScaleFromEnvelopeMode, ScaleToEnvelopeMode.

bool GetEnvelopeStateChunk(TrackEnvelope* env, char* strNeedBig, int strNeedBig_sz, bool isundoOptional)
bool GetEnvelopeStateChunk(TrackEnvelope env, #str, bool isundo)
boolean retval, string str = reaper.GetEnvelopeStateChunk(TrackEnvelope env, string str, boolean isundo)
(Boolean retval, TrackEnvelope env, String strNeedBig, Int strNeedBig_sz, Boolean isundoOptional) = RPR_GetEnvelopeStateChunk(env, strNeedBig, strNeedBig_sz, isundoOptional)

Gets the RPPXML state of an envelope, returns true if successful. Undo flag is a performance/caching hint.

const char* GetExePath()
bool GetExePath(#retval)
string reaper.GetExePath()
String RPR_GetExePath()

returns path of REAPER.exe (not including EXE), i.e. C:\Program Files\REAPER

const char* GetExtState(const char* section, const char* key)
bool GetExtState(#retval, "section", "key")
string reaper.GetExtState(string section, string key)
String RPR_GetExtState(String section, String key)

Get the extended state value for a specific section and key. See SetExtState, DeleteExtState, HasExtState.

int GetFocusedFX(int* tracknumberOut, int* itemnumberOut, int* fxnumberOut)
int GetFocusedFX(int &tracknumber, int &itemnumber, int &fxnumber)
integer retval, number tracknumber, number itemnumber, number fxnumber = reaper.GetFocusedFX()
(Int retval, Int tracknumberOut, Int itemnumberOut, Int fxnumberOut) = RPR_GetFocusedFX(tracknumberOut, itemnumberOut, fxnumberOut)

Returns 1 if a track FX window has focus, 2 if an item FX window has focus, 0 if no FX window has focus. tracknumber==0 means the master track, 1 means track 1, etc. itemnumber and fxnumber are zero-based. If item FX, fxnumber will have the high word be the take index, the low word the FX index. See GetLastTouchedFX.

int GetFreeDiskSpaceForRecordPath(ReaProject* proj, int pathidx)
int GetFreeDiskSpaceForRecordPath(ReaProject proj, int pathidx)
integer reaper.GetFreeDiskSpaceForRecordPath(ReaProject proj, integer pathidx)
Int RPR_GetFreeDiskSpaceForRecordPath(ReaProject proj, Int pathidx)

returns free disk space in megabytes, pathIdx 0 for normal, 1 for alternate.

TrackEnvelope* GetFXEnvelope(MediaTrack* track, int fxindex, int parameterindex, bool create)
TrackEnvelope GetFXEnvelope(MediaTrack track, int fxindex, int parameterindex, bool create)
TrackEnvelope reaper.GetFXEnvelope(MediaTrack track, integer fxindex, integer parameterindex, boolean create)
TrackEnvelope RPR_GetFXEnvelope(MediaTrack track, Int fxindex, Int parameterindex, Boolean create)

Returns the FX parameter envelope. If the envelope does not exist and create=true, the envelope will be created.

int GetGlobalAutomationOverride()
int GetGlobalAutomationOverride()
integer reaper.GetGlobalAutomationOverride()
Int RPR_GetGlobalAutomationOverride()

return -1=no override, 0=trim/read, 1=read, 2=touch, 3=write, 4=latch, 5=bypass

double GetHZoomLevel()
double GetHZoomLevel()
number reaper.GetHZoomLevel()
Float RPR_GetHZoomLevel()

returns pixels/second

const char* GetInputChannelName(int channelIndex)
bool GetInputChannelName(#retval, int channelIndex)
string reaper.GetInputChannelName(integer channelIndex)
String RPR_GetInputChannelName(Int channelIndex)
void GetInputOutputLatency(int* inputlatencyOut, int* outputLatencyOut)
GetInputOutputLatency(int &inputlatency, int &outputLatency)
number inputlatency, number outputLatency = reaper.GetInputOutputLatency()
(Int inputlatencyOut, Int outputLatencyOut) = RPR_GetInputOutputLatency(inputlatencyOut, outputLatencyOut)

Gets the audio device input/output latency in samples

double GetItemEditingTime2(PCM_source** which_itemOut, int* flagsOut)
double GetItemEditingTime2(PCM_source &which_item, int &flags)
number, PCM_source which_item, number flags = reaper.GetItemEditingTime2()
(Float retval, PCM_source* which_itemOut, Int flagsOut) = RPR_GetItemEditingTime2(which_itemOut, flagsOut)

returns time of relevant edit, set which_item to the pcm_source (if applicable), flags (if specified) will be set to 1 for edge resizing, 2 for fade change, 4 for item move

ReaProject* GetItemProjectContext(MediaItem* item)
ReaProject GetItemProjectContext(MediaItem item)
ReaProject reaper.GetItemProjectContext(MediaItem item)
ReaProject RPR_GetItemProjectContext(MediaItem item)
bool GetItemStateChunk(MediaItem* item, char* strNeedBig, int strNeedBig_sz, bool isundoOptional)
bool GetItemStateChunk(MediaItem item, #str, bool isundo)
boolean retval, string str = reaper.GetItemStateChunk(MediaItem item, string str, boolean isundo)
(Boolean retval, MediaItem item, String strNeedBig, Int strNeedBig_sz, Boolean isundoOptional) = RPR_GetItemStateChunk(item, strNeedBig, strNeedBig_sz, isundoOptional)

Gets the RPPXML state of an item, returns true if successful. Undo flag is a performance/caching hint.

const char* GetLastColorThemeFile()
bool GetLastColorThemeFile(#retval)
string reaper.GetLastColorThemeFile()
String RPR_GetLastColorThemeFile()
void GetLastMarkerAndCurRegion(ReaProject* proj, double time, int* markeridxOut, int* regionidxOut)
GetLastMarkerAndCurRegion(ReaProject proj, time, int &markeridx, int &regionidx)
number markeridx, number regionidx = reaper.GetLastMarkerAndCurRegion(ReaProject proj, number time)
(ReaProject proj, Float time, Int markeridxOut, Int regionidxOut) = RPR_GetLastMarkerAndCurRegion(proj, time, markeridxOut, regionidxOut)

Get the last project marker before time, and/or the project region that includes time. markeridx and regionidx are returned not necessarily as the displayed marker/region index, but as the index that can be passed to EnumProjectMarkers. Either or both of markeridx and regionidx may be NULL. See EnumProjectMarkers.

bool GetLastTouchedFX(int* tracknumberOut, int* fxnumberOut, int* paramnumberOut)
bool GetLastTouchedFX(int &tracknumber, int &fxnumber, int &paramnumber)
boolean retval, number tracknumber, number fxnumber, number paramnumber = reaper.GetLastTouchedFX()
(Boolean retval, Int tracknumberOut, Int fxnumberOut, Int paramnumberOut) = RPR_GetLastTouchedFX(tracknumberOut, fxnumberOut, paramnumberOut)

Returns true if the last touched FX parameter is valid, false otherwise. tracknumber==0 means the master track, 1 means track 1, etc. fxnumber and paramnumber are zero-based. See GetFocusedFX.

MediaTrack* GetLastTouchedTrack()
MediaTrack GetLastTouchedTrack()
MediaTrack reaper.GetLastTouchedTrack()
MediaTrack RPR_GetLastTouchedTrack()
HWND GetMainHwnd()
HWND GetMainHwnd()
HWND reaper.GetMainHwnd()
HWND RPR_GetMainHwnd()
int GetMasterMuteSoloFlags()
int GetMasterMuteSoloFlags()
integer reaper.GetMasterMuteSoloFlags()
Int RPR_GetMasterMuteSoloFlags()

&1=master mute,&2=master solo. This is deprecated as you can just query the master track as well.

MediaTrack* GetMasterTrack(ReaProject* proj)
MediaTrack GetMasterTrack(ReaProject proj)
MediaTrack reaper.GetMasterTrack(ReaProject proj)
MediaTrack RPR_GetMasterTrack(ReaProject proj)
int GetMasterTrackVisibility()
int GetMasterTrackVisibility()
integer reaper.GetMasterTrackVisibility()
Int RPR_GetMasterTrackVisibility()

returns &1 if the master track is visible in the TCP, &2 if visible in the mixer. See SetMasterTrackVisibility.

int GetMaxMidiInputs()
int GetMaxMidiInputs()
integer reaper.GetMaxMidiInputs()
Int RPR_GetMaxMidiInputs()

returns max dev for midi inputs/outputs

int GetMaxMidiOutputs()
int GetMaxMidiOutputs()
integer reaper.GetMaxMidiOutputs()
Int RPR_GetMaxMidiOutputs()
MediaItem* GetMediaItem(ReaProject* proj, int itemidx)
MediaItem GetMediaItem(ReaProject proj, int itemidx)
MediaItem reaper.GetMediaItem(ReaProject proj, integer itemidx)
MediaItem RPR_GetMediaItem(ReaProject proj, Int itemidx)

get an item from a project by item count (zero-based) (proj=0 for active project)

MediaTrack* GetMediaItem_Track(MediaItem* item)
MediaTrack GetMediaItem_Track(MediaItem item)
MediaTrack reaper.GetMediaItem_Track(MediaItem item)
MediaTrack RPR_GetMediaItem_Track(MediaItem item)

Get parent track of media item

double GetMediaItemInfo_Value(MediaItem* item, const char* parmname)
double GetMediaItemInfo_Value(MediaItem item, "parmname")
number reaper.GetMediaItemInfo_Value(MediaItem item, string parmname)
Float RPR_GetMediaItemInfo_Value(MediaItem item, String parmname)
Get media item numerical-value attributes.
B_MUTE : bool * to muted state
B_LOOPSRC : bool * to loop source
B_ALLTAKESPLAY : bool * to all takes play
B_UISEL : bool * to ui selected
C_BEATATTACHMODE : char * to one char of beat attached mode, -1=def, 0=time, 1=allbeats, 2=beatsosonly
C_LOCK : char * to one char of lock flags (&1 is locked, currently)
D_VOL : double * of item volume (volume bar)
D_POSITION : double * of item position (seconds)
D_LENGTH : double * of item length (seconds)
D_SNAPOFFSET : double * of item snap offset (seconds)
D_FADEINLEN : double * of item fade in length (manual, seconds)
D_FADEOUTLEN : double * of item fade out length (manual, seconds)
D_FADEINDIR : double * of item fade in curve [-1; 1]
D_FADEOUTDIR : double * of item fade out curve [-1; 1]
D_FADEINLEN_AUTO : double * of item autofade in length (seconds, -1 for no autofade set)
D_FADEOUTLEN_AUTO : double * of item autofade out length (seconds, -1 for no autofade set)
C_FADEINSHAPE : int * to fadein shape, 0=linear, ...
C_FADEOUTSHAPE : int * to fadeout shape
I_GROUPID : int * to group ID (0 = no group)
I_LASTY : int * to last y position in track (readonly)
I_LASTH : int * to last height in track (readonly)
I_CUSTOMCOLOR : int * : custom color, OS dependent color|0x100000 (i.e. ColorToNative(r,g,b)|0x100000). If you do not |0x100000, then it will not be used (though will store the color anyway).
I_CURTAKE : int * to active take
IP_ITEMNUMBER : int, item number within the track (read-only, returns the item number directly)
F_FREEMODE_Y : float * to free mode y position (0..1)
F_FREEMODE_H : float * to free mode height (0..1)
P_TRACK : MediaTrack * (read only)
int GetMediaItemNumTakes(MediaItem* item)
int GetMediaItemNumTakes(MediaItem item)
integer reaper.GetMediaItemNumTakes(MediaItem item)
Int RPR_GetMediaItemNumTakes(MediaItem item)
MediaItem_Take* GetMediaItemTake(MediaItem* item, int tk)
MediaItem_Take GetMediaItemTake(MediaItem item, int tk)
MediaItem_Take reaper.GetMediaItemTake(MediaItem item, integer tk)
MediaItem_Take RPR_GetMediaItemTake(MediaItem item, Int tk)
MediaItem* GetMediaItemTake_Item(MediaItem_Take* take)
MediaItem GetMediaItemTake_Item(MediaItem_Take take)
MediaItem reaper.GetMediaItemTake_Item(MediaItem_Take take)
MediaItem RPR_GetMediaItemTake_Item(MediaItem_Take take)

Get parent item of media item take

int GetMediaItemTake_Peaks(MediaItem_Take* take, double peakrate, double starttime, int numchannels, int numsamplesperchannel, int want_extra_type, double* buf)
int GetMediaItemTake_Peaks(MediaItem_Take take, peakrate, starttime, int numchannels, int numsamplesperchannel, int want_extra_type, buffer_ptr buf)
integer reaper.GetMediaItemTake_Peaks(MediaItem_Take take, number peakrate, number starttime, integer numchannels, integer numsamplesperchannel, integer want_extra_type, reaper.array buf)
(Int retval, MediaItem_Take take, Float peakrate, Float starttime, Int numchannels, Int numsamplesperchannel, Int want_extra_type, Float buf) = RPR_GetMediaItemTake_Peaks(take, peakrate, starttime, numchannels, numsamplesperchannel, want_extra_type, buf)

Gets block of peak samples to buf. Note that the peak samples are interleaved, but in two or three blocks (maximums, then minimums, then extra). Return value has 20 bits of returned sample count, then 4 bits of output_mode (0xf00000), then a bit to signify whether extra_type was available (0x1000000). extra_type can be 115 ('s') for spectral information, which will return peak samples as integers with the low 15 bits frequency, next 14 bits tonality.

PCM_source* GetMediaItemTake_Source(MediaItem_Take* take)
PCM_source GetMediaItemTake_Source(MediaItem_Take take)
PCM_source reaper.GetMediaItemTake_Source(MediaItem_Take take)
PCM_source RPR_GetMediaItemTake_Source(MediaItem_Take take)

Get media source of media item take

MediaTrack* GetMediaItemTake_Track(MediaItem_Take* take)
MediaTrack GetMediaItemTake_Track(MediaItem_Take take)
MediaTrack reaper.GetMediaItemTake_Track(MediaItem_Take take)
MediaTrack RPR_GetMediaItemTake_Track(MediaItem_Take take)

Get parent track of media item take

MediaItem_Take* GetMediaItemTakeByGUID(ReaProject* project, const GUID* guid)
MediaItem_Take GetMediaItemTakeByGUID(ReaProject project, "guidGUID")
MediaItem_Take reaper.GetMediaItemTakeByGUID(ReaProject project, string guidGUID)
MediaItem_Take RPR_GetMediaItemTakeByGUID(ReaProject project, const GUID guid)
double GetMediaItemTakeInfo_Value(MediaItem_Take* take, const char* parmname)
double GetMediaItemTakeInfo_Value(MediaItem_Take take, "parmname")
number reaper.GetMediaItemTakeInfo_Value(MediaItem_Take take, string parmname)
Float RPR_GetMediaItemTakeInfo_Value(MediaItem_Take take, String parmname)
Get media item take numerical-value attributes.
D_STARTOFFS : double *, start offset in take of item
D_VOL : double *, take volume
D_PAN : double *, take pan
D_PANLAW : double *, take pan law (-1.0=default, 0.5=-6dB, 1.0=+0dB, etc)
D_PLAYRATE : double *, take playrate (1.0=normal, 2.0=doublespeed, etc)
D_PITCH : double *, take pitch adjust (in semitones, 0.0=normal, +12 = one octave up, etc)
B_PPITCH, bool *, preserve pitch when changing rate
I_CHANMODE, int *, channel mode (0=normal, 1=revstereo, 2=downmix, 3=l, 4=r)
I_PITCHMODE, int *, pitch shifter mode, -1=proj default, otherwise high word=shifter low word = parameter
I_CUSTOMCOLOR : int *, custom color, OS dependent color|0x100000 (i.e. ColorToNative(r,g,b)|0x100000). If you do not |0x100000, then it will not be used (though will store the color anyway).
IP_TAKENUMBER : int, take number within the item (read-only, returns the take number directly)
P_TRACK : pointer to MediaTrack (read-only)
P_ITEM : pointer to MediaItem (read-only)
P_SOURCE : PCM_source *. Note that if setting this, you should first retrieve the old source, set the new, THEN delete the old.
MediaTrack* GetMediaItemTrack(MediaItem* item)
MediaTrack GetMediaItemTrack(MediaItem item)
MediaTrack reaper.GetMediaItemTrack(MediaItem item)
MediaTrack RPR_GetMediaItemTrack(MediaItem item)
void GetMediaSourceFileName(PCM_source* source, char* filenamebuf, int filenamebuf_sz)
GetMediaSourceFileName(PCM_source source, #filenamebuf)
string filenamebuf = reaper.GetMediaSourceFileName(PCM_source source, string filenamebuf)
(PCM_source source, String filenamebuf, Int filenamebuf_sz) = RPR_GetMediaSourceFileName(source, filenamebuf, filenamebuf_sz)

Copies the media source filename to typebuf. Note that in-project MIDI media sources have no associated filename. See GetMediaSourceParent.

double GetMediaSourceLength(PCM_source* source, bool* lengthIsQNOut)
double GetMediaSourceLength(PCM_source source, bool &lengthIsQN)
number retval, boolean lengthIsQN = reaper.GetMediaSourceLength(PCM_source source)
(Float retval, PCM_source source, Boolean lengthIsQNOut) = RPR_GetMediaSourceLength(source, lengthIsQNOut)

Returns the length of the source media. If the media source is beat-based, the length will be in quarter notes, otherwise it will be in seconds.

int GetMediaSourceNumChannels(PCM_source* source)
int GetMediaSourceNumChannels(PCM_source source)
integer reaper.GetMediaSourceNumChannels(PCM_source source)
Int RPR_GetMediaSourceNumChannels(PCM_source source)

Returns the number of channels in the source media.

PCM_source* GetMediaSourceParent(PCM_source* src)
PCM_source GetMediaSourceParent(PCM_source src)
PCM_source reaper.GetMediaSourceParent(PCM_source src)
PCM_source RPR_GetMediaSourceParent(PCM_source src)

Returns the parent source, or NULL if src is the root source. This can be used to retrieve the parent properties of sections or reversed sources for example.

int GetMediaSourceSampleRate(PCM_source* source)
int GetMediaSourceSampleRate(PCM_source source)
integer reaper.GetMediaSourceSampleRate(PCM_source source)
Int RPR_GetMediaSourceSampleRate(PCM_source source)

Returns the sample rate. MIDI source media will return zero.

void GetMediaSourceType(PCM_source* source, char* typebuf, int typebuf_sz)
GetMediaSourceType(PCM_source source, #typebuf)
string typebuf = reaper.GetMediaSourceType(PCM_source source, string typebuf)
(PCM_source source, String typebuf, Int typebuf_sz) = RPR_GetMediaSourceType(source, typebuf, typebuf_sz)

copies the media source type ("WAV", "MIDI", etc) to typebuf

double GetMediaTrackInfo_Value(MediaTrack* tr, const char* parmname)
double GetMediaTrackInfo_Value(MediaTrack tr, "parmname")
number reaper.GetMediaTrackInfo_Value(MediaTrack tr, string parmname)
Float RPR_GetMediaTrackInfo_Value(MediaTrack tr, String parmname)
Get track numerical-value attributes.
B_MUTE : bool * : mute flag
B_PHASE : bool * : invert track phase
IP_TRACKNUMBER : int : track number (returns zero if not found, -1 for master track) (read-only, returns the int directly)
I_SOLO : int * : 0=not soloed, 1=solo, 2=soloed in place. also: 5=solo-safe solo, 6=solo-safe soloed in place
I_FXEN : int * : 0=fx bypassed, nonzero = fx active
I_RECARM : int * : 0=not record armed, 1=record armed
I_RECINPUT : int * : record input. <0 = no input, 0..n = mono hardware input, 512+n = rearoute input, 1024 set for stereo input pair. 4096 set for MIDI input, if set, then low 5 bits represent channel (0=all, 1-16=only chan), then next 6 bits represent physical input (63=all, 62=VKB)
I_RECMODE : int * : record mode (0=input, 1=stereo out, 2=none, 3=stereo out w/latcomp, 4=midi output, 5=mono out, 6=mono out w/ lat comp, 7=midi overdub, 8=midi replace
I_RECMON : int * : record monitor (0=off, 1=normal, 2=not when playing (tapestyle))
I_RECMONITEMS : int * : monitor items while recording (0=off, 1=on)
I_AUTOMODE : int * : track automation mode (0=trim/off, 1=read, 2=touch, 3=write, 4=latch)
I_NCHAN : int * : number of track channels, must be 2-64, even
I_SELECTED : int * : track selected? 0 or 1
I_WNDH : int * : current TCP window height (Read-only)
I_FOLDERDEPTH : int * : folder depth change (0=normal, 1=track is a folder parent, -1=track is the last in the innermost folder, -2=track is the last in the innermost and next-innermost folders, etc
I_FOLDERCOMPACT : int * : folder compacting (only valid on folders), 0=normal, 1=small, 2=tiny children
I_MIDIHWOUT : int * : track midi hardware output index (<0 for disabled, low 5 bits are which channels (0=all, 1-16), next 5 bits are output device index (0-31))
I_PERFFLAGS : int * : track perf flags (&1=no media buffering, &2=no anticipative FX)
I_CUSTOMCOLOR : int * : custom color, OS dependent color|0x100000 (i.e. ColorToNative(r,g,b)|0x100000). If you do not |0x100000, then it will not be used (though will store the color anyway).
I_HEIGHTOVERRIDE : int * : custom height override for TCP window. 0 for none, otherwise size in pixels
B_HEIGHTLOCK : bool * : track height lock (must set I_HEIGHTOVERRIDE before locking)
D_VOL : double * : trim volume of track (0 (-inf)..1 (+0dB) .. 2 (+6dB) etc ..)
D_PAN : double * : trim pan of track (-1..1)
D_WIDTH : double * : width of track (-1..1)
D_DUALPANL : double * : dualpan position 1 (-1..1), only if I_PANMODE==6
D_DUALPANR : double * : dualpan position 2 (-1..1), only if I_PANMODE==6
I_PANMODE : int * : pan mode (0 = classic 3.x, 3=new balance, 5=stereo pan, 6 = dual pan)
D_PANLAW : double * : pan law of track. <0 for project default, 1.0 for +0dB, etc
P_ENV : read only, returns TrackEnvelope *, setNewValue=<VOLENV, <PANENV, etc
B_SHOWINMIXER : bool * : show track panel in mixer -- do not use on master
B_SHOWINTCP : bool * : show track panel in tcp -- do not use on master
B_MAINSEND : bool * : track sends audio to parent
C_MAINSEND_OFFS : char * : track send to parent channel offset
B_FREEMODE : bool * : track free-mode enabled (requires UpdateTimeline() after changing etc)
C_BEATATTACHMODE : char * : char * to one char of beat attached mode, -1=def, 0=time, 1=allbeats, 2=beatsposonly
F_MCP_FXSEND_SCALE : float * : scale of fx+send area in MCP (0.0=smallest allowed, 1=max allowed)
F_MCP_SENDRGN_SCALE : float * : scale of send area as proportion of the fx+send total area (0=min allow, 1=max)
P_PARTRACK : MediaTrack * : parent track (read-only)
P_PROJECT : ReaProject * : parent project (read-only)
bool GetMIDIInputName(int dev, char* nameout, int nameout_sz)
bool GetMIDIInputName(int dev, #nameout)
boolean retval, string nameout = reaper.GetMIDIInputName(integer dev, string nameout)
(Boolean retval, Int dev, String nameout, Int nameout_sz) = RPR_GetMIDIInputName(dev, nameout, nameout_sz)

returns true if device present

bool GetMIDIOutputName(int dev, char* nameout, int nameout_sz)
bool GetMIDIOutputName(int dev, #nameout)
boolean retval, string nameout = reaper.GetMIDIOutputName(integer dev, string nameout)
(Boolean retval, Int dev, String nameout, Int nameout_sz) = RPR_GetMIDIOutputName(dev, nameout, nameout_sz)

returns true if device present

MediaTrack* GetMixerScroll()
MediaTrack GetMixerScroll()
MediaTrack reaper.GetMixerScroll()
MediaTrack RPR_GetMixerScroll()

Get the leftmost track visible in the mixer

void GetMouseModifier(const char* context, int modifier_flag, char* action, int action_sz)
GetMouseModifier("context", int modifier_flag, #action)
string action = reaper.GetMouseModifier(string context, integer modifier_flag, string action)
(String context, Int modifier_flag, String action, Int action_sz) = RPR_GetMouseModifier(context, modifier_flag, action, action_sz)
Get the current mouse modifier assignment for a specific modifier key assignment, in a specific context.
action will be filled in with the command ID number for a built-in mouse modifier
or built-in REAPER command ID, or the custom action ID string.
See SetMouseModifier for more information.
void GetMousePosition(int* xOut, int* yOut)
GetMousePosition(int &x, int &y)
number x, number y = reaper.GetMousePosition()
(Int xOut, Int yOut) = RPR_GetMousePosition(xOut, yOut)

get mouse position in screen coordinates

int GetNumAudioInputs()
int GetNumAudioInputs()
integer reaper.GetNumAudioInputs()
Int RPR_GetNumAudioInputs()

Return number of normal audio hardware inputs available

int GetNumAudioOutputs()
int GetNumAudioOutputs()
integer reaper.GetNumAudioOutputs()
Int RPR_GetNumAudioOutputs()

Return number of normal audio hardware outputs available

int GetNumMIDIInputs()
int GetNumMIDIInputs()
integer reaper.GetNumMIDIInputs()
Int RPR_GetNumMIDIInputs()

returns max number of real midi hardware inputs

int GetNumMIDIOutputs()
int GetNumMIDIOutputs()
integer reaper.GetNumMIDIOutputs()
Int RPR_GetNumMIDIOutputs()

returns max number of real midi hardware outputs

int GetNumTracks()
int GetNumTracks()
integer reaper.GetNumTracks()
Int RPR_GetNumTracks()
const char* GetOS()
bool GetOS(#retval)
string reaper.GetOS()
String RPR_GetOS()

Returns "Win32", "Win64", "OSX32", "OSX64", or "Other".

const char* GetOutputChannelName(int channelIndex)
bool GetOutputChannelName(#retval, int channelIndex)
string reaper.GetOutputChannelName(integer channelIndex)
String RPR_GetOutputChannelName(Int channelIndex)
double GetOutputLatency()
double GetOutputLatency()
number reaper.GetOutputLatency()
Float RPR_GetOutputLatency()

returns output latency in seconds

MediaTrack* GetParentTrack(MediaTrack* track)
MediaTrack GetParentTrack(MediaTrack track)
MediaTrack reaper.GetParentTrack(MediaTrack track)
MediaTrack RPR_GetParentTrack(MediaTrack track)
void GetPeakFileName(const char* fn, char* buf, int buf_sz)
GetPeakFileName("fn", #buf)
string buf = reaper.GetPeakFileName(string fn, string buf)
(String fn, String buf, Int buf_sz) = RPR_GetPeakFileName(fn, buf, buf_sz)

get the peak file name for a given file (can be either filename.reapeaks,or a hashed filename in another path)

void GetPeakFileNameEx(const char* fn, char* buf, int buf_sz, bool forWrite)
GetPeakFileNameEx("fn", #buf, bool forWrite)
string buf = reaper.GetPeakFileNameEx(string fn, string buf, boolean forWrite)
(String fn, String buf, Int buf_sz, Boolean forWrite) = RPR_GetPeakFileNameEx(fn, buf, buf_sz, forWrite)

get the peak file name for a given file (can be either filename.reapeaks,or a hashed filename in another path)

void GetPeakFileNameEx2(const char* fn, char* buf, int buf_sz, bool forWrite, const char* peaksfileextension)
GetPeakFileNameEx2("fn", #buf, bool forWrite, "peaksfileextension")
string buf = reaper.GetPeakFileNameEx2(string fn, string buf, boolean forWrite, string peaksfileextension)
(String fn, String buf, Int buf_sz, Boolean forWrite, String peaksfileextension) = RPR_GetPeakFileNameEx2(fn, buf, buf_sz, forWrite, peaksfileextension)

Like GetPeakFileNameEx, but you can specify peaksfileextension such as ".reapeaks"

double GetPlayPosition()
double GetPlayPosition()
number reaper.GetPlayPosition()
Float RPR_GetPlayPosition()

returns latency-compensated actual-what-you-hear position

double GetPlayPosition2()
double GetPlayPosition2()
number reaper.GetPlayPosition2()
Float RPR_GetPlayPosition2()

returns position of next audio block being processed

double GetPlayPosition2Ex(ReaProject* proj)
double GetPlayPosition2Ex(ReaProject proj)
number reaper.GetPlayPosition2Ex(ReaProject proj)
Float RPR_GetPlayPosition2Ex(ReaProject proj)

returns position of next audio block being processed

double GetPlayPositionEx(ReaProject* proj)
double GetPlayPositionEx(ReaProject proj)
number reaper.GetPlayPositionEx(ReaProject proj)
Float RPR_GetPlayPositionEx(ReaProject proj)

returns latency-compensated actual-what-you-hear position

int GetPlayState()
int GetPlayState()
integer reaper.GetPlayState()
Int RPR_GetPlayState()

&1=playing,&2=pause,&=4 is recording

int GetPlayStateEx(ReaProject* proj)
int GetPlayStateEx(ReaProject proj)
integer reaper.GetPlayStateEx(ReaProject proj)
Int RPR_GetPlayStateEx(ReaProject proj)

&1=playing,&2=pause,&=4 is recording

double GetProjectLength(ReaProject* proj)
double GetProjectLength(ReaProject proj)
number reaper.GetProjectLength(ReaProject proj)
Float RPR_GetProjectLength(ReaProject proj)

returns length of project (maximum of end of media item, markers, end of regions, tempo map

void GetProjectName(ReaProject* proj, char* buf, int buf_sz)
GetProjectName(ReaProject proj, #buf)
string buf = reaper.GetProjectName(ReaProject proj, string buf)
(ReaProject proj, String buf, Int buf_sz) = RPR_GetProjectName(proj, buf, buf_sz)
void GetProjectPath(char* buf, int buf_sz)
GetProjectPath(#buf)
string buf = reaper.GetProjectPath(string buf)
(String buf, Int buf_sz) = RPR_GetProjectPath(buf, buf_sz)
void GetProjectPathEx(ReaProject* proj, char* buf, int buf_sz)
GetProjectPathEx(ReaProject proj, #buf)
string buf = reaper.GetProjectPathEx(ReaProject proj, string buf)
(ReaProject proj, String buf, Int buf_sz) = RPR_GetProjectPathEx(proj, buf, buf_sz)
int GetProjectStateChangeCount(ReaProject* proj)
int GetProjectStateChangeCount(ReaProject proj)
integer reaper.GetProjectStateChangeCount(ReaProject proj)
Int RPR_GetProjectStateChangeCount(ReaProject proj)

returns an integer that changes when the project state changes

double GetProjectTimeOffset(ReaProject* proj, bool rndframe)
double GetProjectTimeOffset(ReaProject proj, bool rndframe)
number reaper.GetProjectTimeOffset(ReaProject proj, boolean rndframe)
Float RPR_GetProjectTimeOffset(ReaProject proj, Boolean rndframe)

Gets project time offset in seconds (project settings - project start time). If rndframe is true, the offset is rounded to a multiple of the project frame size.

void GetProjectTimeSignature(double* bpmOut, double* bpiOut)
GetProjectTimeSignature(&bpm, &bpi)
number bpm, number bpi = reaper.GetProjectTimeSignature()
(Float bpmOut, Float bpiOut) = RPR_GetProjectTimeSignature(bpmOut, bpiOut)

deprecated

void GetProjectTimeSignature2(ReaProject* proj, double* bpmOut, double* bpiOut)
GetProjectTimeSignature2(ReaProject proj, &bpm, &bpi)
number bpm, number bpi = reaper.GetProjectTimeSignature2(ReaProject proj)
(ReaProject proj, Float bpmOut, Float bpiOut) = RPR_GetProjectTimeSignature2(proj, bpmOut, bpiOut)
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.

int GetProjExtState(ReaProject* proj, const char* extname, const char* key, char* valOutNeedBig, int valOutNeedBig_sz)
int GetProjExtState(ReaProject proj, "extname", "key", #val)
integer retval, string val = reaper.GetProjExtState(ReaProject proj, string extname, string key)
(Int retval, ReaProject proj, String extname, String key, String valOutNeedBig, Int valOutNeedBig_sz) = RPR_GetProjExtState(proj, extname, key, valOutNeedBig, valOutNeedBig_sz)

Get the value previously associated with this extname and key, the last time the project was saved. See SetProjExtState, EnumProjExtState.

const char* GetResourcePath()
bool GetResourcePath(#retval)
string reaper.GetResourcePath()
String RPR_GetResourcePath()

returns path where ini files are stored, other things are in subdirectories.

TrackEnvelope* GetSelectedEnvelope(ReaProject* proj)
TrackEnvelope GetSelectedEnvelope(ReaProject proj)
TrackEnvelope reaper.GetSelectedEnvelope(ReaProject proj)
TrackEnvelope RPR_GetSelectedEnvelope(ReaProject proj)

get the currently selected envelope, returns 0 if no envelope is selected

MediaItem* GetSelectedMediaItem(ReaProject* proj, int selitem)
MediaItem GetSelectedMediaItem(ReaProject proj, int selitem)
MediaItem reaper.GetSelectedMediaItem(ReaProject proj, integer selitem)
MediaItem RPR_GetSelectedMediaItem(ReaProject proj, Int selitem)

get a selected item by selected item count (zero-based) (proj=0 for active project)

MediaTrack* GetSelectedTrack(ReaProject* proj, int seltrackidx)
MediaTrack GetSelectedTrack(ReaProject proj, int seltrackidx)
MediaTrack reaper.GetSelectedTrack(ReaProject proj, integer seltrackidx)
MediaTrack RPR_GetSelectedTrack(ReaProject proj, Int seltrackidx)

Get a selected track from a project (proj=0 for active project) by selected track count (zero-based). This function ignores the master track, see GetSelectedTrack2.

MediaTrack* GetSelectedTrack2(ReaProject* proj, int seltrackidx, bool wantmaster)
MediaTrack GetSelectedTrack2(ReaProject proj, int seltrackidx, bool wantmaster)
MediaTrack reaper.GetSelectedTrack2(ReaProject proj, integer seltrackidx, boolean wantmaster)
MediaTrack RPR_GetSelectedTrack2(ReaProject proj, Int seltrackidx, Boolean wantmaster)

Get a selected track from a project (proj=0 for active project) by selected track count (zero-based).

TrackEnvelope* GetSelectedTrackEnvelope(ReaProject* proj)
TrackEnvelope GetSelectedTrackEnvelope(ReaProject proj)
TrackEnvelope reaper.GetSelectedTrackEnvelope(ReaProject proj)
TrackEnvelope RPR_GetSelectedTrackEnvelope(ReaProject proj)

get the currently selected track envelope, returns 0 if no envelope is selected

void GetSet_ArrangeView2(ReaProject* proj, bool isSet, int screen_x_start, int screen_x_end, double* start_timeOut, double* end_timeOut)
GetSet_ArrangeView2(ReaProject proj, bool isSet, int screen_x_start, int screen_x_end, &start_time, &end_time)
number start_time, number end_time = reaper.GetSet_ArrangeView2(ReaProject proj, boolean isSet, integer screen_x_start, integer screen_x_end)
(ReaProject proj, Boolean isSet, Int screen_x_start, Int screen_x_end, Float start_timeOut, Float end_timeOut) = RPR_GetSet_ArrangeView2(proj, isSet, screen_x_start, screen_x_end, start_timeOut, end_timeOut)

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

void GetSet_LoopTimeRange(bool isSet, bool isLoop, double* startOut, double* endOut, bool allowautoseek)
GetSet_LoopTimeRange(bool isSet, bool isLoop, &start, &end, bool allowautoseek)
number start, number end = reaper.GetSet_LoopTimeRange(boolean isSet, boolean isLoop, number start, number end, boolean allowautoseek)
(Boolean isSet, Boolean isLoop, Float startOut, Float endOut, Boolean allowautoseek) = RPR_GetSet_LoopTimeRange(isSet, isLoop, startOut, endOut, allowautoseek)
void GetSet_LoopTimeRange2(ReaProject* proj, bool isSet, bool isLoop, double* startOut, double* endOut, bool allowautoseek)
GetSet_LoopTimeRange2(ReaProject proj, bool isSet, bool isLoop, &start, &end, bool allowautoseek)
number start, number end = reaper.GetSet_LoopTimeRange2(ReaProject proj, boolean isSet, boolean isLoop, number start, number end, boolean allowautoseek)
(ReaProject proj, Boolean isSet, Boolean isLoop, Float startOut, Float endOut, Boolean allowautoseek) = RPR_GetSet_LoopTimeRange2(proj, isSet, isLoop, startOut, endOut, allowautoseek)
double GetSetAutomationItemInfo(TrackEnvelope* env, int autoitem_idx, const char* desc, double value, bool is_set)
double GetSetAutomationItemInfo(TrackEnvelope env, int autoitem_idx, "desc", value, bool is_set)
number reaper.GetSetAutomationItemInfo(TrackEnvelope env, integer autoitem_idx, string desc, number value, boolean is_set)
Float RPR_GetSetAutomationItemInfo(TrackEnvelope env, Int autoitem_idx, String desc, Float value, Boolean is_set)
Get or set automation item information. autoitem_idx==0 for the first automation item on an envelope, 1 for the second item, etc. desc can be any of the following:
D_POOL_ID: double *, automation item pool ID (as an integer); edits are propagated to all other automation items that share a pool ID
D_POSITION: double *, automation item timeline position in seconds
D_LENGTH: double *, automation item length in seconds
D_STARTOFFS: double *, automation item start offset in seconds
D_PLAYRATE: double *, automation item playback rate
D_BASELINE: double *, automation item baseline value in the range [0,1]
D_AMPLITUDE: double *, automation item amplitude in the range [-1,1]
D_LOOPSRC: double *, nonzero if the automation item contents are looped
D_UISEL: double *, nonzero if the automation item is selected in the arrange view
bool GetSetEnvelopeState(TrackEnvelope* env, char* str, int str_sz)
bool GetSetEnvelopeState(TrackEnvelope env, #str)
boolean retval, string str = reaper.GetSetEnvelopeState(TrackEnvelope env, string str)
(Boolean retval, TrackEnvelope env, String str, Int str_sz) = RPR_GetSetEnvelopeState(env, str, str_sz)

deprecated -- see SetEnvelopeStateChunk, GetEnvelopeStateChunk

bool GetSetEnvelopeState2(TrackEnvelope* env, char* str, int str_sz, bool isundo)
bool GetSetEnvelopeState2(TrackEnvelope env, #str, bool isundo)
boolean retval, string str = reaper.GetSetEnvelopeState2(TrackEnvelope env, string str, boolean isundo)
(Boolean retval, TrackEnvelope env, String str, Int str_sz, Boolean isundo) = RPR_GetSetEnvelopeState2(env, str, str_sz, isundo)

deprecated -- see SetEnvelopeStateChunk, GetEnvelopeStateChunk

bool GetSetItemState(MediaItem* item, char* str, int str_sz)
bool GetSetItemState(MediaItem item, #str)
boolean retval, string str = reaper.GetSetItemState(MediaItem item, string str)
(Boolean retval, MediaItem item, String str, Int str_sz) = RPR_GetSetItemState(item, str, str_sz)

deprecated -- see SetItemStateChunk, GetItemStateChunk

bool GetSetItemState2(MediaItem* item, char* str, int str_sz, bool isundo)
bool GetSetItemState2(MediaItem item, #str, bool isundo)
boolean retval, string str = reaper.GetSetItemState2(MediaItem item, string str, boolean isundo)
(Boolean retval, MediaItem item, String str, Int str_sz, Boolean isundo) = RPR_GetSetItemState2(item, str, str_sz, isundo)

deprecated -- see SetItemStateChunk, GetItemStateChunk

bool GetSetMediaItemInfo_String(MediaItem* item, const char* parmname, char* stringNeedBig, bool setNewValue)
bool GetSetMediaItemInfo_String(MediaItem item, "parmname", #stringNeedBig, bool setNewValue)
boolean retval, string stringNeedBig = reaper.GetSetMediaItemInfo_String(MediaItem item, string parmname, string stringNeedBig, boolean setNewValue)
(Boolean retval, MediaItem item, String parmname, String stringNeedBig, Boolean setNewValue) = RPR_GetSetMediaItemInfo_String(item, parmname, stringNeedBig, setNewValue)
Gets/sets an item attribute string:
P_NOTES : char * : item note text (do not write to returned pointer, use setNewValue to update)
GUID : GUID * : 16-byte GUID, can query or update. If using a _String() function, GUID is a string {xyz-...}.
bool GetSetMediaItemTakeInfo_String(MediaItem_Take* tk, const char* parmname, char* stringNeedBig, bool setNewValue)
bool GetSetMediaItemTakeInfo_String(MediaItem_Take tk, "parmname", #stringNeedBig, bool setNewValue)
boolean retval, string stringNeedBig = reaper.GetSetMediaItemTakeInfo_String(MediaItem_Take tk, string parmname, string stringNeedBig, boolean setNewValue)
(Boolean retval, MediaItem_Take tk, String parmname, String stringNeedBig, Boolean setNewValue) = RPR_GetSetMediaItemTakeInfo_String(tk, parmname, stringNeedBig, setNewValue)
Gets/sets a take attribute string:
P_NAME : char * to take name
GUID : GUID * : 16-byte GUID, can query or update. If using a _String() function, GUID is a string {xyz-...}.
bool GetSetMediaTrackInfo_String(MediaTrack* tr, const char* parmname, char* stringNeedBig, bool setNewValue)
bool GetSetMediaTrackInfo_String(MediaTrack tr, "parmname", #stringNeedBig, bool setNewValue)
boolean retval, string stringNeedBig = reaper.GetSetMediaTrackInfo_String(MediaTrack tr, string parmname, string stringNeedBig, boolean setNewValue)
(Boolean retval, MediaTrack tr, String parmname, String stringNeedBig, Boolean setNewValue) = RPR_GetSetMediaTrackInfo_String(tr, parmname, stringNeedBig, setNewValue)
Get or set track string attributes.
P_NAME : char * : track name (on master returns NULL)
P_ICON : const char * : track icon (full filename, or relative to resource_path/data/track_icons)
P_MCP_LAYOUT : const char * : layout name
P_TCP_LAYOUT : const char * : layout name
GUID : GUID * : 16-byte GUID, can query or update. If using a _String() function, GUID is a string {xyz-...}.
void GetSetProjectAuthor(ReaProject* proj, bool set, char* author, int author_sz)
GetSetProjectAuthor(ReaProject proj, bool set, #author)
string author = reaper.GetSetProjectAuthor(ReaProject proj, boolean set, string author)
(ReaProject proj, Boolean set, String author, Int author_sz) = RPR_GetSetProjectAuthor(proj, set, author, author_sz)

gets or sets project author, author_sz is ignored when setting

int GetSetProjectGrid(ReaProject* project, bool set, double* divisionInOutOptional, int* swingmodeInOutOptional, double* swingamtInOutOptional)
int GetSetProjectGrid(ReaProject project, bool set, optional &divisionIn, optional int &swingmodeIn, optional &swingamtIn)
integer retval, optional number divisionIn, optional number swingmodeIn, optional number swingamtIn = reaper.GetSetProjectGrid(ReaProject project, boolean set)
(Int retval, ReaProject project, Boolean set, Float divisionInOutOptional, Int swingmodeInOutOptional, Float swingamtInOutOptional) = RPR_GetSetProjectGrid(project, set, divisionInOutOptional, swingmodeInOutOptional, swingamtInOutOptional)

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. Returns grid configuration flags

void GetSetProjectNotes(ReaProject* proj, bool set, char* notesNeedBig, int notesNeedBig_sz)
GetSetProjectNotes(ReaProject proj, bool set, #notes)
string notes = reaper.GetSetProjectNotes(ReaProject proj, boolean set, string notes)
(ReaProject proj, Boolean set, String notesNeedBig, Int notesNeedBig_sz) = RPR_GetSetProjectNotes(proj, set, notesNeedBig, notesNeedBig_sz)

gets or sets project notes, notesNeedBig_sz is ignored when setting

int GetSetRepeat(int val)
int GetSetRepeat(int val)
integer reaper.GetSetRepeat(integer val)
Int RPR_GetSetRepeat(Int val)

-1 == query,0=clear,1=set,>1=toggle . returns new value

int GetSetRepeatEx(ReaProject* proj, int val)
int GetSetRepeatEx(ReaProject proj, int val)
integer reaper.GetSetRepeatEx(ReaProject proj, integer val)
Int RPR_GetSetRepeatEx(ReaProject proj, Int val)

-1 == query,0=clear,1=set,>1=toggle . returns new value

unsigned int GetSetTrackGroupMembership(MediaTrack* tr, const char* groupname, unsigned int setmask, unsigned int setvalue)
uint GetSetTrackGroupMembership(MediaTrack tr, "groupname", uint setmask, uint setvalue)
integer reaper.GetSetTrackGroupMembership(MediaTrack tr, string groupname, integer setmask, integer setvalue)
Unknown RPR_GetSetTrackGroupMembership(MediaTrack tr, String groupname, Unknown setmask, Unknown setvalue)
Gets or modifies the group membership for a track. Returns group state prior to call (each bit represents one of the 32 group numbers). if setmask has bits set, those bits in setvalue will be applied to group. Group can be one of:
VOLUME_MASTER
VOLUME_SLAVE
VOLUME_VCA_MASTER
VOLUME_VCA_SLAVE
PAN_MASTER
PAN_SLAVE
WIDTH_MASTER
WIDTH_SLAVE
MUTE_MASTER
MUTE_SLAVE
SOLO_MASTER
SOLO_SLAVE
RECARM_MASTER
RECARM_SLAVE
POLARITY_MASTER
POLARITY_SLAVE
AUTOMODE_MASTER
AUTOMODE_SLAVE
VOLUME_REVERSE
PAN_REVERSE
WIDTH_REVERSE
NO_MASTER_WHEN_SLAVE
VOLUME_VCA_SLAVE_ISPREFX
unsigned int GetSetTrackGroupMembershipHigh(MediaTrack* tr, const char* groupname, unsigned int setmask, unsigned int setvalue)
uint GetSetTrackGroupMembershipHigh(MediaTrack tr, "groupname", uint setmask, uint setvalue)
integer reaper.GetSetTrackGroupMembershipHigh(MediaTrack tr, string groupname, integer setmask, integer setvalue)
Unknown RPR_GetSetTrackGroupMembershipHigh(MediaTrack tr, String groupname, Unknown setmask, Unknown setvalue)
Gets or modifies the group membership for a track. Returns group state prior to call (each bit represents one of the high 32 group numbers). if setmask has bits set, those bits in setvalue will be applied to group. Group can be one of:
VOLUME_MASTER
VOLUME_SLAVE
VOLUME_VCA_MASTER
VOLUME_VCA_SLAVE
PAN_MASTER
PAN_SLAVE
WIDTH_MASTER
WIDTH_SLAVE
MUTE_MASTER
MUTE_SLAVE
SOLO_MASTER
SOLO_SLAVE
RECARM_MASTER
RECARM_SLAVE
POLARITY_MASTER
POLARITY_SLAVE
AUTOMODE_MASTER
AUTOMODE_SLAVE
VOLUME_REVERSE
PAN_REVERSE
WIDTH_REVERSE
NO_MASTER_WHEN_SLAVE
VOLUME_VCA_SLAVE_ISPREFX
bool GetSetTrackState(MediaTrack* track, char* str, int str_sz)
bool GetSetTrackState(MediaTrack track, #str)
boolean retval, string str = reaper.GetSetTrackState(MediaTrack track, string str)
(Boolean retval, MediaTrack track, String str, Int str_sz) = RPR_GetSetTrackState(track, str, str_sz)

deprecated -- see SetTrackStateChunk, GetTrackStateChunk

bool GetSetTrackState2(MediaTrack* track, char* str, int str_sz, bool isundo)
bool GetSetTrackState2(MediaTrack track, #str, bool isundo)
boolean retval, string str = reaper.GetSetTrackState2(MediaTrack track, string str, boolean isundo)
(Boolean retval, MediaTrack track, String str, Int str_sz, Boolean isundo) = RPR_GetSetTrackState2(track, str, str_sz, isundo)

deprecated -- see SetTrackStateChunk, GetTrackStateChunk

ReaProject* GetSubProjectFromSource(PCM_source* src)
ReaProject GetSubProjectFromSource(PCM_source src)
ReaProject reaper.GetSubProjectFromSource(PCM_source src)
ReaProject RPR_GetSubProjectFromSource(PCM_source src)
MediaItem_Take* GetTake(MediaItem* item, int takeidx)
MediaItem_Take GetTake(MediaItem item, int takeidx)
MediaItem_Take reaper.GetTake(MediaItem item, integer takeidx)
MediaItem_Take RPR_GetTake(MediaItem item, Int takeidx)

get a take from an item by take count (zero-based)

TrackEnvelope* GetTakeEnvelope(MediaItem_Take* take, int envidx)
TrackEnvelope GetTakeEnvelope(MediaItem_Take take, int envidx)
TrackEnvelope reaper.GetTakeEnvelope(MediaItem_Take take, integer envidx)
TrackEnvelope RPR_GetTakeEnvelope(MediaItem_Take take, Int envidx)
TrackEnvelope* GetTakeEnvelopeByName(MediaItem_Take* take, const char* envname)
TrackEnvelope GetTakeEnvelopeByName(MediaItem_Take take, "envname")
TrackEnvelope reaper.GetTakeEnvelopeByName(MediaItem_Take take, string envname)
TrackEnvelope RPR_GetTakeEnvelopeByName(MediaItem_Take take, String envname)
const char* GetTakeName(MediaItem_Take* take)
bool GetTakeName(#retval, MediaItem_Take take)
string reaper.GetTakeName(MediaItem_Take take)
String RPR_GetTakeName(MediaItem_Take take)

returns NULL if the take is not valid

int GetTakeNumStretchMarkers(MediaItem_Take* take)
int GetTakeNumStretchMarkers(MediaItem_Take take)
integer reaper.GetTakeNumStretchMarkers(MediaItem_Take take)
Int RPR_GetTakeNumStretchMarkers(MediaItem_Take take)

Returns number of stretch markers in take

int GetTakeStretchMarker(MediaItem_Take* take, int idx, double* posOut, double* srcposOutOptional)
int GetTakeStretchMarker(MediaItem_Take take, int idx, &pos, optional &srcpos)
integer retval, number pos, optional number srcpos = reaper.GetTakeStretchMarker(MediaItem_Take take, integer idx)
(Int retval, MediaItem_Take take, Int idx, Float posOut, Float srcposOutOptional) = RPR_GetTakeStretchMarker(take, idx, posOut, srcposOutOptional)

Gets information on a stretch marker, idx is 0..n. Returns false if stretch marker not valid. posOut will be set to position in item, srcposOutOptional will be set to source media position. Returns index. if input index is -1, next marker is found using position (or source position if position is -1). If position/source position are used to find marker position, their values are not updated.

double GetTakeStretchMarkerSlope(MediaItem_Take* take, int idx)
double GetTakeStretchMarkerSlope(MediaItem_Take take, int idx)
number reaper.GetTakeStretchMarkerSlope(MediaItem_Take take, integer idx)
Float RPR_GetTakeStretchMarkerSlope(MediaItem_Take take, Int idx)

See SetTakeStretchMarkerSlope

bool GetTCPFXParm(ReaProject* project, MediaTrack* track, int index, int* fxindexOut, int* parmidxOut)
bool GetTCPFXParm(ReaProject project, MediaTrack track, int index, int &fxindex, int &parmidx)
boolean retval, number fxindex, number parmidx = reaper.GetTCPFXParm(ReaProject project, MediaTrack track, integer index)
(Boolean retval, ReaProject project, MediaTrack track, Int index, Int fxindexOut, Int parmidxOut) = RPR_GetTCPFXParm(project, track, index, fxindexOut, parmidxOut)

Get information about a specific FX parameter knob (see CountTCPFXParms).

bool GetTempoMatchPlayRate(PCM_source* source, double srcscale, double position, double mult, double* rateOut, double* targetlenOut)
bool GetTempoMatchPlayRate(PCM_source source, srcscale, position, mult, &rate, &targetlen)
boolean retval, number rate, number targetlen = reaper.GetTempoMatchPlayRate(PCM_source source, number srcscale, number position, number mult)
(Boolean retval, PCM_source source, Float srcscale, Float position, Float mult, Float rateOut, Float targetlenOut) = RPR_GetTempoMatchPlayRate(source, srcscale, position, mult, rateOut, targetlenOut)

finds the playrate and target length to insert this item stretched to a round power-of-2 number of bars, between 1/8 and 256

bool GetTempoTimeSigMarker(ReaProject* proj, int ptidx, double* timeposOut, int* measureposOut, double* beatposOut, double* bpmOut, int* timesig_numOut, int* timesig_denomOut, bool* lineartempoOut)
bool GetTempoTimeSigMarker(ReaProject proj, int ptidx, &timepos, int &measurepos, &beatpos, &bpm, int &timesig_num, int &timesig_denom, bool &lineartempo)
boolean retval, number timepos, number measurepos, number beatpos, number bpm, number timesig_num, number timesig_denom, boolean lineartempo = reaper.GetTempoTimeSigMarker(ReaProject proj, integer ptidx)
(Boolean retval, ReaProject proj, Int ptidx, Float timeposOut, Int measureposOut, Float beatposOut, Float bpmOut, Int timesig_numOut, Int timesig_denomOut, Boolean lineartempoOut) = RPR_GetTempoTimeSigMarker(proj, ptidx, timeposOut, measureposOut, beatposOut, bpmOut, timesig_numOut, timesig_denomOut, lineartempoOut)

Get information about a tempo/time signature marker. See CountTempoTimeSigMarkers, SetTempoTimeSigMarker, AddTempoTimeSigMarker.

int GetToggleCommandState(int command_id)
int GetToggleCommandState(int command_id)
integer reaper.GetToggleCommandState(integer command_id)
Int RPR_GetToggleCommandState(Int command_id)

See GetToggleCommandStateEx.

int GetToggleCommandStateEx(int section_id, int command_id)
int GetToggleCommandStateEx(int section_id, int command_id)
integer reaper.GetToggleCommandStateEx(integer section_id, integer command_id)
Int RPR_GetToggleCommandStateEx(Int section_id, Int command_id)

For the main action context, the MIDI editor, or the media explorer, returns the toggle state of the action. 0=off, 1=on, -1=NA because the action does not have on/off states. For the MIDI editor, the action state for the most recently focused window will be returned.

HWND GetTooltipWindow()
HWND GetTooltipWindow()
HWND reaper.GetTooltipWindow()
HWND RPR_GetTooltipWindow()

gets a tooltip window,in case you want to ask it for font information. Can return NULL.

MediaTrack* GetTrack(ReaProject* proj, int trackidx)
MediaTrack GetTrack(ReaProject proj, int trackidx)
MediaTrack reaper.GetTrack(ReaProject proj, integer trackidx)
MediaTrack RPR_GetTrack(ReaProject proj, Int trackidx)

get a track from a project by track count (zero-based) (proj=0 for active project)

int GetTrackAutomationMode(MediaTrack* tr)
int GetTrackAutomationMode(MediaTrack tr)
integer reaper.GetTrackAutomationMode(MediaTrack tr)
Int RPR_GetTrackAutomationMode(MediaTrack tr)

return the track mode, regardless of global override

int GetTrackColor(MediaTrack* track)
int GetTrackColor(MediaTrack track)
integer reaper.GetTrackColor(MediaTrack track)
Int RPR_GetTrackColor(MediaTrack track)

Returns the track custom color as OS dependent color|0x100000 (i.e. ColorToNative(r,g,b)|0x100000). Black is returned as 0x01000000, no color setting is returned as 0.

int GetTrackDepth(MediaTrack* track)
int GetTrackDepth(MediaTrack track)
integer reaper.GetTrackDepth(MediaTrack track)
Int RPR_GetTrackDepth(MediaTrack track)
TrackEnvelope* GetTrackEnvelope(MediaTrack* track, int envidx)
TrackEnvelope GetTrackEnvelope(MediaTrack track, int envidx)
TrackEnvelope reaper.GetTrackEnvelope(MediaTrack track, integer envidx)
TrackEnvelope RPR_GetTrackEnvelope(MediaTrack track, Int envidx)
TrackEnvelope* GetTrackEnvelopeByChunkName(MediaTrack* tr, const char* cfgchunkname)
TrackEnvelope GetTrackEnvelopeByChunkName(MediaTrack tr, "cfgchunkname")
TrackEnvelope reaper.GetTrackEnvelopeByChunkName(MediaTrack tr, string cfgchunkname)
TrackEnvelope RPR_GetTrackEnvelopeByChunkName(MediaTrack tr, String cfgchunkname)
Gets a built-in track envelope by configuration chunk name, e.g. "<VOLENV".
TrackEnvelope* GetTrackEnvelopeByName(MediaTrack* track, const char* envname)
TrackEnvelope GetTrackEnvelopeByName(MediaTrack track, "envname")
TrackEnvelope reaper.GetTrackEnvelopeByName(MediaTrack track, string envname)
TrackEnvelope RPR_GetTrackEnvelopeByName(MediaTrack track, String envname)
GUID* GetTrackGUID(MediaTrack* tr)
bool GetTrackGUID(#retguid, MediaTrack tr)
string GUID = reaper.GetTrackGUID(MediaTrack tr)
GUID RPR_GetTrackGUID(MediaTrack tr)
MediaItem* GetTrackMediaItem(MediaTrack* tr, int itemidx)
MediaItem GetTrackMediaItem(MediaTrack tr, int itemidx)
MediaItem reaper.GetTrackMediaItem(MediaTrack tr, integer itemidx)
MediaItem RPR_GetTrackMediaItem(MediaTrack tr, Int itemidx)
bool GetTrackMIDILyrics(MediaTrack* track, int flag, char* bufWant16384, int* bufWant16384_sz)
bool GetTrackMIDILyrics(MediaTrack track, int flag, #bufWant16384)
boolean retval, string bufWant16384 = reaper.GetTrackMIDILyrics(MediaTrack track, integer flag, string bufWant16384)
(Boolean retval, MediaTrack track, Int flag, String bufWant16384, Int bufWant16384_sz) = RPR_GetTrackMIDILyrics(track, flag, bufWant16384, bufWant16384_sz)

Get all MIDI lyrics on the track. Lyrics will be returned as one string with tabs between each word. flag&1: double tabs at the end of each measure and triple tabs when skipping measures, flag&2: each lyric is preceded by its beat position in the project (example with flag=2: "1.1.2\tLyric for measure 1 beat 2\t.1.1\tLyric for measure 2 beat 1 "). See SetTrackMIDILyrics

const char* GetTrackMIDINoteName(int track, int pitch, int chan)
bool GetTrackMIDINoteName(#retval, int track, int pitch, int chan)
string reaper.GetTrackMIDINoteName(integer track, integer pitch, integer chan)
String RPR_GetTrackMIDINoteName(Int track, Int pitch, Int chan)

see GetTrackMIDINoteNameEx

const char* GetTrackMIDINoteNameEx(ReaProject* proj, MediaTrack* track, int pitch, int chan)
bool GetTrackMIDINoteNameEx(#retval, ReaProject proj, MediaTrack track, int pitch, int chan)
string reaper.GetTrackMIDINoteNameEx(ReaProject proj, MediaTrack track, integer pitch, integer chan)
String RPR_GetTrackMIDINoteNameEx(ReaProject proj, MediaTrack track, Int pitch, Int chan)

Get note/CC name. pitch 128 for CC0 name, 129 for CC1 name, etc. See SetTrackMIDINoteNameEx

void GetTrackMIDINoteRange(ReaProject* proj, MediaTrack* track, int* note_loOut, int* note_hiOut)
GetTrackMIDINoteRange(ReaProject proj, MediaTrack track, int &note_lo, int &note_hi)
number note_lo, number note_hi = reaper.GetTrackMIDINoteRange(ReaProject proj, MediaTrack track)
(ReaProject proj, MediaTrack track, Int note_loOut, Int note_hiOut) = RPR_GetTrackMIDINoteRange(proj, track, note_loOut, note_hiOut)
bool GetTrackName(MediaTrack* track, char* buf, int buf_sz)
bool GetTrackName(MediaTrack track, #buf)
boolean retval, string buf = reaper.GetTrackName(MediaTrack track, string buf)
(Boolean retval, MediaTrack track, String buf, Int buf_sz) = RPR_GetTrackName(track, buf, buf_sz)

Returns "MASTER" for master track, "Track N" if track has no name.

int GetTrackNumMediaItems(MediaTrack* tr)
int GetTrackNumMediaItems(MediaTrack tr)
integer reaper.GetTrackNumMediaItems(MediaTrack tr)
Int RPR_GetTrackNumMediaItems(MediaTrack tr)
int GetTrackNumSends(MediaTrack* tr, int category)
int GetTrackNumSends(MediaTrack tr, int category)
integer reaper.GetTrackNumSends(MediaTrack tr, integer category)
Int RPR_GetTrackNumSends(MediaTrack tr, Int category)

returns number of sends/receives/hardware outputs - category is <0 for receives, 0=sends, >0 for hardware outputs

bool GetTrackReceiveName(MediaTrack* track, int recv_index, char* buf, int buf_sz)
bool GetTrackReceiveName(MediaTrack track, int recv_index, #buf)
boolean retval, string buf = reaper.GetTrackReceiveName(MediaTrack track, integer recv_index, string buf)
(Boolean retval, MediaTrack track, Int recv_index, String buf, Int buf_sz) = RPR_GetTrackReceiveName(track, recv_index, buf, buf_sz)

See GetTrackSendName.

bool GetTrackReceiveUIMute(MediaTrack* track, int recv_index, bool* muteOut)
bool GetTrackReceiveUIMute(MediaTrack track, int recv_index, bool &mute)
boolean retval, boolean mute = reaper.GetTrackReceiveUIMute(MediaTrack track, integer recv_index)
(Boolean retval, MediaTrack track, Int recv_index, Boolean muteOut) = RPR_GetTrackReceiveUIMute(track, recv_index, muteOut)

See GetTrackSendUIMute.

bool GetTrackReceiveUIVolPan(MediaTrack* track, int recv_index, double* volumeOut, double* panOut)
bool GetTrackReceiveUIVolPan(MediaTrack track, int recv_index, &volume, &pan)
boolean retval, number volume, number pan = reaper.GetTrackReceiveUIVolPan(MediaTrack track, integer recv_index)
(Boolean retval, MediaTrack track, Int recv_index, Float volumeOut, Float panOut) = RPR_GetTrackReceiveUIVolPan(track, recv_index, volumeOut, panOut)

See GetTrackSendUIVolPan.

double GetTrackSendInfo_Value(MediaTrack* tr, int category, int sendidx, const char* parmname)
double GetTrackSendInfo_Value(MediaTrack tr, int category, int sendidx, "parmname")
number reaper.GetTrackSendInfo_Value(MediaTrack tr, integer category, integer sendidx, string parmname)
Float RPR_GetTrackSendInfo_Value(MediaTrack tr, Int category, Int sendidx, String parmname)
Get send/receive/hardware output numerical-value attributes.
category is <0 for receives, 0=sends, >0 for hardware outputs
parameter names:
B_MUTE : returns bool *
B_PHASE : returns bool *, true to flip phase
B_MONO : returns bool *
D_VOL : returns double *, 1.0 = +0dB etc
D_PAN : returns double *, -1..+1
D_PANLAW : returns double *,1.0=+0.0db, 0.5=-6dB, -1.0 = projdef etc
I_SENDMODE : returns int *, 0=post-fader, 1=pre-fx, 2=post-fx (deprecated), 3=post-fx
I_AUTOMODE : returns int * : automation mode (-1=use track automode, 0=trim/off, 1=read, 2=touch, 3=write, 4=latch)
I_SRCCHAN : returns int *, index,&1024=mono, -1 for none
I_DSTCHAN : returns int *, index, &1024=mono, otherwise stereo pair, hwout:&512=rearoute
I_MIDIFLAGS : returns int *, low 5 bits=source channel 0=all, 1-16, next 5 bits=dest channel, 0=orig, 1-16=chanP_DESTTRACK : read only, returns MediaTrack *, destination track, only applies for sends/recvs
P_SRCTRACK : read only, returns MediaTrack *, source track, only applies for sends/recvs
P_ENV : read only, returns TrackEnvelope *, setNewValue=<VOLENV, <PANENV, etc

See CreateTrackSend, RemoveTrackSend, GetTrackNumSends.

bool GetTrackSendName(MediaTrack* track, int send_index, char* buf, int buf_sz)
bool GetTrackSendName(MediaTrack track, int send_index, #buf)
boolean retval, string buf = reaper.GetTrackSendName(MediaTrack track, integer send_index, string buf)
(Boolean retval, MediaTrack track, Int send_index, String buf, Int buf_sz) = RPR_GetTrackSendName(track, send_index, buf, buf_sz)

send_idx>=0 for hw ouputs, >=nb_of_hw_ouputs for sends. See GetTrackReceiveName.

bool GetTrackSendUIMute(MediaTrack* track, int send_index, bool* muteOut)
bool GetTrackSendUIMute(MediaTrack track, int send_index, bool &mute)
boolean retval, boolean mute = reaper.GetTrackSendUIMute(MediaTrack track, integer send_index)
(Boolean retval, MediaTrack track, Int send_index, Boolean muteOut) = RPR_GetTrackSendUIMute(track, send_index, muteOut)

send_idx>=0 for hw ouputs, >=nb_of_hw_ouputs for sends. See GetTrackReceiveUIMute.

bool GetTrackSendUIVolPan(MediaTrack* track, int send_index, double* volumeOut, double* panOut)
bool GetTrackSendUIVolPan(MediaTrack track, int send_index, &volume, &pan)
boolean retval, number volume, number pan = reaper.GetTrackSendUIVolPan(MediaTrack track, integer send_index)
(Boolean retval, MediaTrack track, Int send_index, Float volumeOut, Float panOut) = RPR_GetTrackSendUIVolPan(track, send_index, volumeOut, panOut)

send_idx>=0 for hw ouputs, >=nb_of_hw_ouputs for sends. See GetTrackReceiveUIVolPan.

const char* GetTrackState(MediaTrack* track, int* flagsOut)
bool GetTrackState(#retval, MediaTrack track, int &flags)
string retval, number flags = reaper.GetTrackState(MediaTrack track)
(String retval, MediaTrack track, Int flagsOut) = RPR_GetTrackState(track, flagsOut)
Gets track state, returns track name.
flags will be set to:
&1=folder
&2=selected
&4=has fx enabled
&8=muted
&16=soloed
&32=SIP'd (with &16)
&64=rec armed
&128=rec monitoring on
&256=rec monitoring auto
&512=hide from TCP

&1024=hide from MCP

bool GetTrackStateChunk(MediaTrack* track, char* strNeedBig, int strNeedBig_sz, bool isundoOptional)
bool GetTrackStateChunk(MediaTrack track, #str, bool isundo)
boolean retval, string str = reaper.GetTrackStateChunk(MediaTrack track, string str, boolean isundo)
(Boolean retval, MediaTrack track, String strNeedBig, Int strNeedBig_sz, Boolean isundoOptional) = RPR_GetTrackStateChunk(track, strNeedBig, strNeedBig_sz, isundoOptional)

Gets the RPPXML state of a track, returns true if successful. Undo flag is a performance/caching hint.

bool GetTrackUIMute(MediaTrack* track, bool* muteOut)
bool GetTrackUIMute(MediaTrack track, bool &mute)
boolean retval, boolean mute = reaper.GetTrackUIMute(MediaTrack track)
(Boolean retval, MediaTrack track, Boolean muteOut) = RPR_GetTrackUIMute(track, muteOut)
bool GetTrackUIPan(MediaTrack* track, double* pan1Out, double* pan2Out, int* panmodeOut)
bool GetTrackUIPan(MediaTrack track, &pan1, &pan2, int &panmode)
boolean retval, number pan1, number pan2, number panmode = reaper.GetTrackUIPan(MediaTrack track)
(Boolean retval, MediaTrack track, Float pan1Out, Float pan2Out, Int panmodeOut) = RPR_GetTrackUIPan(track, pan1Out, pan2Out, panmodeOut)
bool GetTrackUIVolPan(MediaTrack* track, double* volumeOut, double* panOut)
bool GetTrackUIVolPan(MediaTrack track, &volume, &pan)
boolean retval, number volume, number pan = reaper.GetTrackUIVolPan(MediaTrack track)
(Boolean retval, MediaTrack track, Float volumeOut, Float panOut) = RPR_GetTrackUIVolPan(track, volumeOut, panOut)
void GetUnderrunTime(unsigned int* audio_xrunOutOptional, unsigned int* media_xrunOutOptional, unsigned int* curtimeOutOptional)
GetUnderrunTime(optional unsigned int &audio_xrun, optional unsigned int &media_xrun, optional unsigned int &curtime)
optional number audio_xrun, optional number media_xrun, optional number curtime = reaper.GetUnderrunTime()
RPR_GetUnderrunTime(unsigned int audio_xrunOutOptional, unsigned int media_xrunOutOptional, unsigned int curtimeOutOptional)

retrieves the last timestamps of audio xrun (yellow-flash, if available), media xrun (red-flash), and the current time stamp (all milliseconds)

bool GetUserFileNameForRead(char* filenameNeed4096, const char* title, const char* defext)
bool GetUserFileNameForRead(#filenameNeed4096, "title", "defext")
boolean retval, string filenameNeed4096 = reaper.GetUserFileNameForRead(string filenameNeed4096, string title, string defext)
(Boolean retval, String filenameNeed4096, String title, String defext) = RPR_GetUserFileNameForRead(filenameNeed4096, title, defext)

returns true if the user selected a valid file, false if the user canceled the dialog

bool GetUserInputs(const char* title, int num_inputs, const char* captions_csv, char* retvals_csv, int retvals_csv_sz)
bool GetUserInputs("title", int num_inputs, "captions_csv", #retvals_csv)
boolean retval, string retvals_csv = reaper.GetUserInputs(string title, integer num_inputs, string captions_csv, string retvals_csv)
(Boolean retval, String title, Int num_inputs, String captions_csv, String retvals_csv, Int retvals_csv_sz) = RPR_GetUserInputs(title, num_inputs, captions_csv, retvals_csv, retvals_csv_sz)
Get values from the user.
If a caption begins with *, for example "*password", the edit field will not display the input text.

Maximum fields is 16. Values are returned as a comma-separated string. Returns false if the user canceled the dialog. To increase text field width, add an extra caption field, and specify extrawidth=xyz

void GoToMarker(ReaProject* proj, int marker_index, bool use_timeline_order)
GoToMarker(ReaProject proj, int marker_index, bool use_timeline_order)
reaper.GoToMarker(ReaProject proj, integer marker_index, boolean use_timeline_order)
RPR_GoToMarker(ReaProject proj, Int marker_index, Boolean use_timeline_order)

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.

void GoToRegion(ReaProject* proj, int region_index, bool use_timeline_order)
GoToRegion(ReaProject proj, int region_index, bool use_timeline_order)
reaper.GoToRegion(ReaProject proj, integer region_index, boolean use_timeline_order)
RPR_GoToRegion(ReaProject proj, Int region_index, Boolean use_timeline_order)

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.

int GR_SelectColor(HWND hwnd, int* colorOut)
int GR_SelectColor(HWND hwnd, int &color)
integer retval, number color = reaper.GR_SelectColor(HWND hwnd)
(Int retval, HWND hwnd, Int colorOut) = RPR_GR_SelectColor(hwnd, colorOut)

Runs the system color chooser dialog. Returns 0 if the user cancels the dialog.

int GSC_mainwnd(int t)
int GSC_mainwnd(int t)
integer reaper.GSC_mainwnd(integer t)
Int RPR_GSC_mainwnd(Int t)

this is just like win32 GetSysColor() but can have overrides.

void guidToString(const GUID* g, char* destNeed64)
guidToString("gGUID", #destNeed64)
string destNeed64 = reaper.guidToString(string gGUID, string destNeed64)
(const GUID g, String destNeed64) = RPR_guidToString(g, destNeed64)

dest should be at least 64 chars long to be safe

bool HasExtState(const char* section, const char* key)
bool HasExtState("section", "key")
boolean reaper.HasExtState(string section, string key)
Boolean RPR_HasExtState(String section, String key)

Returns true if there exists an extended state value for a specific section and key. See SetExtState, GetExtState, DeleteExtState.

const char* HasTrackMIDIPrograms(int track)
bool HasTrackMIDIPrograms(#retval, int track)
string reaper.HasTrackMIDIPrograms(integer track)
String RPR_HasTrackMIDIPrograms(Int track)

returns name of track plugin that is supplying MIDI programs,or NULL if there is none

const char* HasTrackMIDIProgramsEx(ReaProject* proj, MediaTrack* track)
bool HasTrackMIDIProgramsEx(#retval, ReaProject proj, MediaTrack track)
string reaper.HasTrackMIDIProgramsEx(ReaProject proj, MediaTrack track)
String RPR_HasTrackMIDIProgramsEx(ReaProject proj, MediaTrack track)

returns name of track plugin that is supplying MIDI programs,or NULL if there is none

void Help_Set(const char* helpstring, bool is_temporary_help)
Help_Set("helpstring", bool is_temporary_help)
reaper.Help_Set(string helpstring, boolean is_temporary_help)
RPR_Help_Set(String helpstring, Boolean is_temporary_help)
void image_resolve_fn(const char* in, char* out, int out_sz)
image_resolve_fn("in", #out)
string out = reaper.image_resolve_fn(string in, string out)
(String in, String out, Int out_sz) = RPR_image_resolve_fn(in, out, out_sz)
int InsertAutomationItem(TrackEnvelope* env, int pool_id, double position, double length)
int InsertAutomationItem(TrackEnvelope env, int pool_id, position, length)
integer reaper.InsertAutomationItem(TrackEnvelope env, integer pool_id, number position, number length)
Int RPR_InsertAutomationItem(TrackEnvelope env, Int pool_id, Float position, Float length)

Insert a new automation item. pool_id < 0 collects existing envelope points into the automation item; if pool_id is >= 0 the automation item will be a new instance of that pool (which will be created as an empty instance if it does not exist). Returns the index of the item, suitable for passing to other automation item API functions. See GetSetAutomationItemInfo.

bool InsertEnvelopePoint(TrackEnvelope* envelope, double time, double value, int shape, double tension, bool selected, bool* noSortInOptional)
bool InsertEnvelopePoint(TrackEnvelope envelope, time, value, int shape, tension, bool selected, optional bool noSortIn)
boolean reaper.InsertEnvelopePoint(TrackEnvelope envelope, number time, number value, integer shape, number tension, boolean selected, optional boolean noSortIn)
(Boolean retval, TrackEnvelope envelope, Float time, Float value, Int shape, Float tension, Boolean selected, Boolean noSortInOptional) = RPR_InsertEnvelopePoint(envelope, time, value, shape, tension, selected, noSortInOptional)

Insert an envelope point. If setting multiple points at once, set noSort=true, and call Envelope_SortPoints when done. See GetEnvelopePoint, SetEnvelopePoint, GetEnvelopeScalingMode.

bool InsertEnvelopePointEx(TrackEnvelope* envelope, int autoitem_idx, double time, double value, int shape, double tension, bool selected, bool* noSortInOptional)
bool InsertEnvelopePointEx(TrackEnvelope envelope, int autoitem_idx, time, value, int shape, tension, bool selected, optional bool noSortIn)
boolean reaper.InsertEnvelopePointEx(TrackEnvelope envelope, integer autoitem_idx, number time, number value, integer shape, number tension, boolean selected, optional boolean noSortIn)
(Boolean retval, TrackEnvelope envelope, Int autoitem_idx, Float time, Float value, Int shape, Float tension, Boolean selected, Boolean noSortInOptional) = RPR_InsertEnvelopePointEx(envelope, autoitem_idx, time, value, shape, tension, selected, noSortInOptional)

Insert an envelope point. If setting multiple points at once, set noSort=true, and call Envelope_SortPoints when done. autoitem_idx==-1 for the underlying envelope, 0 for the first automation item on the envelope, etc. See GetEnvelopePoint, SetEnvelopePoint, GetEnvelopeScalingMode.

int InsertMedia(const char* file, int mode)
int InsertMedia("file", int mode)
integer reaper.InsertMedia(string file, integer mode)
Int RPR_InsertMedia(String file, Int mode)

mode: 0=add to current track, 1=add new track, 3=add to selected items as takes, &4=stretch/loop to fit time sel, &8=try to match tempo 1x, &16=try to match tempo 0.5x, &32=try to match tempo 2x, &64=don't preserve pitch when matching tempo, &128=no loop/section if startpct/endpct set, &256=force loop regardless of global preference for looping imported items. &512=use high word as absolute track index if mode&3==0.

int InsertMediaSection(const char* file, int mode, double startpct, double endpct, double pitchshift)
int InsertMediaSection("file", int mode, startpct, endpct, pitchshift)
integer reaper.InsertMediaSection(string file, integer mode, number startpct, number endpct, number pitchshift)
Int RPR_InsertMediaSection(String file, Int mode, Float startpct, Float endpct, Float pitchshift)
void InsertTrackAtIndex(int idx, bool wantDefaults)
InsertTrackAtIndex(int idx, bool wantDefaults)
reaper.InsertTrackAtIndex(integer idx, boolean wantDefaults)
RPR_InsertTrackAtIndex(Int idx, Boolean wantDefaults)

inserts a track at idx,of course this will be clamped to 0..GetNumTracks(). wantDefaults=TRUE for default envelopes/FX,otherwise no enabled fx/env

bool IsMediaExtension(const char* ext, bool wantOthers)
bool IsMediaExtension("ext", bool wantOthers)
boolean reaper.IsMediaExtension(string ext, boolean wantOthers)
Boolean RPR_IsMediaExtension(String ext, Boolean wantOthers)
Tests a file extension (i.e. "wav" or "mid") to see if it's a media extension.

If wantOthers is set, then "RPP", "TXT" and other project-type formats will also pass.

bool IsMediaItemSelected(MediaItem* item)
bool IsMediaItemSelected(MediaItem item)
boolean reaper.IsMediaItemSelected(MediaItem item)
Boolean RPR_IsMediaItemSelected(MediaItem item)
int IsProjectDirty(ReaProject* proj)
int IsProjectDirty(ReaProject proj)
integer reaper.IsProjectDirty(ReaProject proj)
Int RPR_IsProjectDirty(ReaProject proj)

Is the project dirty (needing save)? Always returns 0 if 'undo/prompt to save' is disabled in preferences.

bool IsTrackSelected(MediaTrack* track)
bool IsTrackSelected(MediaTrack track)
boolean reaper.IsTrackSelected(MediaTrack track)
Boolean RPR_IsTrackSelected(MediaTrack track)
bool IsTrackVisible(MediaTrack* track, bool mixer)
bool IsTrackVisible(MediaTrack track, bool mixer)
boolean reaper.IsTrackVisible(MediaTrack track, boolean mixer)
Boolean RPR_IsTrackVisible(MediaTrack track, Boolean mixer)

If mixer==true, returns true if the track is visible in the mixer. If mixer==false, returns true if the track is visible in the track control panel.

joystick_device* joystick_create(const GUID* guid)
joystick_device joystick_create("guidGUID")
joystick_device reaper.joystick_create(string guidGUID)
joystick_device RPR_joystick_create(const GUID guid)

creates a joystick device

void joystick_destroy(joystick_device* device)
joystick_destroy(joystick_device device)
reaper.joystick_destroy(joystick_device device)
RPR_joystick_destroy(joystick_device device)

destroys a joystick device

const char* joystick_enum(int index, const char** namestrOutOptional)
bool joystick_enum(#retval, int index, optional #namestr)
string retval, optional string namestr = reaper.joystick_enum(integer index)
String RPR_joystick_enum(Int index, String namestrOutOptional)

enumerates installed devices, returns GUID as a string

double joystick_getaxis(joystick_device* dev, int axis)
double joystick_getaxis(joystick_device dev, int axis)
number reaper.joystick_getaxis(joystick_device dev, integer axis)
Float RPR_joystick_getaxis(joystick_device dev, Int axis)

returns axis value (-1..1)

unsigned int joystick_getbuttonmask(joystick_device* dev)
uint joystick_getbuttonmask(joystick_device dev)
integer reaper.joystick_getbuttonmask(joystick_device dev)
Unknown RPR_joystick_getbuttonmask(joystick_device dev)

returns button pressed mask, 1=first button, 2=second...

int joystick_getinfo(joystick_device* dev, int* axesOutOptional, int* povsOutOptional)
int joystick_getinfo(joystick_device dev, optional int &axes, optional int &povs)
integer retval, optional number axes, optional number povs = reaper.joystick_getinfo(joystick_device dev)
(Int retval, joystick_device dev, Int axesOutOptional, Int povsOutOptional) = RPR_joystick_getinfo(dev, axesOutOptional, povsOutOptional)

returns button count

double joystick_getpov(joystick_device* dev, int pov)
double joystick_getpov(joystick_device dev, int pov)
number reaper.joystick_getpov(joystick_device dev, integer pov)
Float RPR_joystick_getpov(joystick_device dev, Int pov)

returns POV value (usually 0..655.35, or 655.35 on error)

bool joystick_update(joystick_device* dev)
bool joystick_update(joystick_device dev)
boolean reaper.joystick_update(joystick_device dev)
Boolean RPR_joystick_update(joystick_device dev)

Updates joystick state from hardware, returns true if successful (joystick_get* will not be valid until joystick_update() is called successfully)

bool LICE_ClipLine(int* pX1Out, int* pY1Out, int* pX2Out, int* pY2Out, int xLo, int yLo, int xHi, int yHi)
bool LICE_ClipLine(int &pX1, int &pY1, int &pX2, int &pY2, int xLo, int yLo, int xHi, int yHi)
boolean retval, number pX1, number pY1, number pX2, number pY2 = reaper.LICE_ClipLine(number pX1, number pY1, number pX2, number pY2, integer xLo, integer yLo, integer xHi, integer yHi)
(Boolean retval, Int pX1Out, Int pY1Out, Int pX2Out, Int pY2Out, Int xLo, Int yLo, Int xHi, Int yHi) = RPR_LICE_ClipLine(pX1Out, pY1Out, pX2Out, pY2Out, xLo, yLo, xHi, yHi)

Returns false if the line is entirely offscreen.

bool Loop_OnArrow(ReaProject* project, int direction)
bool Loop_OnArrow(ReaProject project, int direction)
boolean reaper.Loop_OnArrow(ReaProject project, integer direction)
Boolean RPR_Loop_OnArrow(ReaProject project, Int direction)

Move the loop selection left or right. Returns true if snap is enabled.

void Main_OnCommand(int command, int flag)
Main_OnCommand(int command, int flag)
reaper.Main_OnCommand(integer command, integer flag)
RPR_Main_OnCommand(Int command, Int flag)

See Main_OnCommandEx.

void Main_OnCommandEx(int command, int flag, ReaProject* proj)
Main_OnCommandEx(int command, int flag, ReaProject proj)
reaper.Main_OnCommandEx(integer command, integer flag, ReaProject proj)
RPR_Main_OnCommandEx(Int command, Int flag, ReaProject proj)

Performs an action belonging to the main action section. To perform non-native actions (ReaScripts, custom or extension plugins' actions) safely, see NamedCommandLookup().

void Main_openProject(const char* name)
Main_openProject("name")
reaper.Main_openProject(string name)
RPR_Main_openProject(String name)
opens a project. will prompt the user to save, etc.

if you pass a .RTrackTemplate file then it adds that to the project instead.

void Main_SaveProject(ReaProject* proj, bool forceSaveAsInOptional)
Main_SaveProject(ReaProject proj, bool forceSaveAsIn)
reaper.Main_SaveProject(ReaProject proj, boolean forceSaveAsIn)
RPR_Main_SaveProject(ReaProject proj, Boolean forceSaveAsInOptional)

Save the project.

void Main_UpdateLoopInfo(int ignoremask)
Main_UpdateLoopInfo(int ignoremask)
reaper.Main_UpdateLoopInfo(integer ignoremask)
RPR_Main_UpdateLoopInfo(Int ignoremask)
void MarkProjectDirty(ReaProject* proj)
MarkProjectDirty(ReaProject proj)
reaper.MarkProjectDirty(ReaProject proj)
RPR_MarkProjectDirty(ReaProject proj)

Marks project as dirty (needing save) if 'undo/prompt to save' is enabled in preferences.

void MarkTrackItemsDirty(MediaTrack* track, MediaItem* item)
MarkTrackItemsDirty(MediaTrack track, MediaItem item)
reaper.MarkTrackItemsDirty(MediaTrack track, MediaItem item)
RPR_MarkTrackItemsDirty(MediaTrack track, MediaItem item)

If track is supplied, item is ignored

double Master_GetPlayRate(ReaProject* project)
double Master_GetPlayRate(ReaProject project)
number reaper.Master_GetPlayRate(ReaProject project)
Float RPR_Master_GetPlayRate(ReaProject project)
double Master_GetPlayRateAtTime(double time_s, ReaProject* proj)
double Master_GetPlayRateAtTime(time_s, ReaProject proj)
number reaper.Master_GetPlayRateAtTime(number time_s, ReaProject proj)
Float RPR_Master_GetPlayRateAtTime(Float time_s, ReaProject proj)
double Master_GetTempo()
double Master_GetTempo()
number reaper.Master_GetTempo()
Float RPR_Master_GetTempo()
double Master_NormalizePlayRate(double playrate, bool isnormalized)
double Master_NormalizePlayRate(playrate, bool isnormalized)
number reaper.Master_NormalizePlayRate(number playrate, boolean isnormalized)
Float RPR_Master_NormalizePlayRate(Float playrate, Boolean isnormalized)

Convert play rate to/from a value between 0 and 1, representing the position on the project playrate slider.

double Master_NormalizeTempo(double bpm, bool isnormalized)
double Master_NormalizeTempo(bpm, bool isnormalized)
number reaper.Master_NormalizeTempo(number bpm, boolean isnormalized)
Float RPR_Master_NormalizeTempo(Float bpm, Boolean isnormalized)

Convert the tempo to/from a value between 0 and 1, representing bpm in the range of 40-296 bpm.

int MB(const char* msg, const char* title, int type)
int MB("msg", "title", int type)
integer reaper.MB(string msg, string title, integer type)
Int RPR_MB(String msg, String title, Int type)

type 0=OK,1=OKCANCEL,2=ABORTRETRYIGNORE,3=YESNOCANCEL,4=YESNO,5=RETRYCANCEL : ret 1=OK,2=CANCEL,3=ABORT,4=RETRY,5=IGNORE,6=YES,7=NO

int MediaItemDescendsFromTrack(MediaItem* item, MediaTrack* track)
int MediaItemDescendsFromTrack(MediaItem item, MediaTrack track)
integer reaper.MediaItemDescendsFromTrack(MediaItem item, MediaTrack track)
Int RPR_MediaItemDescendsFromTrack(MediaItem item, MediaTrack track)

Returns 1 if the track holds the item, 2 if the track is a folder containing the track that holds the item, etc.

int MIDI_CountEvts(MediaItem_Take* take, int* notecntOut, int* ccevtcntOut, int* textsyxevtcntOut)
int MIDI_CountEvts(MediaItem_Take take, int &notecnt, int &ccevtcnt, int &textsyxevtcnt)
integer retval, number notecnt, number ccevtcnt, number textsyxevtcnt = reaper.MIDI_CountEvts(MediaItem_Take take)
(Int retval, MediaItem_Take take, Int notecntOut, Int ccevtcntOut, Int textsyxevtcntOut) = RPR_MIDI_CountEvts(take, notecntOut, ccevtcntOut, textsyxevtcntOut)

Count the number of notes, CC events, and text/sysex events in a given MIDI item.

bool MIDI_DeleteCC(MediaItem_Take* take, int ccidx)
bool MIDI_DeleteCC(MediaItem_Take take, int ccidx)
boolean reaper.MIDI_DeleteCC(MediaItem_Take take, integer ccidx)
Boolean RPR_MIDI_DeleteCC(MediaItem_Take take, Int ccidx)

Delete a MIDI CC event.

bool MIDI_DeleteEvt(MediaItem_Take* take, int evtidx)
bool MIDI_DeleteEvt(MediaItem_Take take, int evtidx)
boolean reaper.MIDI_DeleteEvt(MediaItem_Take take, integer evtidx)
Boolean RPR_MIDI_DeleteEvt(MediaItem_Take take, Int evtidx)

Delete a MIDI event.

bool MIDI_DeleteNote(MediaItem_Take* take, int noteidx)
bool MIDI_DeleteNote(MediaItem_Take take, int noteidx)
boolean reaper.MIDI_DeleteNote(MediaItem_Take take, integer noteidx)
Boolean RPR_MIDI_DeleteNote(MediaItem_Take take, Int noteidx)

Delete a MIDI note.

bool MIDI_DeleteTextSysexEvt(MediaItem_Take* take, int textsyxevtidx)
bool MIDI_DeleteTextSysexEvt(MediaItem_Take take, int textsyxevtidx)
boolean reaper.MIDI_DeleteTextSysexEvt(MediaItem_Take take, integer textsyxevtidx)
Boolean RPR_MIDI_DeleteTextSysexEvt(MediaItem_Take take, Int textsyxevtidx)

Delete a MIDI text or sysex event.

int MIDI_EnumSelCC(MediaItem_Take* take, int ccidx)
int MIDI_EnumSelCC(MediaItem_Take take, int ccidx)
integer reaper.MIDI_EnumSelCC(MediaItem_Take take, integer ccidx)
Int RPR_MIDI_EnumSelCC(MediaItem_Take take, Int ccidx)

Returns the index of the next selected MIDI CC event after ccidx (-1 if there are no more selected events).

int MIDI_EnumSelEvts(MediaItem_Take* take, int evtidx)
int MIDI_EnumSelEvts(MediaItem_Take take, int evtidx)
integer reaper.MIDI_EnumSelEvts(MediaItem_Take take, integer evtidx)
Int RPR_MIDI_EnumSelEvts(MediaItem_Take take, Int evtidx)

Returns the index of the next selected MIDI event after evtidx (-1 if there are no more selected events).

int MIDI_EnumSelNotes(MediaItem_Take* take, int noteidx)
int MIDI_EnumSelNotes(MediaItem_Take take, int noteidx)
integer reaper.MIDI_EnumSelNotes(MediaItem_Take take, integer noteidx)
Int RPR_MIDI_EnumSelNotes(MediaItem_Take take, Int noteidx)

Returns the index of the next selected MIDI note after noteidx (-1 if there are no more selected events).

int MIDI_EnumSelTextSysexEvts(MediaItem_Take* take, int textsyxidx)
int MIDI_EnumSelTextSysexEvts(MediaItem_Take take, int textsyxidx)
integer reaper.MIDI_EnumSelTextSysexEvts(MediaItem_Take take, integer textsyxidx)
Int RPR_MIDI_EnumSelTextSysexEvts(MediaItem_Take take, Int textsyxidx)

Returns the index of the next selected MIDI text/sysex event after textsyxidx (-1 if there are no more selected events).

bool MIDI_GetAllEvts(MediaItem_Take* take, char* bufNeedBig, int* bufNeedBig_sz)
bool MIDI_GetAllEvts(MediaItem_Take take, #buf)
boolean retval, string buf = reaper.MIDI_GetAllEvts(MediaItem_Take take, string buf)
(Boolean retval, MediaItem_Take take, String bufNeedBig, Int bufNeedBig_sz) = RPR_MIDI_GetAllEvts(take, bufNeedBig, bufNeedBig_sz)

Get all MIDI data. MIDI buffer is returned as a list of { int offset, char flag, int msglen, unsigned char msg[] }. offset: MIDI ticks from previous event, flag: &1=selected &2=muted, msglen: byte length of msg (usually 3), msg: the MIDI message. For tick intervals longer than a 32 bit word can represent, zero-length meta events may be placed between valid events. See MIDI_SetAllEvts.

bool MIDI_GetCC(MediaItem_Take* take, int ccidx, bool* selectedOut, bool* mutedOut, double* ppqposOut, int* chanmsgOut, int* chanOut, int* msg2Out, int* msg3Out)
bool MIDI_GetCC(MediaItem_Take take, int ccidx, bool &selected, bool &muted, &ppqpos, int &chanmsg, int &chan, int &msg2, int &msg3)
boolean retval, boolean selected, boolean muted, number ppqpos, number chanmsg, number chan, number msg2, number msg3 = reaper.MIDI_GetCC(MediaItem_Take take, integer ccidx)
(Boolean retval, MediaItem_Take take, Int ccidx, Boolean selectedOut, Boolean mutedOut, Float ppqposOut, Int chanmsgOut, Int chanOut, Int msg2Out, Int msg3Out) = RPR_MIDI_GetCC(take, ccidx, selectedOut, mutedOut, ppqposOut, chanmsgOut, chanOut, msg2Out, msg3Out)

Get MIDI CC event properties.

bool MIDI_GetEvt(MediaItem_Take* take, int evtidx, bool* selectedOut, bool* mutedOut, double* ppqposOut, char* msg, int* msg_sz)
bool MIDI_GetEvt(MediaItem_Take take, int evtidx, bool &selected, bool &muted, &ppqpos, #msg)
boolean retval, boolean selected, boolean muted, number ppqpos, string msg = reaper.MIDI_GetEvt(MediaItem_Take take, integer evtidx, boolean selected, boolean muted, number ppqpos, string msg)
(Boolean retval, MediaItem_Take take, Int evtidx, Boolean selectedOut, Boolean mutedOut, Float ppqposOut, String msg, Int msg_sz) = RPR_MIDI_GetEvt(take, evtidx, selectedOut, mutedOut, ppqposOut, msg, msg_sz)

Get MIDI event properties.

double MIDI_GetGrid(MediaItem_Take* take, double* swingOutOptional, double* noteLenOutOptional)
double MIDI_GetGrid(MediaItem_Take take, optional &swing, optional &noteLen)
number retval, optional number swing, optional number noteLen = reaper.MIDI_GetGrid(MediaItem_Take take)
(Float retval, MediaItem_Take take, Float swingOutOptional, Float noteLenOutOptional) = RPR_MIDI_GetGrid(take, swingOutOptional, noteLenOutOptional)

Returns the most recent MIDI editor grid size for this MIDI take, in QN. Swing is between 0 and 1. Note length is 0 if it follows the grid size.

bool MIDI_GetHash(MediaItem_Take* take, bool notesonly, char* hash, int hash_sz)
bool MIDI_GetHash(MediaItem_Take take, bool notesonly, #hash)
boolean retval, string hash = reaper.MIDI_GetHash(MediaItem_Take take, boolean notesonly, string hash)
(Boolean retval, MediaItem_Take take, Boolean notesonly, String hash, Int hash_sz) = RPR_MIDI_GetHash(take, notesonly, hash, hash_sz)

Get a string that only changes when the MIDI data changes. If notesonly==true, then the string changes only when the MIDI notes change. See MIDI_GetTrackHash

bool MIDI_GetNote(MediaItem_Take* take, int noteidx, bool* selectedOut, bool* mutedOut, double* startppqposOut, double* endppqposOut, int* chanOut, int* pitchOut, int* velOut)
bool MIDI_GetNote(MediaItem_Take take, int noteidx, bool &selected, bool &muted, &startppqpos, &endppqpos, int &chan, int &pitch, int &vel)
boolean retval, boolean selected, boolean muted, number startppqpos, number endppqpos, number chan, number pitch, number vel = reaper.MIDI_GetNote(MediaItem_Take take, integer noteidx)
(Boolean retval, MediaItem_Take take, Int noteidx, Boolean selectedOut, Boolean mutedOut, Float startppqposOut, Float endppqposOut, Int chanOut, Int pitchOut, Int velOut) = RPR_MIDI_GetNote(take, noteidx, selectedOut, mutedOut, startppqposOut, endppqposOut, chanOut, pitchOut, velOut)

Get MIDI note properties.

double MIDI_GetPPQPos_EndOfMeasure(MediaItem_Take* take, double ppqpos)
double MIDI_GetPPQPos_EndOfMeasure(MediaItem_Take take, ppqpos)
number reaper.MIDI_GetPPQPos_EndOfMeasure(MediaItem_Take take, number ppqpos)
Float RPR_MIDI_GetPPQPos_EndOfMeasure(MediaItem_Take take, Float ppqpos)

Returns the MIDI tick (ppq) position corresponding to the end of the measure.

double MIDI_GetPPQPos_StartOfMeasure(MediaItem_Take* take, double ppqpos)
double MIDI_GetPPQPos_StartOfMeasure(MediaItem_Take take, ppqpos)
number reaper.MIDI_GetPPQPos_StartOfMeasure(MediaItem_Take take, number ppqpos)
Float RPR_MIDI_GetPPQPos_StartOfMeasure(MediaItem_Take take, Float ppqpos)

Returns the MIDI tick (ppq) position corresponding to the start of the measure.

double MIDI_GetPPQPosFromProjQN(MediaItem_Take* take, double projqn)
double MIDI_GetPPQPosFromProjQN(MediaItem_Take take, projqn)
number reaper.MIDI_GetPPQPosFromProjQN(MediaItem_Take take, number projqn)
Float RPR_MIDI_GetPPQPosFromProjQN(MediaItem_Take take, Float projqn)

Returns the MIDI tick (ppq) position corresponding to a specific project time in quarter notes.

double MIDI_GetPPQPosFromProjTime(MediaItem_Take* take, double projtime)
double MIDI_GetPPQPosFromProjTime(MediaItem_Take take, projtime)
number reaper.MIDI_GetPPQPosFromProjTime(MediaItem_Take take, number projtime)
Float RPR_MIDI_GetPPQPosFromProjTime(MediaItem_Take take, Float projtime)

Returns the MIDI tick (ppq) position corresponding to a specific project time in seconds.

double MIDI_GetProjQNFromPPQPos(MediaItem_Take* take, double ppqpos)
double MIDI_GetProjQNFromPPQPos(MediaItem_Take take, ppqpos)
number reaper.MIDI_GetProjQNFromPPQPos(MediaItem_Take take, number ppqpos)
Float RPR_MIDI_GetProjQNFromPPQPos(MediaItem_Take take, Float ppqpos)

Returns the project time in quarter notes corresponding to a specific MIDI tick (ppq) position.

double MIDI_GetProjTimeFromPPQPos(MediaItem_Take* take, double ppqpos)
double MIDI_GetProjTimeFromPPQPos(MediaItem_Take take, ppqpos)
number reaper.MIDI_GetProjTimeFromPPQPos(MediaItem_Take take, number ppqpos)
Float RPR_MIDI_GetProjTimeFromPPQPos(MediaItem_Take take, Float ppqpos)

Returns the project time in seconds corresponding to a specific MIDI tick (ppq) position.

bool MIDI_GetScale(MediaItem_Take* take, int* rootOut, int* scaleOut, char* name, int name_sz)
bool MIDI_GetScale(MediaItem_Take take, int &root, int &scale, #name)
boolean retval, number root, number scale, string name = reaper.MIDI_GetScale(MediaItem_Take take, number root, number scale, string name)
(Boolean retval, MediaItem_Take take, Int rootOut, Int scaleOut, String name, Int name_sz) = RPR_MIDI_GetScale(take, rootOut, scaleOut, name, name_sz)

Get the active scale in the media source, if any. root 0=C, 1=C#, etc. scale &0x1=root, &0x2=minor 2nd, &0x4=major 2nd, &0x8=minor 3rd, &0xF=fourth, etc.

bool MIDI_GetTextSysexEvt(MediaItem_Take* take, int textsyxevtidx, bool* selectedOutOptional, bool* mutedOutOptional, double* ppqposOutOptional, int* typeOutOptional, char* msgOptional, int* msgOptional_sz)
bool MIDI_GetTextSysexEvt(MediaItem_Take take, int textsyxevtidx, optional bool &selected, optional bool &muted, optional &ppqpos, optional int &type, optional #msg)
boolean retval, optional boolean selected, optional boolean muted, optional number ppqpos, optional number type, optional string msg = reaper.MIDI_GetTextSysexEvt(MediaItem_Take take, integer textsyxevtidx, optional boolean selected, optional boolean muted, optional number ppqpos, optional number type, optional string msg)
(Boolean retval, MediaItem_Take take, Int textsyxevtidx, Boolean selectedOutOptional, Boolean mutedOutOptional, Float ppqposOutOptional, Int typeOutOptional, String msgOptional, Int msgOptional_sz) = RPR_MIDI_GetTextSysexEvt(take, textsyxevtidx, selectedOutOptional, mutedOutOptional, ppqposOutOptional, typeOutOptional, msgOptional, msgOptional_sz)

Get MIDI meta-event properties. Allowable types are -1:sysex (msg should not include bounding F0..F7), 1-7:MIDI text event types.

bool MIDI_GetTrackHash(MediaTrack* track, bool notesonly, char* hash, int hash_sz)
bool MIDI_GetTrackHash(MediaTrack track, bool notesonly, #hash)
boolean retval, string hash = reaper.MIDI_GetTrackHash(MediaTrack track, boolean notesonly, string hash)
(Boolean retval, MediaTrack track, Boolean notesonly, String hash, Int hash_sz) = RPR_MIDI_GetTrackHash(track, notesonly, hash, hash_sz)

Get a string that only changes when the MIDI data changes. If notesonly==true, then the string changes only when the MIDI notes change. See MIDI_GetHash

bool MIDI_InsertCC(MediaItem_Take* take, bool selected, bool muted, double ppqpos, int chanmsg, int chan, int msg2, int msg3)
bool MIDI_InsertCC(MediaItem_Take take, bool selected, bool muted, ppqpos, int chanmsg, int chan, int msg2, int msg3)
boolean reaper.MIDI_InsertCC(MediaItem_Take take, boolean selected, boolean muted, number ppqpos, integer chanmsg, integer chan, integer msg2, integer msg3)
Boolean RPR_MIDI_InsertCC(MediaItem_Take take, Boolean selected, Boolean muted, Float ppqpos, Int chanmsg, Int chan, Int msg2, Int msg3)

Insert a new MIDI CC event.

bool MIDI_InsertEvt(MediaItem_Take* take, bool selected, bool muted, double ppqpos, const char* bytestr, int bytestr_sz)
bool MIDI_InsertEvt(MediaItem_Take take, bool selected, bool muted, ppqpos, "bytestr")
boolean reaper.MIDI_InsertEvt(MediaItem_Take take, boolean selected, boolean muted, number ppqpos, string bytestr)
Boolean RPR_MIDI_InsertEvt(MediaItem_Take take, Boolean selected, Boolean muted, Float ppqpos, String bytestr, Int bytestr_sz)

Insert a new MIDI event.

bool MIDI_InsertNote(MediaItem_Take* take, bool selected, bool muted, double startppqpos, double endppqpos, int chan, int pitch, int vel, const bool* noSortInOptional)
bool MIDI_InsertNote(MediaItem_Take take, bool selected, bool muted, startppqpos, endppqpos, int chan, int pitch, int vel, optional bool noSortIn)
boolean reaper.MIDI_InsertNote(MediaItem_Take take, boolean selected, boolean muted, number startppqpos, number endppqpos, integer chan, integer pitch, integer vel, optional boolean noSortIn)
Boolean RPR_MIDI_InsertNote(MediaItem_Take take, Boolean selected, Boolean muted, Float startppqpos, Float endppqpos, Int chan, Int pitch, Int vel, const bool noSortInOptional)

Insert a new MIDI note. Set noSort if inserting multiple events, then call MIDI_Sort when done.

bool MIDI_InsertTextSysexEvt(MediaItem_Take* take, bool selected, bool muted, double ppqpos, int type, const char* bytestr, int bytestr_sz)
bool MIDI_InsertTextSysexEvt(MediaItem_Take take, bool selected, bool muted, ppqpos, int type, "bytestr")
boolean reaper.MIDI_InsertTextSysexEvt(MediaItem_Take take, boolean selected, boolean muted, number ppqpos, integer type, string bytestr)
Boolean RPR_MIDI_InsertTextSysexEvt(MediaItem_Take take, Boolean selected, Boolean muted, Float ppqpos, Int type, String bytestr, Int bytestr_sz)

Insert a new MIDI text or sysex event. Allowable types are -1:sysex (msg should not include bounding F0..F7), 1-7:MIDI text event types.

void midi_reinit()
midi_reinit()
reaper.midi_reinit()
RPR_midi_reinit()

Reset all MIDI devices

void MIDI_SelectAll(MediaItem_Take* take, bool select)
MIDI_SelectAll(MediaItem_Take take, bool select)
reaper.MIDI_SelectAll(MediaItem_Take take, boolean select)
RPR_MIDI_SelectAll(MediaItem_Take take, Boolean select)

Select or deselect all MIDI content.

bool MIDI_SetAllEvts(MediaItem_Take* take, const char* buf, int buf_sz)
bool MIDI_SetAllEvts(MediaItem_Take take, "buf")
boolean reaper.MIDI_SetAllEvts(MediaItem_Take take, string buf)
Boolean RPR_MIDI_SetAllEvts(MediaItem_Take take, String buf, Int buf_sz)

Set all MIDI data. MIDI buffer is passed in as a list of { int offset, char flag, int msglen, unsigned char msg[] }. offset: MIDI ticks from previous event, flag: &1=selected &2=muted, msglen: byte length of msg (usually 3), msg: the MIDI message. For tick intervals longer than a 32 bit word can represent, zero-length meta events may be placed between valid events. See MIDI_GetAllEvts.

bool MIDI_SetCC(MediaItem_Take* take, int ccidx, const bool* selectedInOptional, const bool* mutedInOptional, const double* ppqposInOptional, const int* chanmsgInOptional, const int* chanInOptional, const int* msg2InOptional, const int* msg3InOptional, const bool* noSortInOptional)
bool MIDI_SetCC(MediaItem_Take take, int ccidx, optional bool selectedIn, optional bool mutedIn, optional ppqposIn, optional int chanmsgIn, optional int chanIn, optional int msg2In, optional int msg3In, optional bool noSortIn)
boolean reaper.MIDI_SetCC(MediaItem_Take take, integer ccidx, optional boolean selectedIn, optional boolean mutedIn, optional number ppqposIn, optional number chanmsgIn, optional number chanIn, optional number msg2In, optional number msg3In, optional boolean noSortIn)
Boolean RPR_MIDI_SetCC(MediaItem_Take take, Int ccidx, const bool selectedInOptional, const bool mutedInOptional, const double ppqposInOptional, const int chanmsgInOptional, const int chanInOptional, const int msg2InOptional, const int msg3InOptional, const bool noSortInOptional)

Set MIDI CC event properties. Properties passed as NULL will not be set. set noSort if setting multiple events, then call MIDI_Sort when done.

bool MIDI_SetEvt(MediaItem_Take* take, int evtidx, const bool* selectedInOptional, const bool* mutedInOptional, const double* ppqposInOptional, const char* msgOptional, int msgOptional_sz, const bool* noSortInOptional)
bool MIDI_SetEvt(MediaItem_Take take, int evtidx, optional bool selectedIn, optional bool mutedIn, optional ppqposIn, optional "msg", optional bool noSortIn)
boolean reaper.MIDI_SetEvt(MediaItem_Take take, integer evtidx, optional boolean selectedIn, optional boolean mutedIn, optional number ppqposIn, optional string msg, optional boolean noSortIn)
Boolean RPR_MIDI_SetEvt(MediaItem_Take take, Int evtidx, const bool selectedInOptional, const bool mutedInOptional, const double ppqposInOptional, String msgOptional, Int msgOptional_sz, const bool noSortInOptional)

Set MIDI event properties. Properties passed as NULL will not be set. set noSort if setting multiple events, then call MIDI_Sort when done.

bool MIDI_SetItemExtents(MediaItem* item, double startQN, double endQN)
bool MIDI_SetItemExtents(MediaItem item, startQN, endQN)
boolean reaper.MIDI_SetItemExtents(MediaItem item, number startQN, number endQN)
Boolean RPR_MIDI_SetItemExtents(MediaItem item, Float startQN, Float endQN)

Set the start/end positions of a media item that contains a MIDI take.

bool MIDI_SetNote(MediaItem_Take* take, int noteidx, const bool* selectedInOptional, const bool* mutedInOptional, const double* startppqposInOptional, const double* endppqposInOptional, const int* chanInOptional, const int* pitchInOptional, const int* velInOptional, const bool* noSortInOptional)
bool MIDI_SetNote(MediaItem_Take take, int noteidx, optional bool selectedIn, optional bool mutedIn, optional startppqposIn, optional endppqposIn, optional int chanIn, optional int pitchIn, optional int velIn, optional bool noSortIn)
boolean reaper.MIDI_SetNote(MediaItem_Take take, integer noteidx, optional boolean selectedIn, optional boolean mutedIn, optional number startppqposIn, optional number endppqposIn, optional number chanIn, optional number pitchIn, optional number velIn, optional boolean noSortIn)
Boolean RPR_MIDI_SetNote(MediaItem_Take take, Int noteidx, const bool selectedInOptional, const bool mutedInOptional, const double startppqposInOptional, const double endppqposInOptional, const int chanInOptional, const int pitchInOptional, const int velInOptional, const bool noSortInOptional)

Set MIDI note properties. Properties passed as NULL (or negative values) will not be set. Set noSort if setting multiple events, then call MIDI_Sort when done. Setting multiple note start positions at once is done more safely by deleting and re-inserting the notes.

bool MIDI_SetTextSysexEvt(MediaItem_Take* take, int textsyxevtidx, const bool* selectedInOptional, const bool* mutedInOptional, const double* ppqposInOptional, const int* typeInOptional, const char* msgOptional, int msgOptional_sz, const bool* noSortInOptional)
bool MIDI_SetTextSysexEvt(MediaItem_Take take, int textsyxevtidx, optional bool selectedIn, optional bool mutedIn, optional ppqposIn, optional int typeIn, optional "msg", optional bool noSortIn)
boolean reaper.MIDI_SetTextSysexEvt(MediaItem_Take take, integer textsyxevtidx, optional boolean selectedIn, optional boolean mutedIn, optional number ppqposIn, optional number typeIn, optional string msg, optional boolean noSortIn)
Boolean RPR_MIDI_SetTextSysexEvt(MediaItem_Take take, Int textsyxevtidx, const bool selectedInOptional, const bool mutedInOptional, const double ppqposInOptional, const int typeInOptional, String msgOptional, Int msgOptional_sz, const bool noSortInOptional)

Set MIDI text or sysex event properties. Properties passed as NULL will not be set. Allowable types are -1:sysex (msg should not include bounding F0..F7), 1-7:MIDI text event types. set noSort if setting multiple events, then call MIDI_Sort when done.

void MIDI_Sort(MediaItem_Take* take)
MIDI_Sort(MediaItem_Take take)
reaper.MIDI_Sort(MediaItem_Take take)
RPR_MIDI_Sort(MediaItem_Take take)

Sort MIDI events after multiple calls to MIDI_SetNote, MIDI_SetCC, etc.

HWND MIDIEditor_GetActive()
HWND MIDIEditor_GetActive()
HWND reaper.MIDIEditor_GetActive()
HWND RPR_MIDIEditor_GetActive()
get a pointer to the focused MIDI editor window

see MIDIEditor_GetMode, MIDIEditor_OnCommand

int MIDIEditor_GetMode(HWND midieditor)
int MIDIEditor_GetMode(HWND midieditor)
integer reaper.MIDIEditor_GetMode(HWND midieditor)
Int RPR_MIDIEditor_GetMode(HWND midieditor)
get the mode of a MIDI editor (0=piano roll, 1=event list, -1=invalid editor)

see MIDIEditor_GetActive, MIDIEditor_OnCommand

int MIDIEditor_GetSetting_int(HWND midieditor, const char* setting_desc)
int MIDIEditor_GetSetting_int(HWND midieditor, "setting_desc")
integer reaper.MIDIEditor_GetSetting_int(HWND midieditor, string setting_desc)
Int RPR_MIDIEditor_GetSetting_int(HWND midieditor, String setting_desc)
Get settings from a MIDI editor. setting_desc can be:
snap_enabled: returns 0 or 1
active_note_row: returns 0-127
last_clicked_cc_lane: returns 0-127=CC, 0x100|(0-31)=14-bit CC, 0x200=velocity, 0x201=pitch, 0x202=program, 0x203=channel pressure, 0x204=bank/program select, 0x205=text, 0x206=sysex, 0x207=off velocity
default_note_vel: returns 0-127
default_note_chan: returns 0-15
default_note_len: returns default length in MIDI ticks
scale_enabled: returns 0-1
scale_root: returns 0-12 (0=C)
if setting_desc is unsupported, the function returns -1.
See MIDIEditor_GetActive, MIDIEditor_GetSetting_str
bool MIDIEditor_GetSetting_str(HWND midieditor, const char* setting_desc, char* buf, int buf_sz)
bool MIDIEditor_GetSetting_str(HWND midieditor, "setting_desc", #buf)
boolean retval, string buf = reaper.MIDIEditor_GetSetting_str(HWND midieditor, string setting_desc, string buf)
(Boolean retval, HWND midieditor, String setting_desc, String buf, Int buf_sz) = RPR_MIDIEditor_GetSetting_str(midieditor, setting_desc, buf, buf_sz)
Get settings from a MIDI editor. setting_desc can be:
last_clicked_cc_lane: returns text description ("velocity", "pitch", etc)
scale: returns the scale record, for example "102034050607" for a major scale
if setting_desc is unsupported, the function returns false.
See MIDIEditor_GetActive, MIDIEditor_GetSetting_int
MediaItem_Take* MIDIEditor_GetTake(HWND midieditor)
MediaItem_Take MIDIEditor_GetTake(HWND midieditor)
MediaItem_Take reaper.MIDIEditor_GetTake(HWND midieditor)
MediaItem_Take RPR_MIDIEditor_GetTake(HWND midieditor)

get the take that is currently being edited in this MIDI editor

bool MIDIEditor_LastFocused_OnCommand(int command_id, bool islistviewcommand)
bool MIDIEditor_LastFocused_OnCommand(int command_id, bool islistviewcommand)
boolean reaper.MIDIEditor_LastFocused_OnCommand(integer command_id, boolean islistviewcommand)
Boolean RPR_MIDIEditor_LastFocused_OnCommand(Int command_id, Boolean islistviewcommand)
Send an action command to the last focused MIDI editor. Returns false if there is no MIDI editor open, or if the view mode (piano roll or event list) does not match the input.

see MIDIEditor_OnCommand

bool MIDIEditor_OnCommand(HWND midieditor, int command_id)
bool MIDIEditor_OnCommand(HWND midieditor, int command_id)
boolean reaper.MIDIEditor_OnCommand(HWND midieditor, integer command_id)
Boolean RPR_MIDIEditor_OnCommand(HWND midieditor, Int command_id)
Send an action command to a MIDI editor. Returns false if the supplied MIDI editor pointer is not valid (not an open MIDI editor).

see MIDIEditor_GetActive, MIDIEditor_LastFocused_OnCommand

void mkpanstr(char* strNeed64, double pan)
mkpanstr(#strNeed64, pan)
string strNeed64 = reaper.mkpanstr(string strNeed64, number pan)
(String strNeed64, Float pan) = RPR_mkpanstr(strNeed64, pan)
void mkvolpanstr(char* strNeed64, double vol, double pan)
mkvolpanstr(#strNeed64, vol, pan)
string strNeed64 = reaper.mkvolpanstr(string strNeed64, number vol, number pan)
(String strNeed64, Float vol, Float pan) = RPR_mkvolpanstr(strNeed64, vol, pan)
void mkvolstr(char* strNeed64, double vol)
mkvolstr(#strNeed64, vol)
string strNeed64 = reaper.mkvolstr(string strNeed64, number vol)
(String strNeed64, Float vol) = RPR_mkvolstr(strNeed64, vol)
void MoveEditCursor(double adjamt, bool dosel)
MoveEditCursor(adjamt, bool dosel)
reaper.MoveEditCursor(number adjamt, boolean dosel)
RPR_MoveEditCursor(Float adjamt, Boolean dosel)
bool MoveMediaItemToTrack(MediaItem* item, MediaTrack* desttr)
bool MoveMediaItemToTrack(MediaItem item, MediaTrack desttr)
boolean reaper.MoveMediaItemToTrack(MediaItem item, MediaTrack desttr)
Boolean RPR_MoveMediaItemToTrack(MediaItem item, MediaTrack desttr)

returns TRUE if move succeeded

void MuteAllTracks(bool mute)
MuteAllTracks(bool mute)
reaper.MuteAllTracks(boolean mute)
RPR_MuteAllTracks(Boolean mute)
void my_getViewport(RECT* r, const RECT* sr, bool wantWorkArea)
my_getViewport(int &r.left, int &r.top, int &r.right, int &r.bot, int sr.left, int sr.top, int sr.right, int sr.bot, bool wantWorkArea)
reaper.my_getViewport(numberr.left, numberr.top, numberr.right, numberr.bot, number sr.left, number sr.top, number sr.right, number sr.bot, boolean wantWorkArea)
RPR_my_getViewport(RECT r, const RECT sr, Boolean wantWorkArea)
int NamedCommandLookup(const char* command_name)
int NamedCommandLookup("command_name")
integer reaper.NamedCommandLookup(string command_name)
Int RPR_NamedCommandLookup(String command_name)

Get the command ID number for named command that was registered by an extension such as "_SWS_ABOUT" or "_113088d11ae641c193a2b7ede3041ad5" for a ReaScript or a custom action.

void OnPauseButton()
OnPauseButton()
reaper.OnPauseButton()
RPR_OnPauseButton()

direct way to simulate pause button hit

void OnPauseButtonEx(ReaProject* proj)
OnPauseButtonEx(ReaProject proj)
reaper.OnPauseButtonEx(ReaProject proj)
RPR_OnPauseButtonEx(ReaProject proj)

direct way to simulate pause button hit

void OnPlayButton()
OnPlayButton()
reaper.OnPlayButton()
RPR_OnPlayButton()

direct way to simulate play button hit

void OnPlayButtonEx(ReaProject* proj)
OnPlayButtonEx(ReaProject proj)
reaper.OnPlayButtonEx(ReaProject proj)
RPR_OnPlayButtonEx(ReaProject proj)

direct way to simulate play button hit

void OnStopButton()
OnStopButton()
reaper.OnStopButton()
RPR_OnStopButton()

direct way to simulate stop button hit

void OnStopButtonEx(ReaProject* proj)
OnStopButtonEx(ReaProject proj)
reaper.OnStopButtonEx(ReaProject proj)
RPR_OnStopButtonEx(ReaProject proj)

direct way to simulate stop button hit

bool OpenColorThemeFile(const char* fn)
bool OpenColorThemeFile("fn")
boolean reaper.OpenColorThemeFile(string fn)
Boolean RPR_OpenColorThemeFile(String fn)
HWND OpenMediaExplorer(const char* mediafn, bool play)
HWND OpenMediaExplorer("mediafn", bool play)
HWND reaper.OpenMediaExplorer(string mediafn, boolean play)
HWND RPR_OpenMediaExplorer(String mediafn, Boolean play)

Opens mediafn in the Media Explorer, play=true will play the file immediately (or toggle playback if mediafn was already open), =false will just select it.

void OscLocalMessageToHost(const char* message, const double* valueInOptional)
OscLocalMessageToHost("message", optional valueIn)
reaper.OscLocalMessageToHost(string message, optional number valueIn)
RPR_OscLocalMessageToHost(String message, const double valueInOptional)

Send an OSC message directly to REAPER. The value argument may be NULL. The message will be matched against the default OSC patterns. Only supported if control surface support was enabled when installing REAPER.

double parse_timestr(const char* buf)
double parse_timestr("buf")
number reaper.parse_timestr(string buf)
Float RPR_parse_timestr(String buf)

Parse hh:mm:ss.sss time string, return time in seconds (or 0.0 on error). See parse_timestr_pos, parse_timestr_len.

double parse_timestr_len(const char* buf, double offset, int modeoverride)
double parse_timestr_len("buf", offset, int modeoverride)
number reaper.parse_timestr_len(string buf, number offset, integer modeoverride)
Float RPR_parse_timestr_len(String buf, Float offset, Int modeoverride)
time formatting mode overrides: -1=proj default.
0=time
1=measures.beats + time
2=measures.beats
3=seconds
4=samples
5=h:m:s:f
double parse_timestr_pos(const char* buf, int modeoverride)
double parse_timestr_pos("buf", int modeoverride)
number reaper.parse_timestr_pos(string buf, integer modeoverride)
Float RPR_parse_timestr_pos(String buf, Int modeoverride)
Parse time string, time formatting mode overrides: -1=proj default.
0=time
1=measures.beats + time
2=measures.beats
3=seconds
4=samples
5=h:m:s:f
double parsepanstr(const char* str)
double parsepanstr("str")
number reaper.parsepanstr(string str)
Float RPR_parsepanstr(String str)
unsigned int PCM_Sink_Enum(int idx, const char** descstrOut)
uint PCM_Sink_Enum(int idx, #descstr)
integer retval, string descstr = reaper.PCM_Sink_Enum(integer idx)
Unknown RPR_PCM_Sink_Enum(Int idx, String descstrOut)
const char* PCM_Sink_GetExtension(const char* data, int data_sz)
bool PCM_Sink_GetExtension(#retval, "data")
string reaper.PCM_Sink_GetExtension(string data)
String RPR_PCM_Sink_GetExtension(String data, Int data_sz)
HWND PCM_Sink_ShowConfig(const char* cfg, int cfg_sz, HWND hwndParent)
HWND PCM_Sink_ShowConfig("cfg", HWND hwndParent)
HWND reaper.PCM_Sink_ShowConfig(string cfg, HWND hwndParent)
HWND RPR_PCM_Sink_ShowConfig(String cfg, Int cfg_sz, HWND hwndParent)
PCM_source* PCM_Source_CreateFromFile(const char* filename)
PCM_source PCM_Source_CreateFromFile("filename")
PCM_source reaper.PCM_Source_CreateFromFile(string filename)
PCM_source RPR_PCM_Source_CreateFromFile(String filename)

See PCM_Source_CreateFromFileEx.

PCM_source* PCM_Source_CreateFromFileEx(const char* filename, bool forcenoMidiImp)
PCM_source PCM_Source_CreateFromFileEx("filename", bool forcenoMidiImp)
PCM_source reaper.PCM_Source_CreateFromFileEx(string filename, boolean forcenoMidiImp)
PCM_source RPR_PCM_Source_CreateFromFileEx(String filename, Boolean forcenoMidiImp)

Create a PCM_source from filename, and override pref of MIDI files being imported as in-project MIDI events.

PCM_source* PCM_Source_CreateFromType(const char* sourcetype)
PCM_source PCM_Source_CreateFromType("sourcetype")
PCM_source reaper.PCM_Source_CreateFromType(string sourcetype)
PCM_source RPR_PCM_Source_CreateFromType(String sourcetype)
Create a PCM_source from a "type" (use this if you're going to load its state via LoadState/ProjectStateContext).

Valid types include "WAVE", "MIDI", or whatever plug-ins define as well.

void PCM_Source_Destroy(PCM_source* src)
PCM_Source_Destroy(PCM_source src)
reaper.PCM_Source_Destroy(PCM_source src)
RPR_PCM_Source_Destroy(PCM_source src)

Deletes a PCM_source -- be sure that you remove any project reference before deleting a source

int PCM_Source_GetPeaks(PCM_source* src, double peakrate, double starttime, int numchannels, int numsamplesperchannel, int want_extra_type, double* buf)
int PCM_Source_GetPeaks(PCM_source src, peakrate, starttime, int numchannels, int numsamplesperchannel, int want_extra_type, buffer_ptr buf)
integer reaper.PCM_Source_GetPeaks(PCM_source src, number peakrate, number starttime, integer numchannels, integer numsamplesperchannel, integer want_extra_type, reaper.array buf)
(Int retval, PCM_source src, Float peakrate, Float starttime, Int numchannels, Int numsamplesperchannel, Int want_extra_type, Float buf) = RPR_PCM_Source_GetPeaks(src, peakrate, starttime, numchannels, numsamplesperchannel, want_extra_type, buf)

Gets block of peak samples to buf. Note that the peak samples are interleaved, but in two or three blocks (maximums, then minimums, then extra). Return value has 20 bits of returned sample count, then 4 bits of output_mode (0xf00000), then a bit to signify whether extra_type was available (0x1000000). extra_type can be 115 ('s') for spectral information, which will return peak samples as integers with the low 15 bits frequency, next 14 bits tonality.

bool PCM_Source_GetSectionInfo(PCM_source* src, double* offsOut, double* lenOut, bool* revOut)
bool PCM_Source_GetSectionInfo(PCM_source src, &offs, &len, bool &rev)
boolean retval, number offs, number len, boolean rev = reaper.PCM_Source_GetSectionInfo(PCM_source src)
(Boolean retval, PCM_source src, Float offsOut, Float lenOut, Boolean revOut) = RPR_PCM_Source_GetSectionInfo(src, offsOut, lenOut, revOut)

If a section/reverse block, retrieves offset/len/reverse. return true if success

void PluginWantsAlwaysRunFx(int amt)
PluginWantsAlwaysRunFx(int amt)
reaper.PluginWantsAlwaysRunFx(integer amt)
RPR_PluginWantsAlwaysRunFx(Int amt)
void PreventUIRefresh(int prevent_count)
PreventUIRefresh(int prevent_count)
reaper.PreventUIRefresh(integer prevent_count)
RPR_PreventUIRefresh(Int prevent_count)

adds prevent_count to the UI refresh prevention state; always add then remove the same amount, or major disfunction will occur

void ReaScriptError(const char* errmsg)
ReaScriptError("errmsg")
reaper.ReaScriptError(string errmsg)
RPR_ReaScriptError(String errmsg)

Causes REAPER to display the error message after the current ReaScript finishes.

int RecursiveCreateDirectory(const char* path, size_t ignored)
int RecursiveCreateDirectory("path", size_t ignored)
integer reaper.RecursiveCreateDirectory(string path, integer ignored)
Int RPR_RecursiveCreateDirectory(String path, Unknown ignored)

returns positive value on success, 0 on failure.

void RefreshToolbar(int command_id)
RefreshToolbar(int command_id)
reaper.RefreshToolbar(integer command_id)
RPR_RefreshToolbar(Int command_id)

See RefreshToolbar2.

void RefreshToolbar2(int section_id, int command_id)
RefreshToolbar2(int section_id, int command_id)
reaper.RefreshToolbar2(integer section_id, integer command_id)
RPR_RefreshToolbar2(Int section_id, Int command_id)

Refresh the toolbar button states of a toggle action.

void relative_fn(const char* in, char* out, int out_sz)
relative_fn("in", #out)
string out = reaper.relative_fn(string in, string out)
(String in, String out, Int out_sz) = RPR_relative_fn(in, out, out_sz)

Makes a filename "in" relative to the current project, if any.

bool RemoveTrackSend(MediaTrack* tr, int category, int sendidx)
bool RemoveTrackSend(MediaTrack tr, int category, int sendidx)
boolean reaper.RemoveTrackSend(MediaTrack tr, integer category, integer sendidx)
Boolean RPR_RemoveTrackSend(MediaTrack tr, Int category, Int sendidx)

Remove a send/receive/hardware output, return true on success. category is <0 for receives, 0=sends, >0 for hardware outputs. See CreateTrackSend, GetSetTrackSendInfo, GetTrackSendInfo_Value, SetTrackSendInfo_Value, GetTrackNumSends.

bool RenderFileSection(const char* source_filename, const char* target_filename, double start_percent, double end_percent, double playrate)
bool RenderFileSection("source_filename", "target_filename", start_percent, end_percent, playrate)
boolean reaper.RenderFileSection(string source_filename, string target_filename, number start_percent, number end_percent, number playrate)
Boolean RPR_RenderFileSection(String source_filename, String target_filename, Float start_percent, Float end_percent, Float playrate)

Not available while playing back.

bool ReorderSelectedTracks(int beforeTrackIdx, int makePrevFolder)
bool ReorderSelectedTracks(int beforeTrackIdx, int makePrevFolder)
boolean reaper.ReorderSelectedTracks(integer beforeTrackIdx, integer makePrevFolder)
Boolean RPR_ReorderSelectedTracks(Int beforeTrackIdx, Int makePrevFolder)

Moves all selected tracks to immediately above track specified by index beforeTrackIdx, returns false if no tracks were selected. makePrevFolder=0 for normal, 1 = as child of track preceding track specified by beforeTrackIdx, 2 = if track preceding track specified by beforeTrackIdx is last track in folder, extend folder

const char* Resample_EnumModes(int mode)
bool Resample_EnumModes(#retval, int mode)
string reaper.Resample_EnumModes(integer mode)
String RPR_Resample_EnumModes(Int mode)
void resolve_fn(const char* in, char* out, int out_sz)
resolve_fn("in", #out)
string out = reaper.resolve_fn(string in, string out)
(String in, String out, Int out_sz) = RPR_resolve_fn(in, out, out_sz)

See resolve_fn2.

void resolve_fn2(const char* in, char* out, int out_sz, const char* checkSubDirOptional)
resolve_fn2("in", #out, optional "checkSubDir")
string out = reaper.resolve_fn2(string in, string out, optional string checkSubDir)
(String in, String out, Int out_sz, String checkSubDirOptional) = RPR_resolve_fn2(in, out, out_sz, checkSubDirOptional)

Resolves a filename "in" by using project settings etc. If no file found, out will be a copy of in.

const char* ReverseNamedCommandLookup(int command_id)
bool ReverseNamedCommandLookup(#retval, int command_id)
string reaper.ReverseNamedCommandLookup(integer command_id)
String RPR_ReverseNamedCommandLookup(Int command_id)

Get the named command for the given command ID. The returned string will not start with '_' (e.g. it will return "SWS_ABOUT"), it will be NULL if command_id is a native action.

double ScaleFromEnvelopeMode(int scaling_mode, double val)
double ScaleFromEnvelopeMode(int scaling_mode, val)
number reaper.ScaleFromEnvelopeMode(integer scaling_mode, number val)
Float RPR_ScaleFromEnvelopeMode(Int scaling_mode, Float val)

See GetEnvelopeScalingMode.

double ScaleToEnvelopeMode(int scaling_mode, double val)
double ScaleToEnvelopeMode(int scaling_mode, val)
number reaper.ScaleToEnvelopeMode(integer scaling_mode, number val)
Float RPR_ScaleToEnvelopeMode(Int scaling_mode, Float val)

See GetEnvelopeScalingMode.

void SelectAllMediaItems(ReaProject* proj, bool selected)
SelectAllMediaItems(ReaProject proj, bool selected)
reaper.SelectAllMediaItems(ReaProject proj, boolean selected)
RPR_SelectAllMediaItems(ReaProject proj, Boolean selected)
void SelectProjectInstance(ReaProject* proj)
SelectProjectInstance(ReaProject proj)
reaper.SelectProjectInstance(ReaProject proj)
RPR_SelectProjectInstance(ReaProject proj)
void SetActiveTake(MediaItem_Take* take)
SetActiveTake(MediaItem_Take take)
reaper.SetActiveTake(MediaItem_Take take)
RPR_SetActiveTake(MediaItem_Take take)

set this take active in this media item

void SetAutomationMode(int mode, bool onlySel)
SetAutomationMode(int mode, bool onlySel)
reaper.SetAutomationMode(integer mode, boolean onlySel)
RPR_SetAutomationMode(Int mode, Boolean onlySel)

sets all or selected tracks to mode.

void SetCurrentBPM(ReaProject* __proj, double bpm, bool wantUndo)
SetCurrentBPM(ReaProject __proj, bpm, bool wantUndo)
reaper.SetCurrentBPM(ReaProject __proj, number bpm, boolean wantUndo)
RPR_SetCurrentBPM(ReaProject __proj, Float bpm, Boolean wantUndo)

set current BPM in project, set wantUndo=true to add undo point

void SetCursorContext(int mode, TrackEnvelope* envInOptional)
SetCursorContext(int mode, TrackEnvelope envIn)
reaper.SetCursorContext(integer mode, TrackEnvelope envIn)
RPR_SetCursorContext(Int mode, TrackEnvelope envInOptional)

You must use this to change the focus programmatically. mode=0 to focus track panels, 1 to focus the arrange window, 2 to focus the arrange window and select env (or env==NULL to clear the current track/take envelope selection)

void SetEditCurPos(double time, bool moveview, bool seekplay)
SetEditCurPos(time, bool moveview, bool seekplay)
reaper.SetEditCurPos(number time, boolean moveview, boolean seekplay)
RPR_SetEditCurPos(Float time, Boolean moveview, Boolean seekplay)
void SetEditCurPos2(ReaProject* proj, double time, bool moveview, bool seekplay)
SetEditCurPos2(ReaProject proj, time, bool moveview, bool seekplay)
reaper.SetEditCurPos2(ReaProject proj, number time, boolean moveview, boolean seekplay)
RPR_SetEditCurPos2(ReaProject proj, Float time, Boolean moveview, Boolean seekplay)
bool SetEnvelopePoint(TrackEnvelope* envelope, int ptidx, double* timeInOptional, double* valueInOptional, int* shapeInOptional, double* tensionInOptional, bool* selectedInOptional, bool* noSortInOptional)
bool SetEnvelopePoint(TrackEnvelope envelope, int ptidx, optional timeIn, optional valueIn, optional int shapeIn, optional tensionIn, optional bool selectedIn, optional bool noSortIn)
boolean reaper.SetEnvelopePoint(TrackEnvelope envelope, integer ptidx, optional number timeIn, optional number valueIn, optional number shapeIn, optional number tensionIn, optional boolean selectedIn, optional boolean noSortIn)
(Boolean retval, TrackEnvelope envelope, Int ptidx, Float timeInOptional, Float valueInOptional, Int shapeInOptional, Float tensionInOptional, Boolean selectedInOptional, Boolean noSortInOptional) = RPR_SetEnvelopePoint(envelope, ptidx, timeInOptional, valueInOptional, shapeInOptional, tensionInOptional, selectedInOptional, noSortInOptional)

Set attributes of an envelope point. Values that are not supplied will be ignored. If setting multiple points at once, set noSort=true, and call Envelope_SortPoints when done. See GetEnvelopePoint, InsertEnvelopePoint, GetEnvelopeScalingMode.

bool SetEnvelopePointEx(TrackEnvelope* envelope, int autoitem_idx, int ptidx, double* timeInOptional, double* valueInOptional, int* shapeInOptional, double* tensionInOptional, bool* selectedInOptional, bool* noSortInOptional)
bool SetEnvelopePointEx(TrackEnvelope envelope, int autoitem_idx, int ptidx, optional timeIn, optional valueIn, optional int shapeIn, optional tensionIn, optional bool selectedIn, optional bool noSortIn)
boolean reaper.SetEnvelopePointEx(TrackEnvelope envelope, integer autoitem_idx, integer ptidx, optional number timeIn, optional number valueIn, optional number shapeIn, optional number tensionIn, optional boolean selectedIn, optional boolean noSortIn)
(Boolean retval, TrackEnvelope envelope, Int autoitem_idx, Int ptidx, Float timeInOptional, Float valueInOptional, Int shapeInOptional, Float tensionInOptional, Boolean selectedInOptional, Boolean noSortInOptional) = RPR_SetEnvelopePointEx(envelope, autoitem_idx, ptidx, timeInOptional, valueInOptional, shapeInOptional, tensionInOptional, selectedInOptional, noSortInOptional)

Set attributes of an envelope point. Values that are not supplied will be ignored. If setting multiple points at once, set noSort=true, and call Envelope_SortPoints when done. Tautoitem_idx==-1 for the underlying envelope, 0 for the first automation item on the envelope, etc. See GetEnvelopePoint, InsertEnvelopePoint, GetEnvelopeScalingMode.

bool SetEnvelopeStateChunk(TrackEnvelope* env, const char* str, bool isundoOptional)
bool SetEnvelopeStateChunk(TrackEnvelope env, "str", bool isundo)
boolean reaper.SetEnvelopeStateChunk(TrackEnvelope env, string str, boolean isundo)
Boolean RPR_SetEnvelopeStateChunk(TrackEnvelope env, String str, Boolean isundoOptional)

Sets the RPPXML state of an envelope, returns true if successful. Undo flag is a performance/caching hint.

void SetExtState(const char* section, const char* key, const char* value, bool persist)
SetExtState("section", "key", "value", bool persist)
reaper.SetExtState(string section, string key, string value, boolean persist)
RPR_SetExtState(String section, String key, String value, Boolean persist)

Set the extended state value for a specific section and key. persist=true means the value should be stored and reloaded the next time REAPER is opened. See GetExtState, DeleteExtState, HasExtState.

void SetGlobalAutomationOverride(int mode)
SetGlobalAutomationOverride(int mode)
reaper.SetGlobalAutomationOverride(integer mode)
RPR_SetGlobalAutomationOverride(Int mode)

mode: see GetGlobalAutomationOverride

bool SetItemStateChunk(MediaItem* item, const char* str, bool isundoOptional)
bool SetItemStateChunk(MediaItem item, "str", bool isundo)
boolean reaper.SetItemStateChunk(MediaItem item, string str, boolean isundo)
Boolean RPR_SetItemStateChunk(MediaItem item, String str, Boolean isundoOptional)

Sets the RPPXML state of an item, returns true if successful. Undo flag is a performance/caching hint.

int SetMasterTrackVisibility(int flag)
int SetMasterTrackVisibility(int flag)
integer reaper.SetMasterTrackVisibility(integer flag)
Int RPR_SetMasterTrackVisibility(Int flag)

set &1 to show the master track in the TCP, &2 to show in the mixer. Returns the previous visibility state. See GetMasterTrackVisibility.

bool SetMediaItemInfo_Value(MediaItem* item, const char* parmname, double newvalue)
bool SetMediaItemInfo_Value(MediaItem item, "parmname", newvalue)
boolean reaper.SetMediaItemInfo_Value(MediaItem item, string parmname, number newvalue)
Boolean RPR_SetMediaItemInfo_Value(MediaItem item, String parmname, Float newvalue)
Set media item numerical-value attributes.
B_MUTE : bool * to muted state
B_LOOPSRC : bool * to loop source
B_ALLTAKESPLAY : bool * to all takes play
B_UISEL : bool * to ui selected
C_BEATATTACHMODE : char * to one char of beat attached mode, -1=def, 0=time, 1=allbeats, 2=beatsosonly
C_LOCK : char * to one char of lock flags (&1 is locked, currently)
D_VOL : double * of item volume (volume bar)
D_POSITION : double * of item position (seconds)
D_LENGTH : double * of item length (seconds)
D_SNAPOFFSET : double * of item snap offset (seconds)
D_FADEINLEN : double * of item fade in length (manual, seconds)
D_FADEOUTLEN : double * of item fade out length (manual, seconds)
D_FADEINDIR : double * of item fade in curve [-1; 1]
D_FADEOUTDIR : double * of item fade out curve [-1; 1]
D_FADEINLEN_AUTO : double * of item autofade in length (seconds, -1 for no autofade set)
D_FADEOUTLEN_AUTO : double * of item autofade out length (seconds, -1 for no autofade set)
C_FADEINSHAPE : int * to fadein shape, 0=linear, ...
C_FADEOUTSHAPE : int * to fadeout shape
I_GROUPID : int * to group ID (0 = no group)
I_LASTY : int * to last y position in track (readonly)
I_LASTH : int * to last height in track (readonly)
I_CUSTOMCOLOR : int * : custom color, OS dependent color|0x100000 (i.e. ColorToNative(r,g,b)|0x100000). If you do not |0x100000, then it will not be used (though will store the color anyway).
I_CURTAKE : int * to active take
IP_ITEMNUMBER : int, item number within the track (read-only, returns the item number directly)
F_FREEMODE_Y : float * to free mode y position (0..1)
F_FREEMODE_H : float * to free mode height (0..1)
bool SetMediaItemLength(MediaItem* item, double length, bool refreshUI)
bool SetMediaItemLength(MediaItem item, length, bool refreshUI)
boolean reaper.SetMediaItemLength(MediaItem item, number length, boolean refreshUI)
Boolean RPR_SetMediaItemLength(MediaItem item, Float length, Boolean refreshUI)
Redraws the screen only if refreshUI == true.

See UpdateArrange().

bool SetMediaItemPosition(MediaItem* item, double position, bool refreshUI)
bool SetMediaItemPosition(MediaItem item, position, bool refreshUI)
boolean reaper.SetMediaItemPosition(MediaItem item, number position, boolean refreshUI)
Boolean RPR_SetMediaItemPosition(MediaItem item, Float position, Boolean refreshUI)
Redraws the screen only if refreshUI == true.

See UpdateArrange().

void SetMediaItemSelected(MediaItem* item, bool selected)
SetMediaItemSelected(MediaItem item, bool selected)
reaper.SetMediaItemSelected(MediaItem item, boolean selected)
RPR_SetMediaItemSelected(MediaItem item, Boolean selected)
bool SetMediaItemTake_Source(MediaItem_Take* take, PCM_source* source)
bool SetMediaItemTake_Source(MediaItem_Take take, PCM_source source)
boolean reaper.SetMediaItemTake_Source(MediaItem_Take take, PCM_source source)
Boolean RPR_SetMediaItemTake_Source(MediaItem_Take take, PCM_source source)

Set media source of media item take

bool SetMediaItemTakeInfo_Value(MediaItem_Take* take, const char* parmname, double newvalue)
bool SetMediaItemTakeInfo_Value(MediaItem_Take take, "parmname", newvalue)
boolean reaper.SetMediaItemTakeInfo_Value(MediaItem_Take take, string parmname, number newvalue)
Boolean RPR_SetMediaItemTakeInfo_Value(MediaItem_Take take, String parmname, Float newvalue)
Set media item take numerical-value attributes.
D_STARTOFFS : double *, start offset in take of item
D_VOL : double *, take volume
D_PAN : double *, take pan
D_PANLAW : double *, take pan law (-1.0=default, 0.5=-6dB, 1.0=+0dB, etc)
D_PLAYRATE : double *, take playrate (1.0=normal, 2.0=doublespeed, etc)
D_PITCH : double *, take pitch adjust (in semitones, 0.0=normal, +12 = one octave up, etc)
B_PPITCH, bool *, preserve pitch when changing rate
I_CHANMODE, int *, channel mode (0=normal, 1=revstereo, 2=downmix, 3=l, 4=r)
I_PITCHMODE, int *, pitch shifter mode, -1=proj default, otherwise high word=shifter low word = parameter
I_CUSTOMCOLOR : int *, custom color, OS dependent color|0x100000 (i.e. ColorToNative(r,g,b)|0x100000). If you do not |0x100000, then it will not be used (though will store the color anyway).
IP_TAKENUMBER : int, take number within the item (read-only, returns the take number directly)
bool SetMediaTrackInfo_Value(MediaTrack* tr, const char* parmname, double newvalue)
bool SetMediaTrackInfo_Value(MediaTrack tr, "parmname", newvalue)
boolean reaper.SetMediaTrackInfo_Value(MediaTrack tr, string parmname, number newvalue)
Boolean RPR_SetMediaTrackInfo_Value(MediaTrack tr, String parmname, Float newvalue)
Set track numerical-value attributes.
B_MUTE : bool * : mute flag
B_PHASE : bool * : invert track phase
IP_TRACKNUMBER : int : track number (returns zero if not found, -1 for master track) (read-only, returns the int directly)
I_SOLO : int * : 0=not soloed, 1=solo, 2=soloed in place. also: 5=solo-safe solo, 6=solo-safe soloed in place
I_FXEN : int * : 0=fx bypassed, nonzero = fx active
I_RECARM : int * : 0=not record armed, 1=record armed
I_RECINPUT : int * : record input. <0 = no input, 0..n = mono hardware input, 512+n = rearoute input, 1024 set for stereo input pair. 4096 set for MIDI input, if set, then low 5 bits represent channel (0=all, 1-16=only chan), then next 6 bits represent physical input (63=all, 62=VKB)
I_RECMODE : int * : record mode (0=input, 1=stereo out, 2=none, 3=stereo out w/latcomp, 4=midi output, 5=mono out, 6=mono out w/ lat comp, 7=midi overdub, 8=midi replace
I_RECMON : int * : record monitor (0=off, 1=normal, 2=not when playing (tapestyle))
I_RECMONITEMS : int * : monitor items while recording (0=off, 1=on)
I_AUTOMODE : int * : track automation mode (0=trim/off, 1=read, 2=touch, 3=write, 4=latch)
I_NCHAN : int * : number of track channels, must be 2-64, even
I_SELECTED : int * : track selected? 0 or 1
I_WNDH : int * : current TCP window height (Read-only)
I_FOLDERDEPTH : int * : folder depth change (0=normal, 1=track is a folder parent, -1=track is the last in the innermost folder, -2=track is the last in the innermost and next-innermost folders, etc
I_FOLDERCOMPACT : int * : folder compacting (only valid on folders), 0=normal, 1=small, 2=tiny children
I_MIDIHWOUT : int * : track midi hardware output index (<0 for disabled, low 5 bits are which channels (0=all, 1-16), next 5 bits are output device index (0-31))
I_PERFFLAGS : int * : track perf flags (&1=no media buffering, &2=no anticipative FX)
I_CUSTOMCOLOR : int * : custom color, OS dependent color|0x100000 (i.e. ColorToNative(r,g,b)|0x100000). If you do not |0x100000, then it will not be used (though will store the color anyway).
I_HEIGHTOVERRIDE : int * : custom height override for TCP window. 0 for none, otherwise size in pixels
B_HEIGHTLOCK : bool * : track height lock (must set I_HEIGHTOVERRIDE before locking)
D_VOL : double * : trim volume of track (0 (-inf)..1 (+0dB) .. 2 (+6dB) etc ..)
D_PAN : double * : trim pan of track (-1..1)
D_WIDTH : double * : width of track (-1..1)
D_DUALPANL : double * : dualpan position 1 (-1..1), only if I_PANMODE==6
D_DUALPANR : double * : dualpan position 2 (-1..1), only if I_PANMODE==6
I_PANMODE : int * : pan mode (0 = classic 3.x, 3=new balance, 5=stereo pan, 6 = dual pan)
D_PANLAW : double * : pan law of track. <0 for project default, 1.0 for +0dB, etc
P_ENV : read only, returns TrackEnvelope *, setNewValue=<VOLENV, <PANENV, etc
B_SHOWINMIXER : bool * : show track panel in mixer -- do not use on master
B_SHOWINTCP : bool * : show track panel in tcp -- do not use on master
B_MAINSEND : bool * : track sends audio to parent
C_MAINSEND_OFFS : char * : track send to parent channel offset
B_FREEMODE : bool * : track free-mode enabled (requires UpdateTimeline() after changing etc)
C_BEATATTACHMODE : char * : char * to one char of beat attached mode, -1=def, 0=time, 1=allbeats, 2=beatsposonly
F_MCP_FXSEND_SCALE : float * : scale of fx+send area in MCP (0.0=smallest allowed, 1=max allowed)
F_MCP_SENDRGN_SCALE : float * : scale of send area as proportion of the fx+send total area (0=min allow, 1=max)
void SetMIDIEditorGrid(ReaProject* project, double division)
SetMIDIEditorGrid(ReaProject project, division)
reaper.SetMIDIEditorGrid(ReaProject project, number division)
RPR_SetMIDIEditorGrid(ReaProject project, Float division)

Set the MIDI editor grid division. 0.25=quarter note, 1.0/3.0=half note tripet, etc.

MediaTrack* SetMixerScroll(MediaTrack* leftmosttrack)
MediaTrack SetMixerScroll(MediaTrack leftmosttrack)
MediaTrack reaper.SetMixerScroll(MediaTrack leftmosttrack)
MediaTrack RPR_SetMixerScroll(MediaTrack leftmosttrack)

Scroll the mixer so that leftmosttrack is the leftmost visible track. Returns the leftmost track after scrolling, which may be different from the passed-in track if there are not enough tracks to its right.

void SetMouseModifier(const char* context, int modifier_flag, const char* action)
SetMouseModifier("context", int modifier_flag, "action")
reaper.SetMouseModifier(string context, integer modifier_flag, string action)
RPR_SetMouseModifier(String context, Int modifier_flag, String action)
Set the mouse modifier assignment for a specific modifier key assignment, in a specific context.
Context is a string like "MM_CTX_ITEM". Find these strings by modifying an assignment in
Preferences/Editing/Mouse Modifiers, then looking in reaper-mouse.ini.
Modifier flag is a number from 0 to 15: add 1 for shift, 2 for control, 4 for alt, 8 for win.
(macOS: add 1 for shift, 2 for command, 4 for opt, 8 for control.)
For left-click and double-click contexts, the action can be any built-in command ID number
or any custom action ID string. Find built-in command IDs in the REAPER actions window
(enable "show action IDs" in the context menu), and find custom action ID strings in reaper-kb.ini.
For built-in mouse modifier behaviors, find action IDs (which will be low numbers)
by modifying an assignment in Preferences/Editing/Mouse Modifiers, then looking in reaper-mouse.ini.
Assigning an action of -1 will reset that mouse modifier behavior to factory default.
See GetMouseModifier.
void SetOnlyTrackSelected(MediaTrack* track)
SetOnlyTrackSelected(MediaTrack track)
reaper.SetOnlyTrackSelected(MediaTrack track)
RPR_SetOnlyTrackSelected(MediaTrack track)

Set exactly one track selected, deselect all others

void SetProjectGrid(ReaProject* project, double division)
SetProjectGrid(ReaProject project, division)
reaper.SetProjectGrid(ReaProject project, number division)
RPR_SetProjectGrid(ReaProject project, Float division)

Set the arrange view grid division. 0.25=quarter note, 1.0/3.0=half note triplet, etc.

bool SetProjectMarker(int markrgnindexnumber, bool isrgn, double pos, double rgnend, const char* name)
bool SetProjectMarker(int markrgnindexnumber, bool isrgn, pos, rgnend, "name")
boolean reaper.SetProjectMarker(integer markrgnindexnumber, boolean isrgn, number pos, number rgnend, string name)
Boolean RPR_SetProjectMarker(Int markrgnindexnumber, Boolean isrgn, Float pos, Float rgnend, String name)
bool SetProjectMarker2(ReaProject* proj, int markrgnindexnumber, bool isrgn, double pos, double rgnend, const char* name)
bool SetProjectMarker2(ReaProject proj, int markrgnindexnumber, bool isrgn, pos, rgnend, "name")
boolean reaper.SetProjectMarker2(ReaProject proj, integer markrgnindexnumber, boolean isrgn, number pos, number rgnend, string name)
Boolean RPR_SetProjectMarker2(ReaProject proj, Int markrgnindexnumber, Boolean isrgn, Float pos, Float rgnend, String name)
bool SetProjectMarker3(ReaProject* proj, int markrgnindexnumber, bool isrgn, double pos, double rgnend, const char* name, int color)
bool SetProjectMarker3(ReaProject proj, int markrgnindexnumber, bool isrgn, pos, rgnend, "name", int color)
boolean reaper.SetProjectMarker3(ReaProject proj, integer markrgnindexnumber, boolean isrgn, number pos, number rgnend, string name, integer color)
Boolean RPR_SetProjectMarker3(ReaProject proj, Int markrgnindexnumber, Boolean isrgn, Float pos, Float rgnend, String name, Int color)
bool SetProjectMarker4(ReaProject* proj, int markrgnindexnumber, bool isrgn, double pos, double rgnend, const char* name, int color, int flags)
bool SetProjectMarker4(ReaProject proj, int markrgnindexnumber, bool isrgn, pos, rgnend, "name", int color, int flags)
boolean reaper.SetProjectMarker4(ReaProject proj, integer markrgnindexnumber, boolean isrgn, number pos, number rgnend, string name, integer color, integer flags)
Boolean RPR_SetProjectMarker4(ReaProject proj, Int markrgnindexnumber, Boolean isrgn, Float pos, Float rgnend, String name, Int color, Int flags)

color should be 0 to not change, or ColorToNative(r,g,b)|0x1000000, flags&1 to clear name

bool SetProjectMarkerByIndex(ReaProject* proj, int markrgnidx, bool isrgn, double pos, double rgnend, int IDnumber, const char* name, int color)
bool SetProjectMarkerByIndex(ReaProject proj, int markrgnidx, bool isrgn, pos, rgnend, int IDnumber, "name", int color)
boolean reaper.SetProjectMarkerByIndex(ReaProject proj, integer markrgnidx, boolean isrgn, number pos, number rgnend, integer IDnumber, string name, integer color)
Boolean RPR_SetProjectMarkerByIndex(ReaProject proj, Int markrgnidx, Boolean isrgn, Float pos, Float rgnend, Int IDnumber, String name, Int color)

See SetProjectMarkerByIndex2.

bool SetProjectMarkerByIndex2(ReaProject* proj, int markrgnidx, bool isrgn, double pos, double rgnend, int IDnumber, const char* name, int color, int flags)
bool SetProjectMarkerByIndex2(ReaProject proj, int markrgnidx, bool isrgn, pos, rgnend, int IDnumber, "name", int color, int flags)
boolean reaper.SetProjectMarkerByIndex2(ReaProject proj, integer markrgnidx, boolean isrgn, number pos, number rgnend, integer IDnumber, string name, integer color, integer flags)
Boolean RPR_SetProjectMarkerByIndex2(ReaProject proj, Int markrgnidx, Boolean isrgn, Float pos, Float rgnend, Int IDnumber, String name, Int color, Int flags)

Differs from SetProjectMarker4 in that markrgnidx 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.

int SetProjExtState(ReaProject* proj, const char* extname, const char* key, const char* value)
int SetProjExtState(ReaProject proj, "extname", "key", "value")
integer reaper.SetProjExtState(ReaProject proj, string extname, string key, string value)
Int RPR_SetProjExtState(ReaProject proj, String extname, String key, String value)

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. See GetProjExtState, EnumProjExtState.

void SetRegionRenderMatrix(ReaProject* proj, int regionindex, MediaTrack* track, int addorremove)
SetRegionRenderMatrix(ReaProject proj, int regionindex, MediaTrack track, int addorremove)
reaper.SetRegionRenderMatrix(ReaProject proj, integer regionindex, MediaTrack track, integer addorremove)
RPR_SetRegionRenderMatrix(ReaProject proj, Int regionindex, MediaTrack track, Int addorremove)

Add (addorremove > 0) or remove (addorremove < 0) a track from this region when using the region render matrix.

int SetTakeStretchMarker(MediaItem_Take* take, int idx, double pos, const double* srcposInOptional)
int SetTakeStretchMarker(MediaItem_Take take, int idx, pos, optional srcposIn)
integer reaper.SetTakeStretchMarker(MediaItem_Take take, integer idx, number pos, optional number srcposIn)
Int RPR_SetTakeStretchMarker(MediaItem_Take take, Int idx, Float pos, const double srcposInOptional)

Adds or updates a stretch marker. If idx<0, stretch marker will be added. If idx>=0, stretch marker will be updated. When adding, if srcposInOptional is omitted, source position will be auto-calculated. When updating a stretch marker, if srcposInOptional is omitted, srcpos will not be modified. Position/srcposition values will be constrained to nearby stretch markers. Returns index of stretch marker, or -1 if did not insert (or marker already existed at time).

bool SetTakeStretchMarkerSlope(MediaItem_Take* take, int idx, double slope)
bool SetTakeStretchMarkerSlope(MediaItem_Take take, int idx, slope)
boolean reaper.SetTakeStretchMarkerSlope(MediaItem_Take take, integer idx, number slope)
Boolean RPR_SetTakeStretchMarkerSlope(MediaItem_Take take, Int idx, Float slope)

See GetTakeStretchMarkerSlope

bool SetTempoTimeSigMarker(ReaProject* proj, int ptidx, double timepos, int measurepos, double beatpos, double bpm, int timesig_num, int timesig_denom, bool lineartempo)
bool SetTempoTimeSigMarker(ReaProject proj, int ptidx, timepos, int measurepos, beatpos, bpm, int timesig_num, int timesig_denom, bool lineartempo)
boolean reaper.SetTempoTimeSigMarker(ReaProject proj, integer ptidx, number timepos, integer measurepos, number beatpos, number bpm, integer timesig_num, integer timesig_denom, boolean lineartempo)
Boolean RPR_SetTempoTimeSigMarker(ReaProject proj, Int ptidx, Float timepos, Int measurepos, Float beatpos, Float bpm, Int timesig_num, Int timesig_denom, Boolean lineartempo)

Set parameters of a tempo/time signature marker. Provide either timepos (with measurepos=-1, beatpos=-1), or measurepos and beatpos (with timepos=-1). If timesig_num and timesig_denom are zero, the previous time signature will be used. ptidx=-1 will insert a new tempo/time signature marker. See CountTempoTimeSigMarkers, GetTempoTimeSigMarker, AddTempoTimeSigMarker.

bool SetToggleCommandState(int section_id, int command_id, int state)
bool SetToggleCommandState(int section_id, int command_id, int state)
boolean reaper.SetToggleCommandState(integer section_id, integer command_id, integer state)
Boolean RPR_SetToggleCommandState(Int section_id, Int command_id, Int state)

Updates the toggle state of an action, returns true if succeeded. Only ReaScripts can have their toggle states changed programmatically. See RefreshToolbar2.

void SetTrackAutomationMode(MediaTrack* tr, int mode)
SetTrackAutomationMode(MediaTrack tr, int mode)
reaper.SetTrackAutomationMode(MediaTrack tr, integer mode)
RPR_SetTrackAutomationMode(MediaTrack tr, Int mode)
void SetTrackColor(MediaTrack* track, int color)
SetTrackColor(MediaTrack track, int color)
reaper.SetTrackColor(MediaTrack track, integer color)
RPR_SetTrackColor(MediaTrack track, Int color)

Set the custom track color, color is OS dependent (i.e. ColorToNative(r,g,b).

bool SetTrackMIDILyrics(MediaTrack* track, int flag, const char* str)
bool SetTrackMIDILyrics(MediaTrack track, int flag, "str")
boolean reaper.SetTrackMIDILyrics(MediaTrack track, integer flag, string str)
Boolean RPR_SetTrackMIDILyrics(MediaTrack track, Int flag, String str)

Set all MIDI lyrics on the track. Lyrics will be stuffed into any MIDI items found in range. Flag is unused at present. str is passed in as beat position, tab, text, tab (example with flag=2: "1.1.2\tLyric for measure 1 beat 2\t.1.1\tLyric for measure 2 beat 1 "). See GetTrackMIDILyrics

bool SetTrackMIDINoteName(int track, int pitch, int chan, const char* name)
bool SetTrackMIDINoteName(int track, int pitch, int chan, "name")
boolean reaper.SetTrackMIDINoteName(integer track, integer pitch, integer chan, string name)
Boolean RPR_SetTrackMIDINoteName(Int track, Int pitch, Int chan, String name)

channel < 0 assigns these note names to all channels.

bool SetTrackMIDINoteNameEx(ReaProject* proj, MediaTrack* track, int pitch, int chan, const char* name)
bool SetTrackMIDINoteNameEx(ReaProject proj, MediaTrack track, int pitch, int chan, "name")
boolean reaper.SetTrackMIDINoteNameEx(ReaProject proj, MediaTrack track, integer pitch, integer chan, string name)
Boolean RPR_SetTrackMIDINoteNameEx(ReaProject proj, MediaTrack track, Int pitch, Int chan, String name)

channel < 0 assigns note name to all channels. pitch 128 assigns name for CC0, pitch 129 for CC1, etc.

void SetTrackSelected(MediaTrack* track, bool selected)
SetTrackSelected(MediaTrack track, bool selected)
reaper.SetTrackSelected(MediaTrack track, boolean selected)
RPR_SetTrackSelected(MediaTrack track, Boolean selected)
bool SetTrackSendInfo_Value(MediaTrack* tr, int category, int sendidx, const char* parmname, double newvalue)
bool SetTrackSendInfo_Value(MediaTrack tr, int category, int sendidx, "parmname", newvalue)
boolean reaper.SetTrackSendInfo_Value(MediaTrack tr, integer category, integer sendidx, string parmname, number newvalue)
Boolean RPR_SetTrackSendInfo_Value(MediaTrack tr, Int category, Int sendidx, String parmname, Float newvalue)
Set send/receive/hardware output numerical-value attributes, return true on success.
category is <0 for receives, 0=sends, >0 for hardware outputs
parameter names:
B_MUTE : returns bool *
B_PHASE : returns bool *, true to flip phase
B_MONO : returns bool *
D_VOL : returns double *, 1.0 = +0dB etc
D_PAN : returns double *, -1..+1
D_PANLAW : returns double *,1.0=+0.0db, 0.5=-6dB, -1.0 = projdef etc
I_SENDMODE : returns int *, 0=post-fader, 1=pre-fx, 2=post-fx (deprecated), 3=post-fx
I_AUTOMODE : returns int * : automation mode (-1=use track automode, 0=trim/off, 1=read, 2=touch, 3=write, 4=latch)
I_SRCCHAN : returns int *, index,&1024=mono, -1 for none
I_DSTCHAN : returns int *, index, &1024=mono, otherwise stereo pair, hwout:&512=rearoute

I_MIDIFLAGS : returns int *, low 5 bits=source channel 0=all, 1-16, next 5 bits=dest channel, 0=orig, 1-16=chanSee CreateTrackSend, RemoveTrackSend, GetTrackNumSends.

bool SetTrackSendUIPan(MediaTrack* track, int send_idx, double pan, int isend)
bool SetTrackSendUIPan(MediaTrack track, int send_idx, pan, int isend)
boolean reaper.SetTrackSendUIPan(MediaTrack track, integer send_idx, number pan, integer isend)
Boolean RPR_SetTrackSendUIPan(MediaTrack track, Int send_idx, Float pan, Int isend)

send_idx<0 for receives, >=0 for hw ouputs, >=nb_of_hw_ouputs for sends. isend=1 for end of edit, -1 for an instant edit (such as reset), 0 for normal tweak.

bool SetTrackSendUIVol(MediaTrack* track, int send_idx, double vol, int isend)
bool SetTrackSendUIVol(MediaTrack track, int send_idx, vol, int isend)
boolean reaper.SetTrackSendUIVol(MediaTrack track, integer send_idx, number vol, integer isend)
Boolean RPR_SetTrackSendUIVol(MediaTrack track, Int send_idx, Float vol, Int isend)

send_idx<0 for receives, >=0 for hw ouputs, >=nb_of_hw_ouputs for sends. isend=1 for end of edit, -1 for an instant edit (such as reset), 0 for normal tweak.

bool SetTrackStateChunk(MediaTrack* track, const char* str, bool isundoOptional)
bool SetTrackStateChunk(MediaTrack track, "str", bool isundo)
boolean reaper.SetTrackStateChunk(MediaTrack track, string str, boolean isundo)
Boolean RPR_SetTrackStateChunk(MediaTrack track, String str, Boolean isundoOptional)

Sets the RPPXML state of a track, returns true if successful. Undo flag is a performance/caching hint.

void ShowActionList(KbdSectionInfo* caller, HWND callerWnd)
ShowActionList(KbdSectionInfo caller, HWND callerWnd)
reaper.ShowActionList(KbdSectionInfo caller, HWND callerWnd)
RPR_ShowActionList(KbdSectionInfo caller, HWND callerWnd)
void ShowConsoleMsg(const char* msg)
ShowConsoleMsg("msg")
reaper.ShowConsoleMsg(string msg)
RPR_ShowConsoleMsg(String msg)

Show a message to the user (also useful for debugging). Send "\n" for newline, "" to clear the console. See ClearConsole

int ShowMessageBox(const char* msg, const char* title, int type)
int ShowMessageBox("msg", "title", int type)
integer reaper.ShowMessageBox(string msg, string title, integer type)
Int RPR_ShowMessageBox(String msg, String title, Int type)

type 0=OK,1=OKCANCEL,2=ABORTRETRYIGNORE,3=YESNOCANCEL,4=YESNO,5=RETRYCANCEL : ret 1=OK,2=CANCEL,3=ABORT,4=RETRY,5=IGNORE,6=YES,7=NO

void ShowPopupMenu(const char* name, int x, int y, HWND hwndParentOptional, void* ctxOptional, int ctx2Optional, int ctx3Optional)
ShowPopupMenu("name", int x, int y, HWND hwndParent, void* ctx, int ctx2, int ctx3)
reaper.ShowPopupMenu(string name, integer x, integer y, HWND hwndParent, identifier ctx, integer ctx2, integer ctx3)
RPR_ShowPopupMenu(String name, Int x, Int y, HWND hwndParentOptional, void ctxOptional, Int ctx2Optional, Int ctx3Optional)

shows a context menu, valid names include: track_input, track_panel, track_area, track_routing, item, ruler, envelope, envelope_point, envelope_item. ctxOptional can be a track pointer for track_*, item pointer for item* (but is optional). for envelope_point, ctx2Optional has point index, ctx3Optional has item index (0=main envelope, 1=first AI). for envelope_item, ctx2Optional has AI index (1=first AI)

double SLIDER2DB(double y)
double SLIDER2DB(y)
number reaper.SLIDER2DB(number y)
Float RPR_SLIDER2DB(Float y)
double SnapToGrid(ReaProject* project, double time_pos)
double SnapToGrid(ReaProject project, time_pos)
number reaper.SnapToGrid(ReaProject project, number time_pos)
Float RPR_SnapToGrid(ReaProject project, Float time_pos)
void SoloAllTracks(int solo)
SoloAllTracks(int solo)
reaper.SoloAllTracks(integer solo)
RPR_SoloAllTracks(Int solo)

solo=2 for SIP

HWND Splash_GetWnd()
HWND Splash_GetWnd()
HWND reaper.Splash_GetWnd()
HWND RPR_Splash_GetWnd()

gets the splash window, in case you want to display a message over it. Returns NULL when the sphah window is not displayed.

MediaItem* SplitMediaItem(MediaItem* item, double position)
MediaItem SplitMediaItem(MediaItem item, position)
MediaItem reaper.SplitMediaItem(MediaItem item, number position)
MediaItem RPR_SplitMediaItem(MediaItem item, Float position)

the original item becomes the left-hand split, the function returns the right-hand split (or NULL if the split failed)

void stringToGuid(const char* str, GUID* g)
stringToGuid("str", #gGUID)
string gGUID = reaper.stringToGuid(string str, string gGUID)
RPR_stringToGuid(String str, GUID g)
void StuffMIDIMessage(int mode, int msg1, int msg2, int msg3)
StuffMIDIMessage(int mode, int msg1, int msg2, int msg3)
reaper.StuffMIDIMessage(integer mode, integer msg1, integer msg2, integer msg3)
RPR_StuffMIDIMessage(Int mode, Int msg1, Int msg2, Int msg3)

Stuffs a 3 byte MIDI message into either the Virtual MIDI Keyboard queue, or the MIDI-as-control input queue, or sends to a MIDI hardware output. mode=0 for VKB, 1 for control (actions map etc), 2 for VKB-on-current-channel; 16 for external MIDI device 0, 17 for external MIDI device 1, etc; see GetNumMIDIOutputs, GetMIDIOutputName.

int TakeFX_AddByName(MediaItem_Take* take, const char* fxname, int instantiate)
int TakeFX_AddByName(MediaItem_Take take, "fxname", int instantiate)
integer reaper.TakeFX_AddByName(MediaItem_Take take, string fxname, integer instantiate)
Int RPR_TakeFX_AddByName(MediaItem_Take take, String fxname, Int instantiate)

Adds or queries the position of a named FX in a take. Specify a negative value for instantiate to always create a new effect, 0 to only query the first instance of an effect, or a positive value to add an instance if one is not found.

void TakeFX_CopyToTake(MediaItem_Take* src_take, int src_fx, MediaItem_Take* dest_take, int dest_fx, bool is_move)
TakeFX_CopyToTake(MediaItem_Take src_take, int src_fx, MediaItem_Take dest_take, int dest_fx, bool is_move)
reaper.TakeFX_CopyToTake(MediaItem_Take src_take, integer src_fx, MediaItem_Take dest_take, integer dest_fx, boolean is_move)
RPR_TakeFX_CopyToTake(MediaItem_Take src_take, Int src_fx, MediaItem_Take dest_take, Int dest_fx, Boolean is_move)

Copies (or moves) FX from src_take to dest_take. Can be used with src_track=dest_track to reorder.

void TakeFX_CopyToTrack(MediaItem_Take* src_take, int src_fx, MediaTrack* dest_track, int dest_fx, bool is_move)
TakeFX_CopyToTrack(MediaItem_Take src_take, int src_fx, MediaTrack dest_track, int dest_fx, bool is_move)
reaper.TakeFX_CopyToTrack(MediaItem_Take src_take, integer src_fx, MediaTrack dest_track, integer dest_fx, boolean is_move)
RPR_TakeFX_CopyToTrack(MediaItem_Take src_take, Int src_fx, MediaTrack dest_track, Int dest_fx, Boolean is_move)

Copies (or moves) FX from src_take to dest_track. dest_fx can have 0x1000000 set to reference input FX.

bool TakeFX_Delete(MediaItem_Take* take, int fx)
bool TakeFX_Delete(MediaItem_Take take, int fx)
boolean reaper.TakeFX_Delete(MediaItem_Take take, integer fx)
Boolean RPR_TakeFX_Delete(MediaItem_Take take, Int fx)

Remove a FX from take chain (returns true on success)

bool TakeFX_EndParamEdit(MediaItem_Take* take, int fx, int param)
bool TakeFX_EndParamEdit(MediaItem_Take take, int fx, int param)
boolean reaper.TakeFX_EndParamEdit(MediaItem_Take take, integer fx, integer param)
Boolean RPR_TakeFX_EndParamEdit(MediaItem_Take take, Int fx, Int param)
bool TakeFX_FormatParamValue(MediaItem_Take* take, int fx, int param, double val, char* buf, int buf_sz)
bool TakeFX_FormatParamValue(MediaItem_Take take, int fx, int param, val, #buf)
boolean retval, string buf = reaper.TakeFX_FormatParamValue(MediaItem_Take take, integer fx, integer param, number val, string buf)
(Boolean retval, MediaItem_Take take, Int fx, Int param, Float val, String buf, Int buf_sz) = RPR_TakeFX_FormatParamValue(take, fx, param, val, buf, buf_sz)

Note: only works with FX that support Cockos VST extensions.

bool TakeFX_FormatParamValueNormalized(MediaItem_Take* take, int fx, int param, double value, char* buf, int buf_sz)
bool TakeFX_FormatParamValueNormalized(MediaItem_Take take, int fx, int param, value, #buf)
boolean retval, string buf = reaper.TakeFX_FormatParamValueNormalized(MediaItem_Take take, integer fx, integer param, number value, string buf)
(Boolean retval, MediaItem_Take take, Int fx, Int param, Float value, String buf, Int buf_sz) = RPR_TakeFX_FormatParamValueNormalized(take, fx, param, value, buf, buf_sz)

Note: only works with FX that support Cockos VST extensions.

int TakeFX_GetChainVisible(MediaItem_Take* take)
int TakeFX_GetChainVisible(MediaItem_Take take)
integer reaper.TakeFX_GetChainVisible(MediaItem_Take take)
Int RPR_TakeFX_GetChainVisible(MediaItem_Take take)

returns index of effect visible in chain, or -1 for chain hidden, or -2 for chain visible but no effect selected

int TakeFX_GetCount(MediaItem_Take* take)
int TakeFX_GetCount(MediaItem_Take take)
integer reaper.TakeFX_GetCount(MediaItem_Take take)
Int RPR_TakeFX_GetCount(MediaItem_Take take)
bool TakeFX_GetEnabled(MediaItem_Take* take, int fx)
bool TakeFX_GetEnabled(MediaItem_Take take, int fx)
boolean reaper.TakeFX_GetEnabled(MediaItem_Take take, integer fx)
Boolean RPR_TakeFX_GetEnabled(MediaItem_Take take, Int fx)

See TakeFX_SetEnabled

TrackEnvelope* TakeFX_GetEnvelope(MediaItem_Take* take, int fxindex, int parameterindex, bool create)
TrackEnvelope TakeFX_GetEnvelope(MediaItem_Take take, int fxindex, int parameterindex, bool create)
TrackEnvelope reaper.TakeFX_GetEnvelope(MediaItem_Take take, integer fxindex, integer parameterindex, boolean create)
TrackEnvelope RPR_TakeFX_GetEnvelope(MediaItem_Take take, Int fxindex, Int parameterindex, Boolean create)

Returns the FX parameter envelope. If the envelope does not exist and create=true, the envelope will be created.

HWND TakeFX_GetFloatingWindow(MediaItem_Take* take, int index)
HWND TakeFX_GetFloatingWindow(MediaItem_Take take, int index)
HWND reaper.TakeFX_GetFloatingWindow(MediaItem_Take take, integer index)
HWND RPR_TakeFX_GetFloatingWindow(MediaItem_Take take, Int index)

returns HWND of floating window for effect index, if any

bool TakeFX_GetFormattedParamValue(MediaItem_Take* take, int fx, int param, char* buf, int buf_sz)
bool TakeFX_GetFormattedParamValue(MediaItem_Take take, int fx, int param, #buf)
boolean retval, string buf = reaper.TakeFX_GetFormattedParamValue(MediaItem_Take take, integer fx, integer param, string buf)
(Boolean retval, MediaItem_Take take, Int fx, Int param, String buf, Int buf_sz) = RPR_TakeFX_GetFormattedParamValue(take, fx, param, buf, buf_sz)
GUID* TakeFX_GetFXGUID(MediaItem_Take* take, int fx)
bool TakeFX_GetFXGUID(#retguid, MediaItem_Take take, int fx)
string GUID = reaper.TakeFX_GetFXGUID(MediaItem_Take take, integer fx)
GUID RPR_TakeFX_GetFXGUID(MediaItem_Take take, Int fx)
bool TakeFX_GetFXName(MediaItem_Take* take, int fx, char* buf, int buf_sz)
bool TakeFX_GetFXName(MediaItem_Take take, int fx, #buf)
boolean retval, string buf = reaper.TakeFX_GetFXName(MediaItem_Take take, integer fx, string buf)
(Boolean retval, MediaItem_Take take, Int fx, String buf, Int buf_sz) = RPR_TakeFX_GetFXName(take, fx, buf, buf_sz)
int TakeFX_GetIOSize(MediaItem_Take* take, int fx, int* inputPinsOutOptional, int* outputPinsOutOptional)
int TakeFX_GetIOSize(MediaItem_Take take, int fx, optional int &inputPins, optional int &outputPins)
integer retval, optional number inputPins, optional number outputPins = reaper.TakeFX_GetIOSize(MediaItem_Take take, integer fx)
(Int retval, MediaItem_Take take, Int fx, Int inputPinsOutOptional, Int outputPinsOutOptional) = RPR_TakeFX_GetIOSize(take, fx, inputPinsOutOptional, outputPinsOutOptional)

sets the number of input/output pins for FX if available, returns plug-in type or -1 on error

bool TakeFX_GetNamedConfigParm(MediaItem_Take* take, int fx, const char* parmname, char* bufOut, int bufOut_sz)
bool TakeFX_GetNamedConfigParm(MediaItem_Take take, int fx, "parmname", #buf)
boolean retval, string buf = reaper.TakeFX_GetNamedConfigParm(MediaItem_Take take, integer fx, string parmname)
(Boolean retval, MediaItem_Take take, Int fx, String parmname, String bufOut, Int bufOut_sz) = RPR_TakeFX_GetNamedConfigParm(take, fx, parmname, bufOut, bufOut_sz)

gets plug-in specific named configuration value (returns true on success). see TrackFX_GetNamedConfigParm

int TakeFX_GetNumParams(MediaItem_Take* take, int fx)
int TakeFX_GetNumParams(MediaItem_Take take, int fx)
integer reaper.TakeFX_GetNumParams(MediaItem_Take take, integer fx)
Int RPR_TakeFX_GetNumParams(MediaItem_Take take, Int fx)
bool TakeFX_GetOffline(MediaItem_Take* take, int fx)
bool TakeFX_GetOffline(MediaItem_Take take, int fx)
boolean reaper.TakeFX_GetOffline(MediaItem_Take take, integer fx)
Boolean RPR_TakeFX_GetOffline(MediaItem_Take take, Int fx)

See TakeFX_SetOffline

bool TakeFX_GetOpen(MediaItem_Take* take, int fx)
bool TakeFX_GetOpen(MediaItem_Take take, int fx)
boolean reaper.TakeFX_GetOpen(MediaItem_Take take, integer fx)
Boolean RPR_TakeFX_GetOpen(MediaItem_Take take, Int fx)

Returns true if this FX UI is open in the FX chain window or a floating window. See TakeFX_SetOpen

double TakeFX_GetParam(MediaItem_Take* take, int fx, int param, double* minvalOut, double* maxvalOut)
double TakeFX_GetParam(MediaItem_Take take, int fx, int param, &minval, &maxval)
number retval, number minval, number maxval = reaper.TakeFX_GetParam(MediaItem_Take take, integer fx, integer param)
(Float retval, MediaItem_Take take, Int fx, Int param, Float minvalOut, Float maxvalOut) = RPR_TakeFX_GetParam(take, fx, param, minvalOut, maxvalOut)
bool TakeFX_GetParameterStepSizes(MediaItem_Take* take, int fx, int param, double* stepOut, double* smallstepOut, double* largestepOut, bool* istoggleOut)
bool TakeFX_GetParameterStepSizes(MediaItem_Take take, int fx, int param, &step, &smallstep, &largestep, bool &istoggle)
boolean retval, number step, number smallstep, number largestep, boolean istoggle = reaper.TakeFX_GetParameterStepSizes(MediaItem_Take take, integer fx, integer param)
(Boolean retval, MediaItem_Take take, Int fx, Int param, Float stepOut, Float smallstepOut, Float largestepOut, Boolean istoggleOut) = RPR_TakeFX_GetParameterStepSizes(take, fx, param, stepOut, smallstepOut, largestepOut, istoggleOut)
double TakeFX_GetParamEx(MediaItem_Take* take, int fx, int param, double* minvalOut, double* maxvalOut, double* midvalOut)
double TakeFX_GetParamEx(MediaItem_Take take, int fx, int param, &minval, &maxval, &midval)
number retval, number minval, number maxval, number midval = reaper.TakeFX_GetParamEx(MediaItem_Take take, integer fx, integer param)
(Float retval, MediaItem_Take take, Int fx, Int param, Float minvalOut, Float maxvalOut, Float midvalOut) = RPR_TakeFX_GetParamEx(take, fx, param, minvalOut, maxvalOut, midvalOut)
bool TakeFX_GetParamName(MediaItem_Take* take, int fx, int param, char* buf, int buf_sz)
bool TakeFX_GetParamName(MediaItem_Take take, int fx, int param, #buf)
boolean retval, string buf = reaper.TakeFX_GetParamName(MediaItem_Take take, integer fx, integer param, string buf)
(Boolean retval, MediaItem_Take take, Int fx, Int param, String buf, Int buf_sz) = RPR_TakeFX_GetParamName(take, fx, param, buf, buf_sz)
double TakeFX_GetParamNormalized(MediaItem_Take* take, int fx, int param)
double TakeFX_GetParamNormalized(MediaItem_Take take, int fx, int param)
number reaper.TakeFX_GetParamNormalized(MediaItem_Take take, integer fx, integer param)
Float RPR_TakeFX_GetParamNormalized(MediaItem_Take take, Int fx, Int param)
int TakeFX_GetPinMappings(MediaItem_Take* tr, int fx, int isoutput, int pin, int* high32OutOptional)
int TakeFX_GetPinMappings(MediaItem_Take tr, int fx, int isoutput, int pin, optional int &high32)
integer retval, optional number high32 = reaper.TakeFX_GetPinMappings(MediaItem_Take tr, integer fx, integer isoutput, integer pin)
(Int retval, MediaItem_Take tr, Int fx, Int isoutput, Int pin, Int high32OutOptional) = RPR_TakeFX_GetPinMappings(tr, fx, isoutput, pin, high32OutOptional)

gets the effective channel mapping bitmask for a particular pin. high32OutOptional will be set to the high 32 bits

bool TakeFX_GetPreset(MediaItem_Take* take, int fx, char* presetname, int presetname_sz)
bool TakeFX_GetPreset(MediaItem_Take take, int fx, #presetname)
boolean retval, string presetname = reaper.TakeFX_GetPreset(MediaItem_Take take, integer fx, string presetname)
(Boolean retval, MediaItem_Take take, Int fx, String presetname, Int presetname_sz) = RPR_TakeFX_GetPreset(take, fx, presetname, presetname_sz)

Get the name of the preset currently showing in the REAPER dropdown, or the full path to a factory preset file for VST3 plug-ins (.vstpreset). Returns false if the current FX parameters do not exactly match the preset (in other words, if the user loaded the preset but moved the knobs afterward). See TakeFX_SetPreset.

int TakeFX_GetPresetIndex(MediaItem_Take* take, int fx, int* numberOfPresetsOut)
int TakeFX_GetPresetIndex(MediaItem_Take take, int fx, int &numberOfPresets)
integer retval, number numberOfPresets = reaper.TakeFX_GetPresetIndex(MediaItem_Take take, integer fx)
(Int retval, MediaItem_Take take, Int fx, Int numberOfPresetsOut) = RPR_TakeFX_GetPresetIndex(take, fx, numberOfPresetsOut)

Returns current preset index, or -1 if error. numberOfPresetsOut will be set to total number of presets available. See TakeFX_SetPresetByIndex

void TakeFX_GetUserPresetFilename(MediaItem_Take* take, int fx, char* fn, int fn_sz)
TakeFX_GetUserPresetFilename(MediaItem_Take take, int fx, #fn)
string fn = reaper.TakeFX_GetUserPresetFilename(MediaItem_Take take, integer fx, string fn)
(MediaItem_Take take, Int fx, String fn, Int fn_sz) = RPR_TakeFX_GetUserPresetFilename(take, fx, fn, fn_sz)
bool TakeFX_NavigatePresets(MediaItem_Take* take, int fx, int presetmove)
bool TakeFX_NavigatePresets(MediaItem_Take take, int fx, int presetmove)
boolean reaper.TakeFX_NavigatePresets(MediaItem_Take take, integer fx, integer presetmove)
Boolean RPR_TakeFX_NavigatePresets(MediaItem_Take take, Int fx, Int presetmove)

presetmove==1 activates the next preset, presetmove==-1 activates the previous preset, etc.

void TakeFX_SetEnabled(MediaItem_Take* take, int fx, bool enabled)
TakeFX_SetEnabled(MediaItem_Take take, int fx, bool enabled)
reaper.TakeFX_SetEnabled(MediaItem_Take take, integer fx, boolean enabled)
RPR_TakeFX_SetEnabled(MediaItem_Take take, Int fx, Boolean enabled)

See TakeFX_GetEnabled

bool TakeFX_SetNamedConfigParm(MediaItem_Take* take, int fx, const char* parmname, const char* value)
bool TakeFX_SetNamedConfigParm(MediaItem_Take take, int fx, "parmname", "value")
boolean reaper.TakeFX_SetNamedConfigParm(MediaItem_Take take, integer fx, string parmname, string value)
Boolean RPR_TakeFX_SetNamedConfigParm(MediaItem_Take take, Int fx, String parmname, String value)

gets plug-in specific named configuration value (returns true on success)

void TakeFX_SetOffline(MediaItem_Take* take, int fx, bool offline)
TakeFX_SetOffline(MediaItem_Take take, int fx, bool offline)
reaper.TakeFX_SetOffline(MediaItem_Take take, integer fx, boolean offline)
RPR_TakeFX_SetOffline(MediaItem_Take take, Int fx, Boolean offline)

See TakeFX_GetOffline

void TakeFX_SetOpen(MediaItem_Take* take, int fx, bool open)
TakeFX_SetOpen(MediaItem_Take take, int fx, bool open)
reaper.TakeFX_SetOpen(MediaItem_Take take, integer fx, boolean open)
RPR_TakeFX_SetOpen(MediaItem_Take take, Int fx, Boolean open)

Open this FX UI. See TakeFX_GetOpen

bool TakeFX_SetParam(MediaItem_Take* take, int fx, int param, double val)
bool TakeFX_SetParam(MediaItem_Take take, int fx, int param, val)
boolean reaper.TakeFX_SetParam(MediaItem_Take take, integer fx, integer param, number val)
Boolean RPR_TakeFX_SetParam(MediaItem_Take take, Int fx, Int param, Float val)
bool TakeFX_SetParamNormalized(MediaItem_Take* take, int fx, int param, double value)
bool TakeFX_SetParamNormalized(MediaItem_Take take, int fx, int param, value)
boolean reaper.TakeFX_SetParamNormalized(MediaItem_Take take, integer fx, integer param, number value)
Boolean RPR_TakeFX_SetParamNormalized(MediaItem_Take take, Int fx, Int param, Float value)
bool TakeFX_SetPinMappings(MediaItem_Take* tr, int fx, int isoutput, int pin, int low32bits, int hi32bits)
bool TakeFX_SetPinMappings(MediaItem_Take tr, int fx, int isoutput, int pin, int low32bits, int hi32bits)
boolean reaper.TakeFX_SetPinMappings(MediaItem_Take tr, integer fx, integer isoutput, integer pin, integer low32bits, integer hi32bits)
Boolean RPR_TakeFX_SetPinMappings(MediaItem_Take tr, Int fx, Int isoutput, Int pin, Int low32bits, Int hi32bits)

sets the channel mapping bitmask for a particular pin. returns false if unsupported (not all types of plug-ins support this capability)

bool TakeFX_SetPreset(MediaItem_Take* take, int fx, const char* presetname)
bool TakeFX_SetPreset(MediaItem_Take take, int fx, "presetname")
boolean reaper.TakeFX_SetPreset(MediaItem_Take take, integer fx, string presetname)
Boolean RPR_TakeFX_SetPreset(MediaItem_Take take, Int fx, String presetname)

Activate a preset with the name shown in the REAPER dropdown. Full paths to .vstpreset files are also supported for VST3 plug-ins. See TakeFX_GetPreset.

bool TakeFX_SetPresetByIndex(MediaItem_Take* take, int fx, int idx)
bool TakeFX_SetPresetByIndex(MediaItem_Take take, int fx, int idx)
boolean reaper.TakeFX_SetPresetByIndex(MediaItem_Take take, integer fx, integer idx)
Boolean RPR_TakeFX_SetPresetByIndex(MediaItem_Take take, Int fx, Int idx)

Sets the preset idx, or the factory preset (idx==-2), or the default user preset (idx==-1). Returns true on success. See TakeFX_GetPresetIndex.

void TakeFX_Show(MediaItem_Take* take, int index, int showFlag)
TakeFX_Show(MediaItem_Take take, int index, int showFlag)
reaper.TakeFX_Show(MediaItem_Take take, integer index, integer showFlag)
RPR_TakeFX_Show(MediaItem_Take take, Int index, Int showFlag)

showflag=0 for hidechain, =1 for show chain(index valid), =2 for hide floating window(index valid), =3 for show floating window (index valid)

bool TakeIsMIDI(MediaItem_Take* take)
bool TakeIsMIDI(MediaItem_Take take)
boolean reaper.TakeIsMIDI(MediaItem_Take take)
Boolean RPR_TakeIsMIDI(MediaItem_Take take)

Returns true if the active take contains MIDI.

double time_precise()
number reaper.time_precise()
Float RPR_time_precise()

Gets a precise system timestamp in seconds

double TimeMap2_beatsToTime(ReaProject* proj, double tpos, const int* measuresInOptional)
double TimeMap2_beatsToTime(ReaProject proj, tpos, optional int measuresIn)
number reaper.TimeMap2_beatsToTime(ReaProject proj, number tpos, optional number measuresIn)
Float RPR_TimeMap2_beatsToTime(ReaProject proj, Float tpos, const int measuresInOptional)

convert a beat position (or optionally a beats+measures if measures is non-NULL) to time.

double TimeMap2_GetDividedBpmAtTime(ReaProject* proj, double time)
double TimeMap2_GetDividedBpmAtTime(ReaProject proj, time)
number reaper.TimeMap2_GetDividedBpmAtTime(ReaProject proj, number time)
Float RPR_TimeMap2_GetDividedBpmAtTime(ReaProject proj, Float time)

get the effective BPM at the time (seconds) position (i.e. 2x in /8 signatures)

double TimeMap2_GetNextChangeTime(ReaProject* proj, double time)
double TimeMap2_GetNextChangeTime(ReaProject proj, time)
number reaper.TimeMap2_GetNextChangeTime(ReaProject proj, number time)
Float RPR_TimeMap2_GetNextChangeTime(ReaProject proj, Float time)

when does the next time map (tempo or time sig) change occur

double TimeMap2_QNToTime(ReaProject* proj, double qn)
double TimeMap2_QNToTime(ReaProject proj, qn)
number reaper.TimeMap2_QNToTime(ReaProject proj, number qn)
Float RPR_TimeMap2_QNToTime(ReaProject proj, Float qn)

converts project QN position to time.

double TimeMap2_timeToBeats(ReaProject* proj, double tpos, int* measuresOutOptional, int* cmlOutOptional, double* fullbeatsOutOptional, int* cdenomOutOptional)
double TimeMap2_timeToBeats(ReaProject proj, tpos, optional int &measures, optional int &cml, optional &fullbeats, optional int &cdenom)
number retval, optional number measures, optional number cml, optional number fullbeats, optional number cdenom = reaper.TimeMap2_timeToBeats(ReaProject proj, number tpos)
(Float retval, ReaProject proj, Float tpos, Int measuresOutOptional, Int cmlOutOptional, Float fullbeatsOutOptional, Int cdenomOutOptional) = RPR_TimeMap2_timeToBeats(proj, tpos, measuresOutOptional, cmlOutOptional, fullbeatsOutOptional, cdenomOutOptional)
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 fullbeats is non-NULL, and measures is non-NULL, fullbeats 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.

double TimeMap2_timeToQN(ReaProject* proj, double tpos)
double TimeMap2_timeToQN(ReaProject proj, tpos)
number reaper.TimeMap2_timeToQN(ReaProject proj, number tpos)
Float RPR_TimeMap2_timeToQN(ReaProject proj, Float tpos)

converts project time position to QN position.

double TimeMap_curFrameRate(ReaProject* proj, bool* dropFrameOutOptional)
double TimeMap_curFrameRate(ReaProject proj, optional bool &dropFrame)
number retval, optional boolean dropFrame = reaper.TimeMap_curFrameRate(ReaProject proj)
(Float retval, ReaProject proj, Boolean dropFrameOutOptional) = RPR_TimeMap_curFrameRate(proj, dropFrameOutOptional)

Gets project framerate, and optionally whether it is drop-frame timecode

double TimeMap_GetDividedBpmAtTime(double time)
double TimeMap_GetDividedBpmAtTime(time)
number reaper.TimeMap_GetDividedBpmAtTime(number time)
Float RPR_TimeMap_GetDividedBpmAtTime(Float time)

get the effective BPM at the time (seconds) position (i.e. 2x in /8 signatures)

double TimeMap_GetMeasureInfo(ReaProject* proj, int measure, double* qn_startOut, double* qn_endOut, int* timesig_numOut, int* timesig_denomOut, double* tempoOut)
double TimeMap_GetMeasureInfo(ReaProject proj, int measure, &qn_start, &qn_end, int &timesig_num, int &timesig_denom, &tempo)
number retval, number qn_start, number qn_end, number timesig_num, number timesig_denom, number tempo = reaper.TimeMap_GetMeasureInfo(ReaProject proj, integer measure)
(Float retval, ReaProject proj, Int measure, Float qn_startOut, Float qn_endOut, Int timesig_numOut, Int timesig_denomOut, Float tempoOut) = RPR_TimeMap_GetMeasureInfo(proj, measure, qn_startOut, qn_endOut, timesig_numOut, timesig_denomOut, tempoOut)

Get the QN position and time signature information for the start of a measure. Return the time in seconds of the measure start.

int TimeMap_GetMetronomePattern(ReaProject* proj, double time, char* pattern, int pattern_sz)
int TimeMap_GetMetronomePattern(ReaProject proj, time, #pattern)
integer retval, string pattern = reaper.TimeMap_GetMetronomePattern(ReaProject proj, number time, string pattern)
(Int retval, ReaProject proj, Float time, String pattern, Int pattern_sz) = RPR_TimeMap_GetMetronomePattern(proj, time, pattern, pattern_sz)

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.

void TimeMap_GetTimeSigAtTime(ReaProject* proj, double time, int* timesig_numOut, int* timesig_denomOut, double* tempoOut)
TimeMap_GetTimeSigAtTime(ReaProject proj, time, int &timesig_num, int &timesig_denom, &tempo)
number timesig_num, number timesig_denom, number tempo = reaper.TimeMap_GetTimeSigAtTime(ReaProject proj, number time)
(ReaProject proj, Float time, Int timesig_numOut, Int timesig_denomOut, Float tempoOut) = RPR_TimeMap_GetTimeSigAtTime(proj, time, timesig_numOut, timesig_denomOut, tempoOut)

get the effective time signature and tempo

int TimeMap_QNToMeasures(ReaProject* proj, double qn, double* qnMeasureStartOutOptional, double* qnMeasureEndOutOptional)
int TimeMap_QNToMeasures(ReaProject proj, qn, optional &qnMeasureStart, optional &qnMeasureEnd)
integer retval, optional number qnMeasureStart, optional number qnMeasureEnd = reaper.TimeMap_QNToMeasures(ReaProject proj, number qn)
(Int retval, ReaProject proj, Float qn, Float qnMeasureStartOutOptional, Float qnMeasureEndOutOptional) = RPR_TimeMap_QNToMeasures(proj, qn, qnMeasureStartOutOptional, qnMeasureEndOutOptional)

Find which measure the given QN position falls in.

double TimeMap_QNToTime(double qn)
double TimeMap_QNToTime(qn)
number reaper.TimeMap_QNToTime(number qn)
Float RPR_TimeMap_QNToTime(Float qn)

converts project QN position to time.

double TimeMap_QNToTime_abs(ReaProject* proj, double qn)
double TimeMap_QNToTime_abs(ReaProject proj, qn)
number reaper.TimeMap_QNToTime_abs(ReaProject proj, number qn)
Float RPR_TimeMap_QNToTime_abs(ReaProject proj, Float qn)

Converts project quarter note count (QN) to time. QN is counted from the start of the project, regardless of any partial measures. See TimeMap2_QNToTime

double TimeMap_timeToQN(double tpos)
double TimeMap_timeToQN(tpos)
number reaper.TimeMap_timeToQN(number tpos)
Float RPR_TimeMap_timeToQN(Float tpos)

converts project QN position to time.

double TimeMap_timeToQN_abs(ReaProject* proj, double tpos)
double TimeMap_timeToQN_abs(ReaProject proj, tpos)
number reaper.TimeMap_timeToQN_abs(ReaProject proj, number tpos)
Float RPR_TimeMap_timeToQN_abs(ReaProject proj, Float tpos)

Converts project time position to quarter note count (QN). QN is counted from the start of the project, regardless of any partial measures. See TimeMap2_timeToQN

bool ToggleTrackSendUIMute(MediaTrack* track, int send_idx)
bool ToggleTrackSendUIMute(MediaTrack track, int send_idx)
boolean reaper.ToggleTrackSendUIMute(MediaTrack track, integer send_idx)
Boolean RPR_ToggleTrackSendUIMute(MediaTrack track, Int send_idx)

send_idx<0 for receives, >=0 for hw ouputs, >=nb_of_hw_ouputs for sends.

double Track_GetPeakHoldDB(MediaTrack* track, int channel, bool clear)
double Track_GetPeakHoldDB(MediaTrack track, int channel, bool clear)
number reaper.Track_GetPeakHoldDB(MediaTrack track, integer channel, boolean clear)
Float RPR_Track_GetPeakHoldDB(MediaTrack track, Int channel, Boolean clear)
double Track_GetPeakInfo(MediaTrack* track, int channel)
double Track_GetPeakInfo(MediaTrack track, int channel)
number reaper.Track_GetPeakInfo(MediaTrack track, integer channel)
Float RPR_Track_GetPeakInfo(MediaTrack track, Int channel)
void TrackCtl_SetToolTip(const char* fmt, int xpos, int ypos, bool topmost)
TrackCtl_SetToolTip("fmt", int xpos, int ypos, bool topmost)
reaper.TrackCtl_SetToolTip(string fmt, integer xpos, integer ypos, boolean topmost)
RPR_TrackCtl_SetToolTip(String fmt, Int xpos, Int ypos, Boolean topmost)

displays tooltip at location, or removes if empty string

int TrackFX_AddByName(MediaTrack* track, const char* fxname, bool recFX, int instantiate)
int TrackFX_AddByName(MediaTrack track, "fxname", bool recFX, int instantiate)
integer reaper.TrackFX_AddByName(MediaTrack track, string fxname, boolean recFX, integer instantiate)
Int RPR_TrackFX_AddByName(MediaTrack track, String fxname, Boolean recFX, Int instantiate)

Adds or queries the position of a named FX from the track FX chain (recFX=false) or record input FX/monitoring FX (recFX=true, monitoring FX are on master track). Specify a negative value for instantiate to always create a new effect, 0 to only query the first instance of an effect, or a positive value to add an instance if one is not found. fxname can have prefix to specify type: VST3:,VST2:,VST:,AU:,JS:, or DX:.

void TrackFX_CopyToTake(MediaTrack* src_track, int src_fx, MediaItem_Take* dest_take, int dest_fx, bool is_move)
TrackFX_CopyToTake(MediaTrack src_track, int src_fx, MediaItem_Take dest_take, int dest_fx, bool is_move)
reaper.TrackFX_CopyToTake(MediaTrack src_track, integer src_fx, MediaItem_Take dest_take, integer dest_fx, boolean is_move)
RPR_TrackFX_CopyToTake(MediaTrack src_track, Int src_fx, MediaItem_Take dest_take, Int dest_fx, Boolean is_move)

Copies (or moves) FX from src_track to dest_take. src_fx can have 0x1000000 set to reference input FX.

void TrackFX_CopyToTrack(MediaTrack* src_track, int src_fx, MediaTrack* dest_track, int dest_fx, bool is_move)
TrackFX_CopyToTrack(MediaTrack src_track, int src_fx, MediaTrack dest_track, int dest_fx, bool is_move)
reaper.TrackFX_CopyToTrack(MediaTrack src_track, integer src_fx, MediaTrack dest_track, integer dest_fx, boolean is_move)
RPR_TrackFX_CopyToTrack(MediaTrack src_track, Int src_fx, MediaTrack dest_track, Int dest_fx, Boolean is_move)

Copies (or moves) FX from src_track to dest_track. Can be used with src_track=dest_track to reorder, FX indices have 0x1000000 set to reference input FX.

bool TrackFX_Delete(MediaTrack* track, int fx)
bool TrackFX_Delete(MediaTrack track, int fx)
boolean reaper.TrackFX_Delete(MediaTrack track, integer fx)
Boolean RPR_TrackFX_Delete(MediaTrack track, Int fx)

Remove a FX from track chain (returns true on success)

bool TrackFX_EndParamEdit(MediaTrack* track, int fx, int param)
bool TrackFX_EndParamEdit(MediaTrack track, int fx, int param)
boolean reaper.TrackFX_EndParamEdit(MediaTrack track, integer fx, integer param)
Boolean RPR_TrackFX_EndParamEdit(MediaTrack track, Int fx, Int param)
bool TrackFX_FormatParamValue(MediaTrack* track, int fx, int param, double val, char* buf, int buf_sz)
bool TrackFX_FormatParamValue(MediaTrack track, int fx, int param, val, #buf)
boolean retval, string buf = reaper.TrackFX_FormatParamValue(MediaTrack track, integer fx, integer param, number val, string buf)
(Boolean retval, MediaTrack track, Int fx, Int param, Float val, String buf, Int buf_sz) = RPR_TrackFX_FormatParamValue(track, fx, param, val, buf, buf_sz)

Note: only works with FX that support Cockos VST extensions.

bool TrackFX_FormatParamValueNormalized(MediaTrack* track, int fx, int param, double value, char* buf, int buf_sz)
bool TrackFX_FormatParamValueNormalized(MediaTrack track, int fx, int param, value, #buf)
boolean retval, string buf = reaper.TrackFX_FormatParamValueNormalized(MediaTrack track, integer fx, integer param, number value, string buf)
(Boolean retval, MediaTrack track, Int fx, Int param, Float value, String buf, Int buf_sz) = RPR_TrackFX_FormatParamValueNormalized(track, fx, param, value, buf, buf_sz)

Note: only works with FX that support Cockos VST extensions.

int TrackFX_GetByName(MediaTrack* track, const char* fxname, bool instantiate)
int TrackFX_GetByName(MediaTrack track, "fxname", bool instantiate)
integer reaper.TrackFX_GetByName(MediaTrack track, string fxname, boolean instantiate)
Int RPR_TrackFX_GetByName(MediaTrack track, String fxname, Boolean instantiate)

Get the index of the first track FX insert that matches fxname. If the FX is not in the chain and instantiate is true, it will be inserted. See TrackFX_GetInstrument, TrackFX_GetEQ. Deprecated in favor of TrackFX_AddByName.

int TrackFX_GetChainVisible(MediaTrack* track)
int TrackFX_GetChainVisible(MediaTrack track)
integer reaper.TrackFX_GetChainVisible(MediaTrack track)
Int RPR_TrackFX_GetChainVisible(MediaTrack track)

returns index of effect visible in chain, or -1 for chain hidden, or -2 for chain visible but no effect selected

int TrackFX_GetCount(MediaTrack* track)
int TrackFX_GetCount(MediaTrack track)
integer reaper.TrackFX_GetCount(MediaTrack track)
Int RPR_TrackFX_GetCount(MediaTrack track)
bool TrackFX_GetEnabled(MediaTrack* track, int fx)
bool TrackFX_GetEnabled(MediaTrack track, int fx)
boolean reaper.TrackFX_GetEnabled(MediaTrack track, integer fx)
Boolean RPR_TrackFX_GetEnabled(MediaTrack track, Int fx)

See TrackFX_SetEnabled

int TrackFX_GetEQ(MediaTrack* track, bool instantiate)
int TrackFX_GetEQ(MediaTrack track, bool instantiate)
integer reaper.TrackFX_GetEQ(MediaTrack track, boolean instantiate)
Int RPR_TrackFX_GetEQ(MediaTrack track, Boolean instantiate)

Get the index of ReaEQ in the track FX chain. If ReaEQ is not in the chain and instantiate is true, it will be inserted. See TrackFX_GetInstrument, TrackFX_GetByName.

bool TrackFX_GetEQBandEnabled(MediaTrack* track, int fxidx, int bandtype, int bandidx)
bool TrackFX_GetEQBandEnabled(MediaTrack track, int fxidx, int bandtype, int bandidx)
boolean reaper.TrackFX_GetEQBandEnabled(MediaTrack track, integer fxidx, integer bandtype, integer bandidx)
Boolean RPR_TrackFX_GetEQBandEnabled(MediaTrack track, Int fxidx, Int bandtype, Int bandidx)
Returns true if the EQ band is enabled.
Returns false if the band is disabled, or if track/fxidx is not ReaEQ.
Bandtype: 0=lhipass, 1=loshelf, 2=band, 3=notch, 4=hishelf, 5=lopass.
Bandidx: 0=first band matching bandtype, 1=2nd band matching bandtype, etc.

See TrackFX_GetEQ, TrackFX_GetEQParam, TrackFX_SetEQParam, TrackFX_SetEQBandEnabled.

bool TrackFX_GetEQParam(MediaTrack* track, int fxidx, int paramidx, int* bandtypeOut, int* bandidxOut, int* paramtypeOut, double* normvalOut)
bool TrackFX_GetEQParam(MediaTrack track, int fxidx, int paramidx, int &bandtype, int &bandidx, int &paramtype, &normval)
boolean retval, number bandtype, number bandidx, number paramtype, number normval = reaper.TrackFX_GetEQParam(MediaTrack track, integer fxidx, integer paramidx)
(Boolean retval, MediaTrack track, Int fxidx, Int paramidx, Int bandtypeOut, Int bandidxOut, Int paramtypeOut, Float normvalOut) = RPR_TrackFX_GetEQParam(track, fxidx, paramidx, bandtypeOut, bandidxOut, paramtypeOut, normvalOut)
Returns false if track/fxidx is not ReaEQ.
Bandtype: -1=master gain, 0=lhipass, 1=loshelf, 2=band, 3=notch, 4=hishelf, 5=lopass.
Bandidx (ignored for master gain): 0=first band matching bandtype, 1=2nd band matching bandtype, etc.
Paramtype (ignored for master gain): 0=freq, 1=gain, 2=Q.

See TrackFX_GetEQ, TrackFX_SetEQParam, TrackFX_GetEQBandEnabled, TrackFX_SetEQBandEnabled.

HWND TrackFX_GetFloatingWindow(MediaTrack* track, int index)
HWND TrackFX_GetFloatingWindow(MediaTrack track, int index)
HWND reaper.TrackFX_GetFloatingWindow(MediaTrack track, integer index)
HWND RPR_TrackFX_GetFloatingWindow(MediaTrack track, Int index)

returns HWND of floating window for effect index, if any

bool TrackFX_GetFormattedParamValue(MediaTrack* track, int fx, int param, char* buf, int buf_sz)
bool TrackFX_GetFormattedParamValue(MediaTrack track, int fx, int param, #buf)
boolean retval, string buf = reaper.TrackFX_GetFormattedParamValue(MediaTrack track, integer fx, integer param, string buf)
(Boolean retval, MediaTrack track, Int fx, Int param, String buf, Int buf_sz) = RPR_TrackFX_GetFormattedParamValue(track, fx, param, buf, buf_sz)
GUID* TrackFX_GetFXGUID(MediaTrack* track, int fx)
bool TrackFX_GetFXGUID(#retguid, MediaTrack track, int fx)
string GUID = reaper.TrackFX_GetFXGUID(MediaTrack track, integer fx)
GUID RPR_TrackFX_GetFXGUID(MediaTrack track, Int fx)
bool TrackFX_GetFXName(MediaTrack* track, int fx, char* buf, int buf_sz)
bool TrackFX_GetFXName(MediaTrack track, int fx, #buf)
boolean retval, string buf = reaper.TrackFX_GetFXName(MediaTrack track, integer fx, string buf)
(Boolean retval, MediaTrack track, Int fx, String buf, Int buf_sz) = RPR_TrackFX_GetFXName(track, fx, buf, buf_sz)
int TrackFX_GetInstrument(MediaTrack* track)
int TrackFX_GetInstrument(MediaTrack track)
integer reaper.TrackFX_GetInstrument(MediaTrack track)
Int RPR_TrackFX_GetInstrument(MediaTrack track)

Get the index of the first track FX insert that is a virtual instrument, or -1 if none. See TrackFX_GetEQ, TrackFX_GetByName.

int TrackFX_GetIOSize(MediaTrack* track, int fx, int* inputPinsOutOptional, int* outputPinsOutOptional)
int TrackFX_GetIOSize(MediaTrack track, int fx, optional int &inputPins, optional int &outputPins)
integer retval, optional number inputPins, optional number outputPins = reaper.TrackFX_GetIOSize(MediaTrack track, integer fx)
(Int retval, MediaTrack track, Int fx, Int inputPinsOutOptional, Int outputPinsOutOptional) = RPR_TrackFX_GetIOSize(track, fx, inputPinsOutOptional, outputPinsOutOptional)

sets the number of input/output pins for FX if available, returns plug-in type or -1 on error

bool TrackFX_GetNamedConfigParm(MediaTrack* track, int fx, const char* parmname, char* bufOut, int bufOut_sz)
bool TrackFX_GetNamedConfigParm(MediaTrack track, int fx, "parmname", #buf)
boolean retval, string buf = reaper.TrackFX_GetNamedConfigParm(MediaTrack track, integer fx, string parmname)
(Boolean retval, MediaTrack track, Int fx, String parmname, String bufOut, Int bufOut_sz) = RPR_TrackFX_GetNamedConfigParm(track, fx, parmname, bufOut, bufOut_sz)

gets plug-in specific named configuration value (returns true on success). Special values: 'pdc' returns PDC latency. 'in_pin_0' returns name of first input pin (if available), 'out_pin_0' returns name of first output pin (if available), etc.

int TrackFX_GetNumParams(MediaTrack* track, int fx)
int TrackFX_GetNumParams(MediaTrack track, int fx)
integer reaper.TrackFX_GetNumParams(MediaTrack track, integer fx)
Int RPR_TrackFX_GetNumParams(MediaTrack track, Int fx)
bool TrackFX_GetOffline(MediaTrack* track, int fx)
bool TrackFX_GetOffline(MediaTrack track, int fx)
boolean reaper.TrackFX_GetOffline(MediaTrack track, integer fx)
Boolean RPR_TrackFX_GetOffline(MediaTrack track, Int fx)

See TrackFX_SetOffline

bool TrackFX_GetOpen(MediaTrack* track, int fx)
bool TrackFX_GetOpen(MediaTrack track, int fx)
boolean reaper.TrackFX_GetOpen(MediaTrack track, integer fx)
Boolean RPR_TrackFX_GetOpen(MediaTrack track, Int fx)

Returns true if this FX UI is open in the FX chain window or a floating window. See TrackFX_SetOpen

double TrackFX_GetParam(MediaTrack* track, int fx, int param, double* minvalOut, double* maxvalOut)
double TrackFX_GetParam(MediaTrack track, int fx, int param, &minval, &maxval)
number retval, number minval, number maxval = reaper.TrackFX_GetParam(MediaTrack track, integer fx, integer param)
(Float retval, MediaTrack track, Int fx, Int param, Float minvalOut, Float maxvalOut) = RPR_TrackFX_GetParam(track, fx, param, minvalOut, maxvalOut)
bool TrackFX_GetParameterStepSizes(MediaTrack* track, int fx, int param, double* stepOut, double* smallstepOut, double* largestepOut, bool* istoggleOut)
bool TrackFX_GetParameterStepSizes(MediaTrack track, int fx, int param, &step, &smallstep, &largestep, bool &istoggle)
boolean retval, number step, number smallstep, number largestep, boolean istoggle = reaper.TrackFX_GetParameterStepSizes(MediaTrack track, integer fx, integer param)
(Boolean retval, MediaTrack track, Int fx, Int param, Float stepOut, Float smallstepOut, Float largestepOut, Boolean istoggleOut) = RPR_TrackFX_GetParameterStepSizes(track, fx, param, stepOut, smallstepOut, largestepOut, istoggleOut)
double TrackFX_GetParamEx(MediaTrack* track, int fx, int param, double* minvalOut, double* maxvalOut, double* midvalOut)
double TrackFX_GetParamEx(MediaTrack track, int fx, int param, &minval, &maxval, &midval)
number retval, number minval, number maxval, number midval = reaper.TrackFX_GetParamEx(MediaTrack track, integer fx, integer param)
(Float retval, MediaTrack track, Int fx, Int param, Float minvalOut, Float maxvalOut, Float midvalOut) = RPR_TrackFX_GetParamEx(track, fx, param, minvalOut, maxvalOut, midvalOut)
bool TrackFX_GetParamName(MediaTrack* track, int fx, int param, char* buf, int buf_sz)
bool TrackFX_GetParamName(MediaTrack track, int fx, int param, #buf)
boolean retval, string buf = reaper.TrackFX_GetParamName(MediaTrack track, integer fx, integer param, string buf)
(Boolean retval, MediaTrack track, Int fx, Int param, String buf, Int buf_sz) = RPR_TrackFX_GetParamName(track, fx, param, buf, buf_sz)
double TrackFX_GetParamNormalized(MediaTrack* track, int fx, int param)
double TrackFX_GetParamNormalized(MediaTrack track, int fx, int param)
number reaper.TrackFX_GetParamNormalized(MediaTrack track, integer fx, integer param)
Float RPR_TrackFX_GetParamNormalized(MediaTrack track, Int fx, Int param)
int TrackFX_GetPinMappings(MediaTrack* tr, int fx, int isoutput, int pin, int* high32OutOptional)
int TrackFX_GetPinMappings(MediaTrack tr, int fx, int isoutput, int pin, optional int &high32)
integer retval, optional number high32 = reaper.TrackFX_GetPinMappings(MediaTrack tr, integer fx, integer isoutput, integer pin)
(Int retval, MediaTrack tr, Int fx, Int isoutput, Int pin, Int high32OutOptional) = RPR_TrackFX_GetPinMappings(tr, fx, isoutput, pin, high32OutOptional)

gets the effective channel mapping bitmask for a particular pin. high32OutOptional will be set to the high 32 bits

bool TrackFX_GetPreset(MediaTrack* track, int fx, char* presetname, int presetname_sz)
bool TrackFX_GetPreset(MediaTrack track, int fx, #presetname)
boolean retval, string presetname = reaper.TrackFX_GetPreset(MediaTrack track, integer fx, string presetname)
(Boolean retval, MediaTrack track, Int fx, String presetname, Int presetname_sz) = RPR_TrackFX_GetPreset(track, fx, presetname, presetname_sz)

Get the name of the preset currently showing in the REAPER dropdown, or the full path to a factory preset file for VST3 plug-ins (.vstpreset). Returns false if the current FX parameters do not exactly match the preset (in other words, if the user loaded the preset but moved the knobs afterward). See TrackFX_SetPreset.

int TrackFX_GetPresetIndex(MediaTrack* track, int fx, int* numberOfPresetsOut)
int TrackFX_GetPresetIndex(MediaTrack track, int fx, int &numberOfPresets)
integer retval, number numberOfPresets = reaper.TrackFX_GetPresetIndex(MediaTrack track, integer fx)
(Int retval, MediaTrack track, Int fx, Int numberOfPresetsOut) = RPR_TrackFX_GetPresetIndex(track, fx, numberOfPresetsOut)

Returns current preset index, or -1 if error. numberOfPresetsOut will be set to total number of presets available. See TrackFX_SetPresetByIndex

int TrackFX_GetRecChainVisible(MediaTrack* track)
int TrackFX_GetRecChainVisible(MediaTrack track)
integer reaper.TrackFX_GetRecChainVisible(MediaTrack track)
Int RPR_TrackFX_GetRecChainVisible(MediaTrack track)

returns index of effect visible in record input chain, or -1 for chain hidden, or -2 for chain visible but no effect selected

int TrackFX_GetRecCount(MediaTrack* track)
int TrackFX_GetRecCount(MediaTrack track)
integer reaper.TrackFX_GetRecCount(MediaTrack track)
Int RPR_TrackFX_GetRecCount(MediaTrack track)

returns count of record input FX. To access record input FX, use a FX indices [0x1000000..0x1000000+n). On the master track, this accesses monitoring FX rather than record input FX.

void TrackFX_GetUserPresetFilename(MediaTrack* track, int fx, char* fn, int fn_sz)
TrackFX_GetUserPresetFilename(MediaTrack track, int fx, #fn)
string fn = reaper.TrackFX_GetUserPresetFilename(MediaTrack track, integer fx, string fn)
(MediaTrack track, Int fx, String fn, Int fn_sz) = RPR_TrackFX_GetUserPresetFilename(track, fx, fn, fn_sz)
bool TrackFX_NavigatePresets(MediaTrack* track, int fx, int presetmove)
bool TrackFX_NavigatePresets(MediaTrack track, int fx, int presetmove)
boolean reaper.TrackFX_NavigatePresets(MediaTrack track, integer fx, integer presetmove)
Boolean RPR_TrackFX_NavigatePresets(MediaTrack track, Int fx, Int presetmove)

presetmove==1 activates the next preset, presetmove==-1 activates the previous preset, etc.

void TrackFX_SetEnabled(MediaTrack* track, int fx, bool enabled)
TrackFX_SetEnabled(MediaTrack track, int fx, bool enabled)
reaper.TrackFX_SetEnabled(MediaTrack track, integer fx, boolean enabled)
RPR_TrackFX_SetEnabled(MediaTrack track, Int fx, Boolean enabled)

See TrackFX_GetEnabled

bool TrackFX_SetEQBandEnabled(MediaTrack* track, int fxidx, int bandtype, int bandidx, bool enable)
bool TrackFX_SetEQBandEnabled(MediaTrack track, int fxidx, int bandtype, int bandidx, bool enable)
boolean reaper.TrackFX_SetEQBandEnabled(MediaTrack track, integer fxidx, integer bandtype, integer bandidx, boolean enable)
Boolean RPR_TrackFX_SetEQBandEnabled(MediaTrack track, Int fxidx, Int bandtype, Int bandidx, Boolean enable)
Enable or disable a ReaEQ band.
Returns false if track/fxidx is not ReaEQ.
Bandtype: 0=lhipass, 1=loshelf, 2=band, 3=notch, 4=hishelf, 5=lopass.
Bandidx: 0=first band matching bandtype, 1=2nd band matching bandtype, etc.

See TrackFX_GetEQ, TrackFX_GetEQParam, TrackFX_SetEQParam, TrackFX_GetEQBandEnabled.

bool TrackFX_SetEQParam(MediaTrack* track, int fxidx, int bandtype, int bandidx, int paramtype, double val, bool isnorm)
bool TrackFX_SetEQParam(MediaTrack track, int fxidx, int bandtype, int bandidx, int paramtype, val, bool isnorm)
boolean reaper.TrackFX_SetEQParam(MediaTrack track, integer fxidx, integer bandtype, integer bandidx, integer paramtype, number val, boolean isnorm)
Boolean RPR_TrackFX_SetEQParam(MediaTrack track, Int fxidx, Int bandtype, Int bandidx, Int paramtype, Float val, Boolean isnorm)
Returns false if track/fxidx is not ReaEQ. Targets a band matching bandtype.
Bandtype: -1=master gain, 0=lhipass, 1=loshelf, 2=band, 3=notch, 4=hishelf, 5=lopass.
Bandidx (ignored for master gain): 0=target first band matching bandtype, 1=target 2nd band matching bandtype, etc.
Paramtype (ignored for master gain): 0=freq, 1=gain, 2=Q.

See TrackFX_GetEQ, TrackFX_GetEQParam, TrackFX_GetEQBandEnabled, TrackFX_SetEQBandEnabled.

bool TrackFX_SetNamedConfigParm(MediaTrack* track, int fx, const char* parmname, const char* value)
bool TrackFX_SetNamedConfigParm(MediaTrack track, int fx, "parmname", "value")
boolean reaper.TrackFX_SetNamedConfigParm(MediaTrack track, integer fx, string parmname, string value)
Boolean RPR_TrackFX_SetNamedConfigParm(MediaTrack track, Int fx, String parmname, String value)

sets plug-in specific named configuration value (returns true on success)

void TrackFX_SetOffline(MediaTrack* track, int fx, bool offline)
TrackFX_SetOffline(MediaTrack track, int fx, bool offline)
reaper.TrackFX_SetOffline(MediaTrack track, integer fx, boolean offline)
RPR_TrackFX_SetOffline(MediaTrack track, Int fx, Boolean offline)

See TrackFX_GetOffline

void TrackFX_SetOpen(MediaTrack* track, int fx, bool open)
TrackFX_SetOpen(MediaTrack track, int fx, bool open)
reaper.TrackFX_SetOpen(MediaTrack track, integer fx, boolean open)
RPR_TrackFX_SetOpen(MediaTrack track, Int fx, Boolean open)

Open this FX UI. See TrackFX_GetOpen

bool TrackFX_SetParam(MediaTrack* track, int fx, int param, double val)
bool TrackFX_SetParam(MediaTrack track, int fx, int param, val)
boolean reaper.TrackFX_SetParam(MediaTrack track, integer fx, integer param, number val)
Boolean RPR_TrackFX_SetParam(MediaTrack track, Int fx, Int param, Float val)
bool TrackFX_SetParamNormalized(MediaTrack* track, int fx, int param, double value)
bool TrackFX_SetParamNormalized(MediaTrack track, int fx, int param, value)
boolean reaper.TrackFX_SetParamNormalized(MediaTrack track, integer fx, integer param, number value)
Boolean RPR_TrackFX_SetParamNormalized(MediaTrack track, Int fx, Int param, Float value)
bool TrackFX_SetPinMappings(MediaTrack* tr, int fx, int isoutput, int pin, int low32bits, int hi32bits)
bool TrackFX_SetPinMappings(MediaTrack tr, int fx, int isoutput, int pin, int low32bits, int hi32bits)
boolean reaper.TrackFX_SetPinMappings(MediaTrack tr, integer fx, integer isoutput, integer pin, integer low32bits, integer hi32bits)
Boolean RPR_TrackFX_SetPinMappings(MediaTrack tr, Int fx, Int isoutput, Int pin, Int low32bits, Int hi32bits)

sets the channel mapping bitmask for a particular pin. returns false if unsupported (not all types of plug-ins support this capability)

bool TrackFX_SetPreset(MediaTrack* track, int fx, const char* presetname)
bool TrackFX_SetPreset(MediaTrack track, int fx, "presetname")
boolean reaper.TrackFX_SetPreset(MediaTrack track, integer fx, string presetname)
Boolean RPR_TrackFX_SetPreset(MediaTrack track, Int fx, String presetname)

Activate a preset with the name shown in the REAPER dropdown. Full paths to .vstpreset files are also supported for VST3 plug-ins. See TrackFX_GetPreset.

bool TrackFX_SetPresetByIndex(MediaTrack* track, int fx, int idx)
bool TrackFX_SetPresetByIndex(MediaTrack track, int fx, int idx)
boolean reaper.TrackFX_SetPresetByIndex(MediaTrack track, integer fx, integer idx)
Boolean RPR_TrackFX_SetPresetByIndex(MediaTrack track, Int fx, Int idx)

Sets the preset idx, or the factory preset (idx==-2), or the default user preset (idx==-1). Returns true on success. See TrackFX_GetPresetIndex.

void TrackFX_Show(MediaTrack* track, int index, int showFlag)
TrackFX_Show(MediaTrack track, int index, int showFlag)
reaper.TrackFX_Show(MediaTrack track, integer index, integer showFlag)
RPR_TrackFX_Show(MediaTrack track, Int index, Int showFlag)

showflag=0 for hidechain, =1 for show chain(index valid), =2 for hide floating window(index valid), =3 for show floating window (index valid)

void TrackList_AdjustWindows(bool isMinor)
TrackList_AdjustWindows(bool isMinor)
reaper.TrackList_AdjustWindows(boolean isMinor)
RPR_TrackList_AdjustWindows(Boolean isMinor)
void TrackList_UpdateAllExternalSurfaces()
TrackList_UpdateAllExternalSurfaces()
reaper.TrackList_UpdateAllExternalSurfaces()
RPR_TrackList_UpdateAllExternalSurfaces()
void Undo_BeginBlock()
Undo_BeginBlock()
reaper.Undo_BeginBlock()
RPR_Undo_BeginBlock()

call to start a new block

void Undo_BeginBlock2(ReaProject* proj)
Undo_BeginBlock2(ReaProject proj)
reaper.Undo_BeginBlock2(ReaProject proj)
RPR_Undo_BeginBlock2(ReaProject proj)

call to start a new block

const char* Undo_CanRedo2(ReaProject* proj)
bool Undo_CanRedo2(#retval, ReaProject proj)
string reaper.Undo_CanRedo2(ReaProject proj)
String RPR_Undo_CanRedo2(ReaProject proj)

returns string of next action,if able,NULL if not

const char* Undo_CanUndo2(ReaProject* proj)
bool Undo_CanUndo2(#retval, ReaProject proj)
string reaper.Undo_CanUndo2(ReaProject proj)
String RPR_Undo_CanUndo2(ReaProject proj)

returns string of last action,if able,NULL if not

int Undo_DoRedo2(ReaProject* proj)
int Undo_DoRedo2(ReaProject proj)
integer reaper.Undo_DoRedo2(ReaProject proj)
Int RPR_Undo_DoRedo2(ReaProject proj)

nonzero if success

int Undo_DoUndo2(ReaProject* proj)
int Undo_DoUndo2(ReaProject proj)
integer reaper.Undo_DoUndo2(ReaProject proj)
Int RPR_Undo_DoUndo2(ReaProject proj)

nonzero if success

void Undo_EndBlock(const char* descchange, int extraflags)
Undo_EndBlock("descchange", int extraflags)
reaper.Undo_EndBlock(string descchange, integer extraflags)
RPR_Undo_EndBlock(String descchange, Int extraflags)

call to end the block,with extra flags if any,and a description

void Undo_EndBlock2(ReaProject* proj, const char* descchange, int extraflags)
Undo_EndBlock2(ReaProject proj, "descchange", int extraflags)
reaper.Undo_EndBlock2(ReaProject proj, string descchange, integer extraflags)
RPR_Undo_EndBlock2(ReaProject proj, String descchange, Int extraflags)

call to end the block,with extra flags if any,and a description

void Undo_OnStateChange(const char* descchange)
Undo_OnStateChange("descchange")
reaper.Undo_OnStateChange(string descchange)
RPR_Undo_OnStateChange(String descchange)

limited state change to items

void Undo_OnStateChange2(ReaProject* proj, const char* descchange)
Undo_OnStateChange2(ReaProject proj, "descchange")
reaper.Undo_OnStateChange2(ReaProject proj, string descchange)
RPR_Undo_OnStateChange2(ReaProject proj, String descchange)

limited state change to items

void Undo_OnStateChange_Item(ReaProject* proj, const char* name, MediaItem* item)
Undo_OnStateChange_Item(ReaProject proj, "name", MediaItem item)
reaper.Undo_OnStateChange_Item(ReaProject proj, string name, MediaItem item)
RPR_Undo_OnStateChange_Item(ReaProject proj, String name, MediaItem item)
void Undo_OnStateChangeEx(const char* descchange, int whichStates, int trackparm)
Undo_OnStateChangeEx("descchange", int whichStates, int trackparm)
reaper.Undo_OnStateChangeEx(string descchange, integer whichStates, integer trackparm)
RPR_Undo_OnStateChangeEx(String descchange, Int whichStates, Int trackparm)

trackparm=-1 by default,or if updating one fx chain,you can specify track index

void Undo_OnStateChangeEx2(ReaProject* proj, const char* descchange, int whichStates, int trackparm)
Undo_OnStateChangeEx2(ReaProject proj, "descchange", int whichStates, int trackparm)
reaper.Undo_OnStateChangeEx2(ReaProject proj, string descchange, integer whichStates, integer trackparm)
RPR_Undo_OnStateChangeEx2(ReaProject proj, String descchange, Int whichStates, Int trackparm)

trackparm=-1 by default,or if updating one fx chain,you can specify track index

void UpdateArrange()
UpdateArrange()
reaper.UpdateArrange()
RPR_UpdateArrange()

Redraw the arrange view

void UpdateItemInProject(MediaItem* item)
UpdateItemInProject(MediaItem item)
reaper.UpdateItemInProject(MediaItem item)
RPR_UpdateItemInProject(MediaItem item)
void UpdateTimeline()
UpdateTimeline()
reaper.UpdateTimeline()
RPR_UpdateTimeline()

Redraw the arrange view and ruler

bool ValidatePtr(void* pointer, const char* ctypename)
bool ValidatePtr(void* pointer, "ctypename")
boolean reaper.ValidatePtr(identifier pointer, string ctypename)
Boolean RPR_ValidatePtr(void pointer, String ctypename)

see ValidatePtr2

bool ValidatePtr2(ReaProject* proj, void* pointer, const char* ctypename)
bool ValidatePtr2(ReaProject proj, void* pointer, "ctypename")
boolean reaper.ValidatePtr2(ReaProject proj, identifier pointer, string ctypename)
Boolean RPR_ValidatePtr2(ReaProject proj, void pointer, String ctypename)

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*.

void ViewPrefs(int page, const char* pageByName)
ViewPrefs(int page, "pageByName")
reaper.ViewPrefs(integer page, string pageByName)
RPR_ViewPrefs(Int page, String pageByName)

Opens the prefs to a page, use pageByName if page is 0.

BR_Envelope* BR_EnvAlloc(TrackEnvelope* envelope, bool takeEnvelopesUseProjectTime)
BR_Envelope extension_api("BR_EnvAlloc", TrackEnvelope envelope, bool takeEnvelopesUseProjectTime)
BR_Envelope reaper.BR_EnvAlloc(TrackEnvelope envelope, boolean takeEnvelopesUseProjectTime)
BR_Envelope BR_EnvAlloc(TrackEnvelope envelope, Boolean takeEnvelopesUseProjectTime)
[BR] Allocate envelope object from track or take envelope pointer. Always call BR_EnvFree when done to release the object and commit changes if needed.
takeEnvelopesUseProjectTime: take envelope points' positions are counted from take position, not project start time. If you want to work with project time instead, pass this as true.

For further manipulation see BR_EnvCountPoints, BR_EnvDeletePoint, BR_EnvFind, BR_EnvFindNext, BR_EnvFindPrevious, BR_EnvGetParentTake, BR_EnvGetParentTrack, BR_EnvGetPoint, BR_EnvGetProperties, BR_EnvSetPoint, BR_EnvSetProperties, BR_EnvValueAtPos.

int BR_EnvCountPoints(BR_Envelope* envelope)
int extension_api("BR_EnvCountPoints", BR_Envelope envelope)
integer reaper.BR_EnvCountPoints(BR_Envelope envelope)
Int BR_EnvCountPoints(BR_Envelope envelope)

[BR] Count envelope points in the envelope object allocated with BR_EnvAlloc.

bool BR_EnvDeletePoint(BR_Envelope* envelope, int id)
bool extension_api("BR_EnvDeletePoint", BR_Envelope envelope, int id)
boolean reaper.BR_EnvDeletePoint(BR_Envelope envelope, integer id)
Boolean BR_EnvDeletePoint(BR_Envelope envelope, Int id)

[BR] Delete envelope point by index (zero-based) in the envelope object allocated with BR_EnvAlloc. Returns true on success.

int BR_EnvFind(BR_Envelope* envelope, double position, double delta)
int extension_api("BR_EnvFind", BR_Envelope envelope, position, delta)
integer reaper.BR_EnvFind(BR_Envelope envelope, number position, number delta)
Int BR_EnvFind(BR_Envelope envelope, Float position, Float delta)

[BR] Find envelope point at time position in the envelope object allocated with BR_EnvAlloc. Pass delta > 0 to search surrounding range - in that case the closest point to position within delta will be searched for. Returns envelope point id (zero-based) on success or -1 on failure.

int BR_EnvFindNext(BR_Envelope* envelope, double position)
int extension_api("BR_EnvFindNext", BR_Envelope envelope, position)
integer reaper.BR_EnvFindNext(BR_Envelope envelope, number position)
Int BR_EnvFindNext(BR_Envelope envelope, Float position)

[BR] Find next envelope point after time position in the envelope object allocated with BR_EnvAlloc. Returns envelope point id (zero-based) on success or -1 on failure.

int BR_EnvFindPrevious(BR_Envelope* envelope, double position)
int extension_api("BR_EnvFindPrevious", BR_Envelope envelope, position)
integer reaper.BR_EnvFindPrevious(BR_Envelope envelope, number position)
Int BR_EnvFindPrevious(BR_Envelope envelope, Float position)

[BR] Find previous envelope point before time position in the envelope object allocated with BR_EnvAlloc. Returns envelope point id (zero-based) on success or -1 on failure.

bool BR_EnvFree(BR_Envelope* envelope, bool commit)
bool extension_api("BR_EnvFree", BR_Envelope envelope, bool commit)
boolean reaper.BR_EnvFree(BR_Envelope envelope, boolean commit)
Boolean BR_EnvFree(BR_Envelope envelope, Boolean commit)

[BR] Free envelope object allocated with BR_EnvAlloc and commit changes if needed. Returns true if changes were committed successfully. Note that when envelope object wasn't modified nothing will get committed even if commit = true - in that case function returns false.

MediaItem_Take* BR_EnvGetParentTake(BR_Envelope* envelope)
MediaItem_Take extension_api("BR_EnvGetParentTake", BR_Envelope envelope)
MediaItem_Take reaper.BR_EnvGetParentTake(BR_Envelope envelope)
MediaItem_Take BR_EnvGetParentTake(BR_Envelope envelope)

[BR] If envelope object allocated with BR_EnvAlloc is take envelope, returns parent media item take, otherwise NULL.

MediaItem* BR_EnvGetParentTrack(BR_Envelope* envelope)
MediaItem extension_api("BR_EnvGetParentTrack", BR_Envelope envelope)
MediaItem reaper.BR_EnvGetParentTrack(BR_Envelope envelope)
MediaItem BR_EnvGetParentTrack(BR_Envelope envelope)

[BR] Get parent track of envelope object allocated with BR_EnvAlloc. If take envelope, returns NULL.

bool BR_EnvGetPoint(BR_Envelope* envelope, int id, double* positionOut, double* valueOut, int* shapeOut, bool* selectedOut, double* bezierOut)
bool extension_api("BR_EnvGetPoint", BR_Envelope envelope, int id, &position, &value, int &shape, bool &selected, &bezier)
boolean retval, number position, number value, number shape, boolean selected, number bezier = reaper.BR_EnvGetPoint(BR_Envelope envelope, integer id)
(Boolean retval, BR_Envelope envelope, Int id, Float positionOut, Float valueOut, Int shapeOut, Boolean selectedOut, Float bezierOut) = BR_EnvGetPoint(envelope, id, positionOut, valueOut, shapeOut, selectedOut, bezierOut)

[BR] Get envelope point by id (zero-based) from the envelope object allocated with BR_EnvAlloc. Returns true on success.

void BR_EnvGetProperties(BR_Envelope* envelope, bool* activeOut, bool* visibleOut, bool* armedOut, bool* inLaneOut, int* laneHeightOut, int* defaultShapeOut, double* minValueOut, double* maxValueOut, double* centerValueOut, int* typeOut, bool* faderScalingOut)
extension_api("BR_EnvGetProperties", BR_Envelope envelope, bool &active, bool &visible, bool &armed, bool &inLane, int &laneHeight, int &defaultShape, &minValue, &maxValue, &centerValue, int &type, bool &faderScaling)
boolean active, boolean visible, boolean armed, boolean inLane, number laneHeight, number defaultShape, number minValue, number maxValue, number centerValue, number type, boolean faderScaling = reaper.BR_EnvGetProperties(BR_Envelope envelope)
(BR_Envelope envelope, Boolean activeOut, Boolean visibleOut, Boolean armedOut, Boolean inLaneOut, Int laneHeightOut, Int defaultShapeOut, Float minValueOut, Float maxValueOut, Float centerValueOut, Int typeOut, Boolean faderScalingOut) = BR_EnvGetProperties(envelope, activeOut, visibleOut, armedOut, inLaneOut, laneHeightOut, defaultShapeOut, minValueOut, maxValueOut, centerValueOut, typeOut, faderScalingOut)
[BR] Get envelope properties for the envelope object allocated with BR_EnvAlloc.

active: true if envelope is active
visible: true if envelope is visible
armed: true if envelope is armed
inLane: true if envelope has it's own envelope lane
laneHeight: envelope lane override height. 0 for none, otherwise size in pixels
defaultShape: default point shape: 0->Linear, 1->Square, 2->Slow start/end, 3->Fast start, 4->Fast end, 5->Bezier
minValue: minimum envelope value
maxValue: maximum envelope value
type: envelope type: 0->Volume, 1->Volume (Pre-FX), 2->Pan, 3->Pan (Pre-FX), 4->Width, 5->Width (Pre-FX), 6->Mute, 7->Pitch, 8->Playrate, 9->Tempo map, 10->Parameter

faderScaling: true if envelope uses fader scaling

bool BR_EnvSetPoint(BR_Envelope* envelope, int id, double position, double value, int shape, bool selected, double bezier)
bool extension_api("BR_EnvSetPoint", BR_Envelope envelope, int id, position, value, int shape, bool selected, bezier)
boolean reaper.BR_EnvSetPoint(BR_Envelope envelope, integer id, number position, number value, integer shape, boolean selected, number bezier)
Boolean BR_EnvSetPoint(BR_Envelope envelope, Int id, Float position, Float value, Int shape, Boolean selected, Float bezier)
[BR] Set envelope point by id (zero-based) in the envelope object allocated with BR_EnvAlloc. To create point instead, pass id = -1. Note that if new point is inserted or existing point's time position is changed, points won't automatically get sorted. To do that, see BR_EnvSortPoints.

Returns true on success.

void BR_EnvSetProperties(BR_Envelope* envelope, bool active, bool visible, bool armed, bool inLane, int laneHeight, int defaultShape, bool faderScaling)
extension_api("BR_EnvSetProperties", BR_Envelope envelope, bool active, bool visible, bool armed, bool inLane, int laneHeight, int defaultShape, bool faderScaling)
reaper.BR_EnvSetProperties(BR_Envelope envelope, boolean active, boolean visible, boolean armed, boolean inLane, integer laneHeight, integer defaultShape, boolean faderScaling)
BR_EnvSetProperties(BR_Envelope envelope, Boolean active, Boolean visible, Boolean armed, Boolean inLane, Int laneHeight, Int defaultShape, Boolean faderScaling)

[BR] Set envelope properties for the envelope object allocated with BR_EnvAlloc. For parameter description see BR_EnvGetProperties.

void BR_EnvSortPoints(BR_Envelope* envelope)
extension_api("BR_EnvSortPoints", BR_Envelope envelope)
reaper.BR_EnvSortPoints(BR_Envelope envelope)
BR_EnvSortPoints(BR_Envelope envelope)

[BR] Sort envelope points by position. The only reason to call this is if sorted points are explicitly needed after editing them with BR_EnvSetPoint. Note that you do not have to call this before doing BR_EnvFree since it does handle unsorted points too.

double BR_EnvValueAtPos(BR_Envelope* envelope, double position)
double extension_api("BR_EnvValueAtPos", BR_Envelope envelope, position)
number reaper.BR_EnvValueAtPos(BR_Envelope envelope, number position)
Float BR_EnvValueAtPos(BR_Envelope envelope, Float position)

[BR] Get envelope value at time position for the envelope object allocated with BR_EnvAlloc.

void BR_GetArrangeView(ReaProject* proj, double* startTimeOut, double* endTimeOut)
extension_api("BR_GetArrangeView", ReaProject proj, &startTime, &endTime)
number startTime, number endTime = reaper.BR_GetArrangeView(ReaProject proj)
(ReaProject proj, Float startTimeOut, Float endTimeOut) = BR_GetArrangeView(proj, startTimeOut, endTimeOut)

[BR] Deprecated, see GetSet_ArrangeView2 (REAPER v5.12pre4+) -- Get start and end time position of arrange view. To set arrange view instead, see BR_SetArrangeView.

double BR_GetClosestGridDivision(double position)
double extension_api("BR_GetClosestGridDivision", position)
number reaper.BR_GetClosestGridDivision(number position)
Float BR_GetClosestGridDivision(Float position)

[BR] Get closest grid division to position. Note that this functions is different from SnapToGrid in two regards. SnapToGrid() needs snap enabled to work and this one works always. Secondly, grid divisions are different from grid lines because some grid lines may be hidden due to zoom level - this function ignores grid line visibility and always searches for the closest grid division at given position. For more grid division functions, see BR_GetNextGridDivision and BR_GetPrevGridDivision.

void BR_GetCurrentTheme(char* themePathOut, int themePathOut_sz, char* themeNameOut, int themeNameOut_sz)
extension_api("BR_GetCurrentTheme", #themePath, #themeName)
string themePath, string themeName = reaper.BR_GetCurrentTheme()
(String themePathOut, Int themePathOut_sz, String themeNameOut, Int themeNameOut_sz) = BR_GetCurrentTheme(themePathOut, themePathOut_sz, themeNameOut, themeNameOut_sz)

[BR] Get current theme information. themePathOut is set to full theme path and themeNameOut is set to theme name excluding any path info and extension

MediaItem* BR_GetMediaItemByGUID(ReaProject* proj, const char* guidStringIn)
MediaItem extension_api("BR_GetMediaItemByGUID", ReaProject proj, "guidStringIn")
MediaItem reaper.BR_GetMediaItemByGUID(ReaProject proj, string guidStringIn)
MediaItem BR_GetMediaItemByGUID(ReaProject proj, String guidStringIn)

[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.

void BR_GetMediaItemGUID(MediaItem* item, char* guidStringOut, int guidStringOut_sz)
extension_api("BR_GetMediaItemGUID", MediaItem item, #guidString)
string guidString = reaper.BR_GetMediaItemGUID(MediaItem item)
(MediaItem item, String guidStringOut, Int guidStringOut_sz) = BR_GetMediaItemGUID(item, guidStringOut, guidStringOut_sz)

[BR] Get media item GUID as a string (guidStringOut_sz should be at least 64). To get media item back from GUID string, see BR_GetMediaItemByGUID.

bool BR_GetMediaItemImageResource(MediaItem* item, char* imageOut, int imageOut_sz, int* imageFlagsOut)
bool extension_api("BR_GetMediaItemImageResource", MediaItem item, #image, int &imageFlags)
boolean retval, string image, number imageFlags = reaper.BR_GetMediaItemImageResource(MediaItem item)
(Boolean retval, MediaItem item, String imageOut, Int imageOut_sz, Int imageFlagsOut) = BR_GetMediaItemImageResource(item, imageOut, imageOut_sz, imageFlagsOut)

[BR] Get currently loaded image resource and it's flags for a given item. Returns false if there is no image resource set. To set image resource, see BR_SetMediaItemImageResource.

void BR_GetMediaItemTakeGUID(MediaItem_Take* take, char* guidStringOut, int guidStringOut_sz)
extension_api("BR_GetMediaItemTakeGUID", MediaItem_Take take, #guidString)
string guidString = reaper.BR_GetMediaItemTakeGUID(MediaItem_Take take)
(MediaItem_Take take, String guidStringOut, Int guidStringOut_sz) = BR_GetMediaItemTakeGUID(take, guidStringOut, guidStringOut_sz)

[BR] Get media item take GUID as a string (guidStringOut_sz should be at least 64). To get take from GUID string, see SNM_GetMediaItemTakeByGUID.

bool BR_GetMediaSourceProperties(MediaItem_Take* take, bool* sectionOut, double* startOut, double* lengthOut, double* fadeOut, bool* reverseOut)
bool extension_api("BR_GetMediaSourceProperties", MediaItem_Take take, bool &section, &start, &length, &fade, bool &reverse)
boolean retval, boolean section, number start, number length, number fade, boolean reverse = reaper.BR_GetMediaSourceProperties(MediaItem_Take take)
(Boolean retval, MediaItem_Take take, Boolean sectionOut, Float startOut, Float lengthOut, Float fadeOut, Boolean reverseOut) = BR_GetMediaSourceProperties(take, sectionOut, startOut, lengthOut, fadeOut, reverseOut)
[BR] Get take media source properties as they appear in Item properties. Returns false if take can't have them (MIDI items etc.).

To set source properties, see BR_SetMediaSourceProperties.

MediaTrack* BR_GetMediaTrackByGUID(ReaProject* proj, const char* guidStringIn)
MediaTrack extension_api("BR_GetMediaTrackByGUID", ReaProject proj, "guidStringIn")
MediaTrack reaper.BR_GetMediaTrackByGUID(ReaProject proj, string guidStringIn)
MediaTrack BR_GetMediaTrackByGUID(ReaProject proj, String guidStringIn)

[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 BR_GetMediaTrackGUID.

int BR_GetMediaTrackFreezeCount(MediaTrack* track)
int extension_api("BR_GetMediaTrackFreezeCount", MediaTrack track)
integer reaper.BR_GetMediaTrackFreezeCount(MediaTrack track)
Int BR_GetMediaTrackFreezeCount(MediaTrack track)

[BR] Get media track freeze count (if track isn't frozen at all, returns 0).

void BR_GetMediaTrackGUID(MediaTrack* track, char* guidStringOut, int guidStringOut_sz)
extension_api("BR_GetMediaTrackGUID", MediaTrack track, #guidString)
string guidString = reaper.BR_GetMediaTrackGUID(MediaTrack track)
(MediaTrack track, String guidStringOut, Int guidStringOut_sz) = BR_GetMediaTrackGUID(track, guidStringOut, guidStringOut_sz)

[BR] Get media track GUID as a string (guidStringOut_sz should be at least 64). To get media track back from GUID string, see BR_GetMediaTrackByGUID.

void BR_GetMediaTrackLayouts(MediaTrack* track, char* mcpLayoutNameOut, int mcpLayoutNameOut_sz, char* tcpLayoutNameOut, int tcpLayoutNameOut_sz)
extension_api("BR_GetMediaTrackLayouts", MediaTrack track, #mcpLayoutName, #tcpLayoutName)
string mcpLayoutName, string tcpLayoutName = reaper.BR_GetMediaTrackLayouts(MediaTrack track)
(MediaTrack track, String mcpLayoutNameOut, Int mcpLayoutNameOut_sz, String tcpLayoutNameOut, Int tcpLayoutNameOut_sz) = BR_GetMediaTrackLayouts(track, mcpLayoutNameOut, mcpLayoutNameOut_sz, tcpLayoutNameOut, tcpLayoutNameOut_sz)

[BR] Deprecated, see GetSetMediaTrackInfo (REAPER v5.02+). Get media track layouts for MCP and TCP. Empty string ("") means that layout is set to the default layout. To set media track layouts, see BR_SetMediaTrackLayouts.

TrackEnvelope* BR_GetMediaTrackSendInfo_Envelope(MediaTrack* track, int category, int sendidx, int envelopeType)
TrackEnvelope extension_api("BR_GetMediaTrackSendInfo_Envelope", MediaTrack track, int category, int sendidx, int envelopeType)
TrackEnvelope reaper.BR_GetMediaTrackSendInfo_Envelope(MediaTrack track, integer category, integer sendidx, integer envelopeType)
TrackEnvelope BR_GetMediaTrackSendInfo_Envelope(MediaTrack track, Int category, Int sendidx, Int envelopeType)
[BR] Get track envelope for send/receive/hardware output.

category is <0 for receives, 0=sends, >0 for hardware outputs
sendidx is zero-based (see GetTrackNumSends to count track sends/receives/hardware outputs)
envelopeType determines which envelope is returned (0=volume, 1=pan, 2=mute)

Note: To get or set other send attributes, see BR_GetSetTrackSendInfo and BR_GetMediaTrackSendInfo_Track.

MediaTrack* BR_GetMediaTrackSendInfo_Track(MediaTrack* track, int category, int sendidx, int trackType)
MediaTrack extension_api("BR_GetMediaTrackSendInfo_Track", MediaTrack track, int category, int sendidx, int trackType)
MediaTrack reaper.BR_GetMediaTrackSendInfo_Track(MediaTrack track, integer category, integer sendidx, integer trackType)
MediaTrack BR_GetMediaTrackSendInfo_Track(MediaTrack track, Int category, Int sendidx, Int trackType)
[BR] Get source or destination media track for send/receive.

category is <0 for receives, 0=sends
sendidx is zero-based (see GetTrackNumSends to count track sends/receives)
trackType determines which track is returned (0=source track, 1=destination track)

Note: To get or set other send attributes, see BR_GetSetTrackSendInfo and BR_GetMediaTrackSendInfo_Envelope.

double BR_GetMidiSourceLenPPQ(MediaItem_Take* take)
double extension_api("BR_GetMidiSourceLenPPQ", MediaItem_Take take)
number reaper.BR_GetMidiSourceLenPPQ(MediaItem_Take take)
Float BR_GetMidiSourceLenPPQ(MediaItem_Take take)

[BR] Get MIDI take source length in PPQ. In case the take isn't MIDI, return value will be -1.

bool BR_GetMidiTakePoolGUID(MediaItem_Take* take, char* guidStringOut, int guidStringOut_sz)
bool extension_api("BR_GetMidiTakePoolGUID", MediaItem_Take take, #guidString)
boolean retval, string guidString = reaper.BR_GetMidiTakePoolGUID(MediaItem_Take take)
(Boolean retval, MediaItem_Take take, String guidStringOut, Int guidStringOut_sz) = BR_GetMidiTakePoolGUID(take, guidStringOut, guidStringOut_sz)

[BR] Get MIDI take pool GUID as a string (guidStringOut_sz should be at least 64). Returns true if take is pooled.

bool BR_GetMidiTakeTempoInfo(MediaItem_Take* take, bool* ignoreProjTempoOut, double* bpmOut, int* numOut, int* denOut)
bool extension_api("BR_GetMidiTakeTempoInfo", MediaItem_Take take, bool &ignoreProjTempo, &bpm, int &num, int &den)
boolean retval, boolean ignoreProjTempo, number bpm, number num, number den = reaper.BR_GetMidiTakeTempoInfo(MediaItem_Take take)
(Boolean retval, MediaItem_Take take, Boolean ignoreProjTempoOut, Float bpmOut, Int numOut, Int denOut) = BR_GetMidiTakeTempoInfo(take, ignoreProjTempoOut, bpmOut, numOut, denOut)

[BR] Get "ignore project tempo" information for MIDI take. Returns true if take can ignore project tempo (no matter if it's actually ignored), otherwise false.

void BR_GetMouseCursorContext(char* windowOut, int windowOut_sz, char* segmentOut, int segmentOut_sz, char* detailsOut, int detailsOut_sz)
extension_api("BR_GetMouseCursorContext", #window, #segment, #details)
string window, string segment, string details = reaper.BR_GetMouseCursorContext()
(String windowOut, Int windowOut_sz, String segmentOut, Int segmentOut_sz, String detailsOut, Int detailsOut_sz) = BR_GetMouseCursorContext(windowOut, windowOut_sz, segmentOut, segmentOut_sz, detailsOut, detailsOut_sz)
[BR] Get mouse cursor context. Each parameter returns information in a form of string as specified in the table below.

To get more info on stuff that was found under mouse cursor see BR_GetMouseCursorContext_Envelope, BR_GetMouseCursorContext_Item, BR_GetMouseCursorContext_MIDI, BR_GetMouseCursorContext_Position, BR_GetMouseCursorContext_Take, BR_GetMouseCursorContext_Track

Window Segment Details
unknown "" ""
ruler region_lane ""
marker_lane ""
tempo_lane ""
timeline ""
transport "" ""
tcp track ""
envelope ""
empty ""
mcp track ""
empty ""
arrange track empty,
item, item_stretch_marker,
env_point, env_segment
envelope empty, env_point, env_segment
empty ""
midi_editor unknown ""
ruler ""
piano ""
notes ""
cc_lane cc_selector, cc_lane
TrackEnvelope* BR_GetMouseCursorContext_Envelope(bool* takeEnvelopeOut)
TrackEnvelope extension_api("BR_GetMouseCursorContext_Envelope", bool &takeEnvelope)
TrackEnvelope retval, boolean takeEnvelope = reaper.BR_GetMouseCursorContext_Envelope()
(TrackEnvelope retval, Boolean takeEnvelopeOut) = BR_GetMouseCursorContext_Envelope(takeEnvelopeOut)

[BR] Returns envelope that was captured with the last call to BR_GetMouseCursorContext. In case the envelope belongs to take, takeEnvelope will be true.

MediaItem* BR_GetMouseCursorContext_Item()
MediaItem extension_api("BR_GetMouseCursorContext_Item")
MediaItem reaper.BR_GetMouseCursorContext_Item()
MediaItem BR_GetMouseCursorContext_Item()

[BR] Returns item under mouse cursor that was captured with the last call to BR_GetMouseCursorContext. Note that the function will return item even if mouse cursor is over some other track lane element like stretch marker or envelope. This enables for easier identification of items when you want to ignore elements within the item.

void* BR_GetMouseCursorContext_MIDI(bool* inlineEditorOut, int* noteRowOut, int* ccLaneOut, int* ccLaneValOut, int* ccLaneIdOut)
void* extension_api("BR_GetMouseCursorContext_MIDI", bool &inlineEditor, int &noteRow, int &ccLane, int &ccLaneVal, int &ccLaneId)
identifier retval, boolean inlineEditor, number noteRow, number ccLane, number ccLaneVal, number ccLaneId = reaper.BR_GetMouseCursorContext_MIDI()
(void retval, Boolean inlineEditorOut, Int noteRowOut, Int ccLaneOut, Int ccLaneValOut, Int ccLaneIdOut) = BR_GetMouseCursorContext_MIDI(inlineEditorOut, noteRowOut, ccLaneOut, ccLaneValOut, ccLaneIdOut)
[BR] Returns midi editor under mouse cursor that was captured with the last call to BR_GetMouseCursorContext.

inlineEditor: if mouse was captured in inline MIDI editor, this will be true (consequentially, returned MIDI editor will be NULL)
noteRow: note row or piano key under mouse cursor (0-127)
ccLane: CC lane under mouse cursor (CC0-127=CC, 0x100|(0-31)=14-bit CC, 0x200=velocity, 0x201=pitch, 0x202=program, 0x203=channel pressure, 0x204=bank/program select, 0x205=text, 0x206=sysex, 0x207=off velocity)
ccLaneVal: value in CC lane under mouse cursor (0-127 or 0-16383)
ccLaneId: lane position, counting from the top (0 based)

Note: due to API limitations, if mouse is over inline MIDI editor with some note rows hidden, noteRow will be -1

double BR_GetMouseCursorContext_Position()
double extension_api("BR_GetMouseCursorContext_Position")
number reaper.BR_GetMouseCursorContext_Position()
Float BR_GetMouseCursorContext_Position()

[BR] Returns project time position in arrange/ruler/midi editor that was captured with the last call to BR_GetMouseCursorContext.

int BR_GetMouseCursorContext_StretchMarker()
int extension_api("BR_GetMouseCursorContext_StretchMarker")
integer reaper.BR_GetMouseCursorContext_StretchMarker()
Int BR_GetMouseCursorContext_StretchMarker()

[BR] Returns id of a stretch marker under mouse cursor that was captured with the last call to BR_GetMouseCursorContext.

MediaItem_Take* BR_GetMouseCursorContext_Take()
MediaItem_Take extension_api("BR_GetMouseCursorContext_Take")
MediaItem_Take reaper.BR_GetMouseCursorContext_Take()
MediaItem_Take BR_GetMouseCursorContext_Take()

[BR] Returns take under mouse cursor that was captured with the last call to BR_GetMouseCursorContext.

MediaTrack* BR_GetMouseCursorContext_Track()
MediaTrack extension_api("BR_GetMouseCursorContext_Track")
MediaTrack reaper.BR_GetMouseCursorContext_Track()
MediaTrack BR_GetMouseCursorContext_Track()

[BR] Returns track under mouse cursor that was captured with the last call to BR_GetMouseCursorContext.

double BR_GetNextGridDivision(double position)
double extension_api("BR_GetNextGridDivision", position)
number reaper.BR_GetNextGridDivision(number position)
Float BR_GetNextGridDivision(Float position)

[BR] Get next grid division after the time position. For more grid divisions function, see BR_GetClosestGridDivision and BR_GetPrevGridDivision.

double BR_GetPrevGridDivision(double position)
double extension_api("BR_GetPrevGridDivision", position)
number reaper.BR_GetPrevGridDivision(number position)
Float BR_GetPrevGridDivision(Float position)

[BR] Get previous grid division before the time position. For more grid division functions, see BR_GetClosestGridDivision and BR_GetNextGridDivision.

double BR_GetSetTrackSendInfo(MediaTrack* track, int category, int sendidx, const char* parmname, bool setNewValue, double newValue)
double extension_api("BR_GetSetTrackSendInfo", MediaTrack track, int category, int sendidx, "parmname", bool setNewValue, newValue)
number reaper.BR_GetSetTrackSendInfo(MediaTrack track, integer category, integer sendidx, string parmname, boolean setNewValue, number newValue)
Float BR_GetSetTrackSendInfo(MediaTrack track, Int category, Int sendidx, String parmname, Boolean setNewValue, Float newValue)
[BR] Get or set send attributes.

category is <0 for receives, 0=sends, >0 for hardware outputs
sendidx is zero-based (see GetTrackNumSends to count track sends/receives/hardware outputs)
To set attribute, pass setNewValue as true

List of possible parameters:
B_MUTE : send mute state (1.0 if muted, otherwise 0.0)
B_PHASE : send phase state (1.0 if phase is inverted, otherwise 0.0)
B_MONO : send mono state (1.0 if send is set to mono, otherwise 0.0)
D_VOL : send volume (1.0=+0dB etc...)
D_PAN : send pan (-1.0=100%L, 0=center, 1.0=100%R)
D_PANLAW : send pan law (1.0=+0.0db, 0.5=-6dB, -1.0=project default etc...)
I_SENDMODE : send mode (0=post-fader, 1=pre-fx, 2=post-fx(deprecated), 3=post-fx)
I_SRCCHAN : audio source starting channel index or -1 if audio send is disabled (&1024=mono...note that in that case, when reading index, you should do (index XOR 1024) to get starting channel index)
I_DSTCHAN : audio destination starting channel index (&1024=mono (and in case of hardware output &512=rearoute)...note that in that case, when reading index, you should do (index XOR (1024 OR 512)) to get starting channel index)
I_MIDI_SRCCHAN : source MIDI channel, -1 if MIDI send is disabled (0=all, 1-16)
I_MIDI_DSTCHAN : destination MIDI channel, -1 if MIDI send is disabled (0=original, 1-16)
I_MIDI_SRCBUS : source MIDI bus, -1 if MIDI send is disabled (0=all, otherwise bus index)
I_MIDI_DSTBUS : receive MIDI bus, -1 if MIDI send is disabled (0=all, otherwise bus index)
I_MIDI_LINK_VOLPAN : link volume/pan controls to MIDI

Note: To get or set other send attributes, see BR_GetMediaTrackSendInfo_Envelope and BR_GetMediaTrackSendInfo_Track.

int BR_GetTakeFXCount(MediaItem_Take* take)
int extension_api("BR_GetTakeFXCount", MediaItem_Take take)
integer reaper.BR_GetTakeFXCount(MediaItem_Take take)
Int BR_GetTakeFXCount(MediaItem_Take take)

[BR] Returns FX count for supplied take

bool BR_IsMidiOpenInInlineEditor(MediaItem_Take* take)
bool extension_api("BR_IsMidiOpenInInlineEditor", MediaItem_Take take)
boolean reaper.BR_IsMidiOpenInInlineEditor(MediaItem_Take take)
Boolean BR_IsMidiOpenInInlineEditor(MediaItem_Take take)

[SWS] Check if take has MIDI inline editor open and returns true or false.

bool BR_IsTakeMidi(MediaItem_Take* take, bool* inProjectMidiOut)
bool extension_api("BR_IsTakeMidi", MediaItem_Take take, bool &inProjectMidi)
boolean retval, boolean inProjectMidi = reaper.BR_IsTakeMidi(MediaItem_Take take)
(Boolean retval, MediaItem_Take take, Boolean inProjectMidiOut) = BR_IsTakeMidi(take, inProjectMidiOut)

[BR] Check if take is MIDI take, in case MIDI take is in-project MIDI source data, inProjectMidiOut will be true, otherwise false.

MediaItem* BR_ItemAtMouseCursor(double* positionOut)
MediaItem extension_api("BR_ItemAtMouseCursor", &position)
MediaItem retval, number position = reaper.BR_ItemAtMouseCursor()
(MediaItem retval, Float positionOut) = BR_ItemAtMouseCursor(positionOut)

[BR] Get media item under mouse cursor. Position is mouse cursor position in arrange.

bool BR_MIDI_CCLaneRemove(HWND midiEditor, int laneId)
bool extension_api("BR_MIDI_CCLaneRemove", HWND midiEditor, int laneId)
boolean reaper.BR_MIDI_CCLaneRemove(HWND midiEditor, integer laneId)
Boolean BR_MIDI_CCLaneRemove(HWND midiEditor, Int laneId)

[BR] Remove CC lane in midi editor. Returns true on success

bool BR_MIDI_CCLaneReplace(HWND midiEditor, int laneId, int newCC)
bool extension_api("BR_MIDI_CCLaneReplace", HWND midiEditor, int laneId, int newCC)
boolean reaper.BR_MIDI_CCLaneReplace(HWND midiEditor, integer laneId, integer newCC)
Boolean BR_MIDI_CCLaneReplace(HWND midiEditor, Int laneId, Int newCC)
[BR] Replace CC lane in midi editor. Returns true on success.

Valid CC lanes: CC0-127=CC, 0x100|(0-31)=14-bit CC, 0x200=velocity, 0x201=pitch, 0x202=program, 0x203=channel pressure, 0x204=bank/program select, 0x205=text, 0x206=sysex, 0x207

double BR_PositionAtMouseCursor(bool checkRuler)
double extension_api("BR_PositionAtMouseCursor", bool checkRuler)
number reaper.BR_PositionAtMouseCursor(boolean checkRuler)
Float BR_PositionAtMouseCursor(Boolean checkRuler)

[BR] Get position at mouse cursor. To check ruler along with arrange, pass checkRuler=true. Returns -1 if cursor is not over arrange/ruler.

void BR_SetArrangeView(ReaProject* proj, double startTime, double endTime)
extension_api("BR_SetArrangeView", ReaProject proj, startTime, endTime)
reaper.BR_SetArrangeView(ReaProject proj, number startTime, number endTime)
BR_SetArrangeView(ReaProject proj, Float startTime, Float endTime)

[BR] Deprecated, see GetSet_ArrangeView2 (REAPER v5.12pre4+) -- Set start and end time position of arrange view. To get arrange view instead, see BR_GetArrangeView.

bool BR_SetItemEdges(MediaItem* item, double startTime, double endTime)
bool extension_api("BR_SetItemEdges", MediaItem item, startTime, endTime)
boolean reaper.BR_SetItemEdges(MediaItem item, number startTime, number endTime)
Boolean BR_SetItemEdges(MediaItem item, Float startTime, Float endTime)

[BR] Set item start and end edges' position - returns true in case of any changes

void BR_SetMediaItemImageResource(MediaItem* item, const char* imageIn, int imageFlags)
extension_api("BR_SetMediaItemImageResource", MediaItem item, "imageIn", int imageFlags)
reaper.BR_SetMediaItemImageResource(MediaItem item, string imageIn, integer imageFlags)
BR_SetMediaItemImageResource(MediaItem item, String imageIn, Int imageFlags)

[BR] Set image resource and it's flags for a given item. To clear current image resource, pass imageIn as . To get image resource, see BR_GetMediaItemImageResource.

bool BR_SetMediaSourceProperties(MediaItem_Take* take, bool section, double start, double length, double fade, bool reverse)
bool extension_api("BR_SetMediaSourceProperties", MediaItem_Take take, bool section, start, length, fade, bool reverse)
boolean reaper.BR_SetMediaSourceProperties(MediaItem_Take take, boolean section, number start, number length, number fade, boolean reverse)
Boolean BR_SetMediaSourceProperties(MediaItem_Take take, Boolean section, Float start, Float length, Float fade, Boolean reverse)
[BR] Set take media source properties. Returns false if take can't have them (MIDI items etc.). Section parameters have to be valid only when passing section=true.

To get source properties, see BR_GetMediaSourceProperties.

bool BR_SetMediaTrackLayouts(MediaTrack* track, const char* mcpLayoutNameIn, const char* tcpLayoutNameIn)
bool extension_api("BR_SetMediaTrackLayouts", MediaTrack track, "mcpLayoutNameIn", "tcpLayoutNameIn")
boolean reaper.BR_SetMediaTrackLayouts(MediaTrack track, string mcpLayoutNameIn, string tcpLayoutNameIn)
Boolean BR_SetMediaTrackLayouts(MediaTrack track, String mcpLayoutNameIn, String tcpLayoutNameIn)
[BR] Deprecated, see GetSetMediaTrackInfo (REAPER v5.02+). Set media track layouts for MCP and TCP. To set default layout, pass empty string ("") as layout name. In case layouts were successfully set, returns true (if layouts are already set to supplied layout names, it will return false since no changes were made).

To get media track layouts, see BR_GetMediaTrackLayouts.

bool BR_SetMidiTakeTempoInfo(MediaItem_Take* take, bool ignoreProjTempo, double bpm, int num, int den)
bool extension_api("BR_SetMidiTakeTempoInfo", MediaItem_Take take, bool ignoreProjTempo, bpm, int num, int den)
boolean reaper.BR_SetMidiTakeTempoInfo(MediaItem_Take take, boolean ignoreProjTempo, number bpm, integer num, integer den)
Boolean BR_SetMidiTakeTempoInfo(MediaItem_Take take, Boolean ignoreProjTempo, Float bpm, Int num, Int den)

[BR] Set "ignore project tempo" information for MIDI take. Returns true in case the take was successfully updated.

bool BR_SetTakeSourceFromFile(MediaItem_Take* take, const char* filenameIn, bool inProjectData)
bool extension_api("BR_SetTakeSourceFromFile", MediaItem_Take take, "filenameIn", bool inProjectData)
boolean reaper.BR_SetTakeSourceFromFile(MediaItem_Take take, string filenameIn, boolean inProjectData)
Boolean BR_SetTakeSourceFromFile(MediaItem_Take take, String filenameIn, Boolean inProjectData)
[BR] Set new take source from file. To import MIDI file as in-project source data pass inProjectData=true. Returns false if failed.
Any take source properties from the previous source will be lost - to preserve them, see BR_SetTakeSourceFromFile2.

Note: To set source from existing take, see SNM_GetSetSourceState2.

bool BR_SetTakeSourceFromFile2(MediaItem_Take* take, const char* filenameIn, bool inProjectData, bool keepSourceProperties)
bool extension_api("BR_SetTakeSourceFromFile2", MediaItem_Take take, "filenameIn", bool inProjectData, bool keepSourceProperties)
boolean reaper.BR_SetTakeSourceFromFile2(MediaItem_Take take, string filenameIn, boolean inProjectData, boolean keepSourceProperties)
Boolean BR_SetTakeSourceFromFile2(MediaItem_Take take, String filenameIn, Boolean inProjectData, Boolean keepSourceProperties)

[BR] Differs from BR_SetTakeSourceFromFile only that it can also preserve existing take media source properties.

MediaItem_Take* BR_TakeAtMouseCursor(double* positionOut)
MediaItem_Take extension_api("BR_TakeAtMouseCursor", &position)
MediaItem_Take retval, number position = reaper.BR_TakeAtMouseCursor()
(MediaItem_Take retval, Float positionOut) = BR_TakeAtMouseCursor(positionOut)

[BR] Get take under mouse cursor. Position is mouse cursor position in arrange.

MediaTrack* BR_TrackAtMouseCursor(int* contextOut, double* positionOut)
MediaTrack extension_api("BR_TrackAtMouseCursor", int &context, &position)
MediaTrack retval, number context, number position = reaper.BR_TrackAtMouseCursor()
(MediaTrack retval, Int contextOut, Float positionOut) = BR_TrackAtMouseCursor(contextOut, positionOut)
[BR] Get track under mouse cursor.
Context signifies where the track was found: 0 = TCP, 1 = MCP, 2 = Arrange.

Position will hold mouse cursor position in arrange if applicable.

bool BR_TrackFX_GetFXModuleName(MediaTrack* track, int fx, char* nameOut, int nameOutSz)
bool extension_api("BR_TrackFX_GetFXModuleName", MediaTrack track, int fx, # name, int name)
boolean retval, string name = reaper.BR_TrackFX_GetFXModuleName(MediaTrack track, integer fx)
(Boolean retval, MediaTrack track, Int fx, String nameOut, Int nameOutSz) = BR_TrackFX_GetFXModuleName(track, fx, nameOut, nameOutSz)

[BR] Get the exact name (like effect.dll, effect.vst3, etc...) of an FX.

int BR_Win32_GetPrivateProfileString(const char* sectionName, const char* keyName, const char* defaultString, const char* filePath, char* stringOut, int stringOut_sz)
int extension_api("BR_Win32_GetPrivateProfileString", "sectionName", "keyName", "defaultString", "filePath", #string)
integer retval, string string = reaper.BR_Win32_GetPrivateProfileString(string sectionName, string keyName, string defaultString, string filePath)
(Int retval, String sectionName, String keyName, String defaultString, String filePath, String stringOut, Int stringOut_sz) = BR_Win32_GetPrivateProfileString(sectionName, keyName, defaultString, filePath, stringOut, stringOut_sz)

[BR] Equivalent to win32 API GetPrivateProfileString(). For example, you can use this to get values from REAPER.ini

int BR_Win32_ShellExecute(const char* operation, const char* file, const char* parameters, const char* directory, int showFlags)
int extension_api("BR_Win32_ShellExecute", "operation", "file", "parameters", "directory", int showFlags)
integer reaper.BR_Win32_ShellExecute(string operation, string file, string parameters, string directory, integer showFlags)
Int BR_Win32_ShellExecute(String operation, String file, String parameters, String directory, Int showFlags)

[BR] Equivalent to win32 API ShellExecute() with HWND set to main window

bool BR_Win32_WritePrivateProfileString(const char* sectionName, const char* keyName, const char* value, const char* filePath)
bool extension_api("BR_Win32_WritePrivateProfileString", "sectionName", "keyName", "value", "filePath")
boolean reaper.BR_Win32_WritePrivateProfileString(string sectionName, string keyName, string value, string filePath)
Boolean BR_Win32_WritePrivateProfileString(String sectionName, String keyName, String value, String filePath)

[BR] Equivalent to win32 API WritePrivateProfileString(). For example, you can use this to write to REAPER.ini

void CF_GetClipboard(char* buf, int buf_sz)
extension_api("CF_GetClipboard", #buf)
string buf = reaper.CF_GetClipboard(string buf)
(String buf, Int buf_sz) = CF_GetClipboard(buf, buf_sz)

Read the contents of the system clipboard (limited to 1023 characters in Lua).

const char* CF_GetClipboardBig(WDL_FastString* output)
bool extension_api("CF_GetClipboardBig", #retval, WDL_FastString output)
string reaper.CF_GetClipboardBig(WDL_FastString output)
String CF_GetClipboardBig(WDL_FastString output)

Read the contents of the system clipboard. See SNM_CreateFastString and SNM_DeleteFastString.

bool CF_LocateInExplorer(const char* file)
bool extension_api("CF_LocateInExplorer", "file")
boolean reaper.CF_LocateInExplorer(string file)
Boolean CF_LocateInExplorer(String file)

Select the given file in explorer/finder.

void CF_SetClipboard(const char* str)
extension_api("CF_SetClipboard", "str")
reaper.CF_SetClipboard(string str)
CF_SetClipboard(String str)

Write the given string into the system clipboard.

bool CF_ShellExecute(const char* file)
bool extension_api("CF_ShellExecute", "file")
boolean reaper.CF_ShellExecute(string file)
Boolean CF_ShellExecute(String file)

Open the given file or URL in the default application. See also CF_LocateInExplorer.

RprMidiNote* FNG_AddMidiNote(RprMidiTake* midiTake)
RprMidiNote extension_api("FNG_AddMidiNote", RprMidiTake midiTake)
RprMidiNote reaper.FNG_AddMidiNote(RprMidiTake midiTake)
RprMidiNote FNG_AddMidiNote(RprMidiTake midiTake)

[FNG] Add MIDI note to MIDI take

RprMidiTake* FNG_AllocMidiTake(MediaItem_Take* take)
RprMidiTake extension_api("FNG_AllocMidiTake", MediaItem_Take take)
RprMidiTake reaper.FNG_AllocMidiTake(MediaItem_Take take)
RprMidiTake FNG_AllocMidiTake(MediaItem_Take take)

[FNG] Allocate a RprMidiTake from a take pointer. Returns a NULL pointer if the take is not an in-project MIDI take

int FNG_CountMidiNotes(RprMidiTake* midiTake)
int extension_api("FNG_CountMidiNotes", RprMidiTake midiTake)
integer reaper.FNG_CountMidiNotes(RprMidiTake midiTake)
Int FNG_CountMidiNotes(RprMidiTake midiTake)

[FNG] Count of how many MIDI notes are in the MIDI take

void FNG_FreeMidiTake(RprMidiTake* midiTake)
extension_api("FNG_FreeMidiTake", RprMidiTake midiTake)
reaper.FNG_FreeMidiTake(RprMidiTake midiTake)
FNG_FreeMidiTake(RprMidiTake midiTake)

[FNG] Commit changes to MIDI take and free allocated memory

RprMidiNote* FNG_GetMidiNote(RprMidiTake* midiTake, int index)
RprMidiNote extension_api("FNG_GetMidiNote", RprMidiTake midiTake, int index)
RprMidiNote reaper.FNG_GetMidiNote(RprMidiTake midiTake, integer index)
RprMidiNote FNG_GetMidiNote(RprMidiTake midiTake, Int index)

[FNG] Get a MIDI note from a MIDI take at specified index

int FNG_GetMidiNoteIntProperty(RprMidiNote* midiNote, const char* property)
int extension_api("FNG_GetMidiNoteIntProperty", RprMidiNote midiNote, "property")
integer reaper.FNG_GetMidiNoteIntProperty(RprMidiNote midiNote, string property)
Int FNG_GetMidiNoteIntProperty(RprMidiNote midiNote, String property)

[FNG] Get MIDI note property

void FNG_SetMidiNoteIntProperty(RprMidiNote* midiNote, const char* property, int value)
extension_api("FNG_SetMidiNoteIntProperty", RprMidiNote midiNote, "property", int value)
reaper.FNG_SetMidiNoteIntProperty(RprMidiNote midiNote, string property, integer value)
FNG_SetMidiNoteIntProperty(RprMidiNote midiNote, String property, Int value)

[FNG] Set MIDI note property

void JS_Byte(void* address, int offset, int* byteOut)
extension_api("JS_Byte", void* address, int offset, int &byte)
number byte = reaper.JS_Byte(identifier address, integer offset)
(void address, Int offset, Int byteOut) = JS_Byte(address, offset, byteOut)

Returns the unsigned byte at address[offset]. Offset is added as steps of 1 byte each.

void JS_Double(void* address, int offset, double* doubleOut)
extension_api("JS_Double", void* address, int offset, &double)
number double = reaper.JS_Double(identifier address, integer offset)
(void address, Int offset, Float doubleOut) = JS_Double(address, offset, doubleOut)

Returns the 8-byte floating point value at address[offset]. Offset is added as steps of 8 bytes each.

void JS_GDI_Blit(void* destHDC, int dstx, int dsty, void* sourceHDC, int srcx, int srxy, int width, int height)
extension_api("JS_GDI_Blit", void* destHDC, int dstx, int dsty, void* sourceHDC, int srcx, int srxy, int width, int height)
reaper.JS_GDI_Blit(identifier destHDC, integer dstx, integer dsty, identifier sourceHDC, integer srcx, integer srxy, integer width, integer height)
JS_GDI_Blit(void destHDC, Int dstx, Int dsty, void sourceHDC, Int srcx, Int srxy, Int width, Int height)

Blits between two device contexts, which may include LICE "system bitmaps".

void* JS_GDI_CreateFillBrush(int color)
void* extension_api("JS_GDI_CreateFillBrush", int color)
identifier reaper.JS_GDI_CreateFillBrush(integer color)
void JS_GDI_CreateFillBrush(Int color)
void* JS_GDI_CreateFont(int height, int weight, int angle, bool italic, bool underline, bool strikeOut, const char* fontName)
void* extension_api("JS_GDI_CreateFont", int height, int weight, int angle, bool italic, bool underline, bool strike, "fontName")
identifier reaper.JS_GDI_CreateFont(integer height, integer weight, integer angle, boolean italic, boolean underline, boolean strike, string fontName)
void JS_GDI_CreateFont(Int height, Int weight, Int angle, Boolean italic, Boolean underline, Boolean strikeOut, String fontName)
Parameters:
* weight: 0 - 1000, with 0 = auto, 400 = normal and 700 = bold.
* angle: the angle, in tenths of degrees, between the text and the x-axis of the device.
* fontName: If empty string "", uses first font that matches the other specified attributes.

Note: Text color must be set separately.

void* JS_GDI_CreatePen(int width, int color)
void* extension_api("JS_GDI_CreatePen", int width, int color)
identifier reaper.JS_GDI_CreatePen(integer width, integer color)
void JS_GDI_CreatePen(Int width, Int color)
void JS_GDI_DeleteObject(void* GDIObject)
extension_api("JS_GDI_DeleteObject", void* GDIObject)
reaper.JS_GDI_DeleteObject(identifier GDIObject)
JS_GDI_DeleteObject(void GDIObject)
int JS_GDI_DrawText(void* deviceHDC, const char* text, int len, int left, int top, int right, int bottom, const char* align))
int extension_api("JS_GDI_DrawText", void* deviceHDC, "text", int len, int left, int top, int right, int bottom, "align)")
integer reaper.JS_GDI_DrawText(identifier deviceHDC, string text, integer len, integer left, integer top, integer right, integer bottom, string align))
Int JS_GDI_DrawText(void deviceHDC, String text, Int len, Int left, Int top, Int right, Int bottom, String align))
Parameters:

* align: Combination of: "TOP", "VCENTER", "LEFT", "HCENTER", "RIGHT", "BOTTOM", "WORDBREAK", "SINGLELINE", "NOCLIP", "CALCRECT", "NOPREFIX" or "ELLIPSIS"

void JS_GDI_FillEllipse(void* deviceHDC, int left, int top, int right, int bottom)
extension_api("JS_GDI_FillEllipse", void* deviceHDC, int left, int top, int right, int bottom)
reaper.JS_GDI_FillEllipse(identifier deviceHDC, integer left, integer top, integer right, integer bottom)
JS_GDI_FillEllipse(void deviceHDC, Int left, Int top, Int right, Int bottom)
void JS_GDI_FillPolygon(void* deviceHDC, const char* packedX, const char* packedY, int numPoints)
extension_api("JS_GDI_FillPolygon", void* deviceHDC, "packedX", "packedY", int numPoints)
reaper.JS_GDI_FillPolygon(identifier deviceHDC, string packedX, string packedY, integer numPoints)
JS_GDI_FillPolygon(void deviceHDC, String packedX, String packedY, Int numPoints)

packedX and packedY are strings of points, each packed as "<i4".

void JS_GDI_FillRect(void* deviceHDC, int left, int top, int right, int bottom)
extension_api("JS_GDI_FillRect", void* deviceHDC, int left, int top, int right, int bottom)
reaper.JS_GDI_FillRect(identifier deviceHDC, integer left, integer top, integer right, integer bottom)
JS_GDI_FillRect(void deviceHDC, Int left, Int top, Int right, Int bottom)
void JS_GDI_FillRoundRect(void* deviceHDC, int left, int top, int right, int bottom, int xrnd, int yrnd)
extension_api("JS_GDI_FillRoundRect", void* deviceHDC, int left, int top, int right, int bottom, int xrnd, int yrnd)
reaper.JS_GDI_FillRoundRect(identifier deviceHDC, integer left, integer top, integer right, integer bottom, integer xrnd, integer yrnd)
JS_GDI_FillRoundRect(void deviceHDC, Int left, Int top, Int right, Int bottom, Int xrnd, Int yrnd)
void* JS_GDI_GetClientDC(void* windowHWND)
void* extension_api("JS_GDI_GetClientDC", void* windowHWND)
identifier reaper.JS_GDI_GetClientDC(identifier windowHWND)
void JS_GDI_GetClientDC(void windowHWND)

Returns the device context for the client area of the specified window.

void* JS_GDI_GetScreenDC()
void* extension_api("JS_GDI_GetScreenDC")
identifier reaper.JS_GDI_GetScreenDC()
void JS_GDI_GetScreenDC()
Returns a device context for the entire screen.

WARNING: Only available on Windows, not Linux or MacOS.

int JS_GDI_GetSysColor(const char* GUIElement)
int extension_api("JS_GDI_GetSysColor", "GUIElement")
integer reaper.JS_GDI_GetSysColor(string GUIElement)
Int JS_GDI_GetSysColor(String GUIElement)
int JS_GDI_GetTextColor(void* deviceHDC)
int extension_api("JS_GDI_GetTextColor", void* deviceHDC)
integer reaper.JS_GDI_GetTextColor(identifier deviceHDC)
Int JS_GDI_GetTextColor(void deviceHDC)
void* JS_GDI_GetWindowDC(void* windowHWND)
void* extension_api("JS_GDI_GetWindowDC", void* windowHWND)
identifier reaper.JS_GDI_GetWindowDC(identifier windowHWND)
void JS_GDI_GetWindowDC(void windowHWND)

Returns the device context for the entire window, including title bar and frame.

void JS_GDI_Line(void* deviceHDC, int x1, int y1, int x2, int y2)
extension_api("JS_GDI_Line", void* deviceHDC, int x1, int y1, int x2, int y2)
reaper.JS_GDI_Line(identifier deviceHDC, integer x1, integer y1, integer x2, integer y2)
JS_GDI_Line(void deviceHDC, Int x1, Int y1, Int x2, Int y2)
void JS_GDI_Polyline(void* deviceHDC, const char* packedX, const char* packedY, int numPoints)
extension_api("JS_GDI_Polyline", void* deviceHDC, "packedX", "packedY", int numPoints)
reaper.JS_GDI_Polyline(identifier deviceHDC, string packedX, string packedY, integer numPoints)
JS_GDI_Polyline(void deviceHDC, String packedX, String packedY, Int numPoints)

packedX and packedY are strings of points, each packed as "<i4".

void JS_GDI_ReleaseDC(void* windowHWND, void* deviceHDC)
extension_api("JS_GDI_ReleaseDC", void* windowHWND, void* deviceHDC)
reaper.JS_GDI_ReleaseDC(identifier windowHWND, identifier deviceHDC)
JS_GDI_ReleaseDC(void windowHWND, void deviceHDC)
void* JS_GDI_SelectObject(void* deviceHDC, void* GDIObject)
void* extension_api("JS_GDI_SelectObject", void* deviceHDC, void* GDIObject)
identifier reaper.JS_GDI_SelectObject(identifier deviceHDC, identifier GDIObject)
void JS_GDI_SelectObject(void deviceHDC, void GDIObject)

Activates a font, pen, or fill brush for subsequent drawing in the specified device context.

void JS_GDI_SetPixel(void* deviceHDC, int x, int y, int color)
extension_api("JS_GDI_SetPixel", void* deviceHDC, int x, int y, int color)
reaper.JS_GDI_SetPixel(identifier deviceHDC, integer x, integer y, integer color)
JS_GDI_SetPixel(void deviceHDC, Int x, Int y, Int color)
void JS_GDI_SetTextBkColor(void* deviceHDC, int color)
extension_api("JS_GDI_SetTextBkColor", void* deviceHDC, int color)
reaper.JS_GDI_SetTextBkColor(identifier deviceHDC, integer color)
JS_GDI_SetTextBkColor(void deviceHDC, Int color)
void JS_GDI_SetTextBkMode(void* deviceHDC, int mode)
extension_api("JS_GDI_SetTextBkMode", void* deviceHDC, int mode)
reaper.JS_GDI_SetTextBkMode(identifier deviceHDC, integer mode)
JS_GDI_SetTextBkMode(void deviceHDC, Int mode)
void JS_GDI_SetTextColor(void* deviceHDC, int color)
extension_api("JS_GDI_SetTextColor", void* deviceHDC, int color)
reaper.JS_GDI_SetTextColor(identifier deviceHDC, integer color)
JS_GDI_SetTextColor(void deviceHDC, Int color)
void JS_GDI_StretchBlit(void* destHDC, int dstx, int dsty, int dstw, int dsth, void* sourceHDC, int srcx, int srxy, int srcw, int srch)
extension_api("JS_GDI_StretchBlit", void* destHDC, int dstx, int dsty, int dstw, int dsth, void* sourceHDC, int srcx, int srxy, int srcw, int srch)
reaper.JS_GDI_StretchBlit(identifier destHDC, integer dstx, integer dsty, integer dstw, integer dsth, identifier sourceHDC, integer srcx, integer srxy, integer srcw, integer srch)
JS_GDI_StretchBlit(void destHDC, Int dstx, Int dsty, Int dstw, Int dsth, void sourceHDC, Int srcx, Int srxy, Int srcw, Int srch)

Blits between two device contexts, which may include LICE "system bitmaps".

void JS_Int(void* address, int offset, int* intOut)
extension_api("JS_Int", void* address, int offset, int &int)
number int = reaper.JS_Int(identifier address, integer offset)
(void address, Int offset, Int intOut) = JS_Int(address, offset, intOut)

Returns the 4-byte signed integer at address[offset]. Offset is added as steps of 4 bytes each.

void JS_LICE_Arc(void* bitmap, double cx, double cy, double r, double minAngle, double maxAngle, int color, double alpha, const char* mode, bool antialias)
extension_api("JS_LICE_Arc", void* bitmap, cx, cy, r, minAngle, maxAngle, int color, alpha, "mode", bool antialias)
reaper.JS_LICE_Arc(identifier bitmap, number cx, number cy, number r, number minAngle, number maxAngle, integer color, number alpha, string mode, boolean antialias)
JS_LICE_Arc(void bitmap, Float cx, Float cy, Float r, Float minAngle, Float maxAngle, Int color, Float alpha, String mode, Boolean antialias)
LICE modes: "COPY" (default if empty string), "MASK", "ADD", "DODGE", "MUL", "OVERLAY" or "HSVADJ", any of which may be combined with "ALPHA".

LICE color format: 0xAARRGGBB (AA is only used in ALPHA mode).

void JS_LICE_Bezier(void* bitmap, double xstart, double ystart, double xctl1, double yctl1, double xctl2, double yctl2, double xend, double yend, double tol, int color, double alpha, const char* mode, bool antialias)
extension_api("JS_LICE_Bezier", void* bitmap, xstart, ystart, xctl1, yctl1, xctl2, yctl2, xend, yend, tol, int color, alpha, "mode", bool antialias)
reaper.JS_LICE_Bezier(identifier bitmap, number xstart, number ystart, number xctl1, number yctl1, number xctl2, number yctl2, number xend, number yend, number tol, integer color, number alpha, string mode, boolean antialias)
JS_LICE_Bezier(void bitmap, Float xstart, Float ystart, Float xctl1, Float yctl1, Float xctl2, Float yctl2, Float xend, Float yend, Float tol, Int color, Float alpha, String mode, Boolean antialias)
LICE modes: "COPY" (default if empty string), "MASK", "ADD", "DODGE", "MUL", "OVERLAY" or "HSVADJ", any of which may be combined with "ALPHA".

LICE color format: 0xAARRGGBB (AA is only used in ALPHA mode).

void JS_LICE_Blit(void* destBitmap, int dstx, int dsty, void* sourceBitmap, int srcx, int srcy, int width, int height, double alpha, const char* mode)
extension_api("JS_LICE_Blit", void* destBitmap, int dstx, int dsty, void* sourceBitmap, int srcx, int srcy, int width, int height, alpha, "mode")
reaper.JS_LICE_Blit(identifier destBitmap, integer dstx, integer dsty, identifier sourceBitmap, integer srcx, integer srcy, integer width, integer height, number alpha, string mode)
JS_LICE_Blit(void destBitmap, Int dstx, Int dsty, void sourceBitmap, Int srcx, Int srcy, Int width, Int height, Float alpha, String mode)

LICE modes: "COPY" (default if empty string), "MASK", "ADD", "DODGE", "MUL", "OVERLAY" or "HSVADJ", any of which may be combined with "ALPHA".

void JS_LICE_Circle(void* bitmap, double cx, double cy, double r, int color, double alpha, const char* mode, bool antialias)
extension_api("JS_LICE_Circle", void* bitmap, cx, cy, r, int color, alpha, "mode", bool antialias)
reaper.JS_LICE_Circle(identifier bitmap, number cx, number cy, number r, integer color, number alpha, string mode, boolean antialias)
JS_LICE_Circle(void bitmap, Float cx, Float cy, Float r, Int color, Float alpha, String mode, Boolean antialias)
LICE modes: "COPY" (default if empty string), "MASK", "ADD", "DODGE", "MUL", "OVERLAY" or "HSVADJ", any of which may be combined with "ALPHA".

LICE color format: 0xAARRGGBB (AA is only used in ALPHA mode).

void JS_LICE_Clear(void* bitmap, int color)
extension_api("JS_LICE_Clear", void* bitmap, int color)
reaper.JS_LICE_Clear(identifier bitmap, integer color)
JS_LICE_Clear(void bitmap, Int color)
void* JS_LICE_CreateBitmap(bool isSysBitmap, int width, int height)
void* extension_api("JS_LICE_CreateBitmap", bool isSysBitmap, int width, int height)
identifier reaper.JS_LICE_CreateBitmap(boolean isSysBitmap, integer width, integer height)
void JS_LICE_CreateBitmap(Boolean isSysBitmap, Int width, Int height)
void* JS_LICE_CreateFont()
void* extension_api("JS_LICE_CreateFont")
identifier reaper.JS_LICE_CreateFont()
void JS_LICE_CreateFont()
void JS_LICE_DestroyBitmap(void* bitmap)
extension_api("JS_LICE_DestroyBitmap", void* bitmap)
reaper.JS_LICE_DestroyBitmap(identifier bitmap)
JS_LICE_DestroyBitmap(void bitmap)
void JS_LICE_DestroyFont(void* LICEFont)
extension_api("JS_LICE_DestroyFont", void* LICEFont)
reaper.JS_LICE_DestroyFont(identifier LICEFont)
JS_LICE_DestroyFont(void LICEFont)
void JS_LICE_DrawChar(void* bitmap, int x, int y, char c, int color, double alpha, int mode))
extension_api("JS_LICE_DrawChar", void* bitmap, int x, int y, char c, int color, alpha, int mode))
reaper.JS_LICE_DrawChar(identifier bitmap, integer x, integer y, integer c, integer color, number alpha, integer mode))
JS_LICE_DrawChar(void bitmap, Int x, Int y, Int c, Int color, Float alpha, Int mode))
int JS_LICE_DrawText(void* bitmap, void* LICEFont, const char* text, int textLen, int x1, int y1, int x2, int y2)
int extension_api("JS_LICE_DrawText", void* bitmap, void* LICEFont, "text", int textLen, int x1, int y1, int x2, int y2)
integer reaper.JS_LICE_DrawText(identifier bitmap, identifier LICEFont, string text, integer textLen, integer x1, integer y1, integer x2, integer y2)
Int JS_LICE_DrawText(void bitmap, void LICEFont, String text, Int textLen, Int x1, Int y1, Int x2, Int y2)
void JS_LICE_FillCircle(void* bitmap, double cx, double cy, double r, int color, double alpha, const char* mode, bool antialias)
extension_api("JS_LICE_FillCircle", void* bitmap, cx, cy, r, int color, alpha, "mode", bool antialias)
reaper.JS_LICE_FillCircle(identifier bitmap, number cx, number cy, number r, integer color, number alpha, string mode, boolean antialias)
JS_LICE_FillCircle(void bitmap, Float cx, Float cy, Float r, Int color, Float alpha, String mode, Boolean antialias)
LICE modes: "COPY" (default if empty string), "MASK", "ADD", "DODGE", "MUL", "OVERLAY" or "HSVADJ", any of which may be combined with "ALPHA".

LICE color format: 0xAARRGGBB (AA is only used in ALPHA mode).

void JS_LICE_FillPolygon(void* bitmap, const char* packedX, const char* packedY, int numPoints, int color, double alpha, const char* mode)
extension_api("JS_LICE_FillPolygon", void* bitmap, "packedX", "packedY", int numPoints, int color, alpha, "mode")
reaper.JS_LICE_FillPolygon(identifier bitmap, string packedX, string packedY, integer numPoints, integer color, number alpha, string mode)
JS_LICE_FillPolygon(void bitmap, String packedX, String packedY, Int numPoints, Int color, Float alpha, String mode)
packedX and packedY are two strings of coordinates, each packed as "<i4".

LICE modes : "COPY" (default if empty string), "MASK", "ADD", "DODGE", "MUL", "OVERLAY" or "HSVADJ", any of which may be combined with "ALPHA".

LICE color format: 0xAARRGGBB (AA is only used in ALPHA mode).

void JS_LICE_FillRect(void* bitmap, int x, int y, int w, int h, int color, double alpha, const char* mode)
extension_api("JS_LICE_FillRect", void* bitmap, int x, int y, int w, int h, int color, alpha, "mode")
reaper.JS_LICE_FillRect(identifier bitmap, integer x, integer y, integer w, integer h, integer color, number alpha, string mode)
JS_LICE_FillRect(void bitmap, Int x, Int y, Int w, Int h, Int color, Float alpha, String mode)
LICE modes: "COPY" (default if empty string), "MASK", "ADD", "DODGE", "MUL", "OVERLAY" or "HSVADJ", any of which may be combined with "ALPHA".

LICE color format: 0xAARRGGBB (AA is only used in ALPHA mode).

void JS_LICE_FillTriangle(void* bitmap, int x1, int y1, int x2, int y2, int x3, int y3, int color, double alpha, const char* mode)
extension_api("JS_LICE_FillTriangle", void* bitmap, int x1, int y1, int x2, int y2, int x3, int y3, int color, alpha, "mode")
reaper.JS_LICE_FillTriangle(identifier bitmap, integer x1, integer y1, integer x2, integer y2, integer x3, integer y3, integer color, number alpha, string mode)
JS_LICE_FillTriangle(void bitmap, Int x1, Int y1, Int x2, Int y2, Int x3, Int y3, Int color, Float alpha, String mode)
LICE modes: "COPY" (default if empty string), "MASK", "ADD", "DODGE", "MUL", "OVERLAY" or "HSVADJ", any of which may be combined with "ALPHA".

LICE color format: 0xAARRGGBB (AA is only used in ALPHA mode).

void* JS_LICE_GetDC(void* bitmap)
void* extension_api("JS_LICE_GetDC", void* bitmap)
identifier reaper.JS_LICE_GetDC(identifier bitmap)
void JS_LICE_GetDC(void bitmap)
int JS_LICE_GetHeight(void* bitmap)
int extension_api("JS_LICE_GetHeight", void* bitmap)
integer reaper.JS_LICE_GetHeight(identifier bitmap)
Int JS_LICE_GetHeight(void bitmap)
int JS_LICE_GetPixel(void* bitmap, int x, int y)
int extension_api("JS_LICE_GetPixel", void* bitmap, int x, int y)
integer reaper.JS_LICE_GetPixel(identifier bitmap, integer x, integer y)
Int JS_LICE_GetPixel(void bitmap, Int x, Int y)

Returns the color of the specified pixel.

int JS_LICE_GetWidth(void* bitmap)
int extension_api("JS_LICE_GetWidth", void* bitmap)
integer reaper.JS_LICE_GetWidth(identifier bitmap)
Int JS_LICE_GetWidth(void bitmap)
void JS_LICE_GradRect(void* bitmap, int dstx, int dsty, int dstw, int dsth, double ir, double ig, double ib, double ia, double drdx, double dgdx, double dbdx, double dadx, double drdy, double dgdy, double dbdy, double dady, const char* mode)
extension_api("JS_LICE_GradRect", void* bitmap, int dstx, int dsty, int dstw, int dsth, ir, ig, ib, ia, drdx, dgdx, dbdx, dadx, drdy, dgdy, dbdy, dady, "mode")
reaper.JS_LICE_GradRect(identifier bitmap, integer dstx, integer dsty, integer dstw, integer dsth, number ir, number ig, number ib, number ia, number drdx, number dgdx, number dbdx, number dadx, number drdy, number dgdy, number dbdy, number dady, string mode)
JS_LICE_GradRect(void bitmap, Int dstx, Int dsty, Int dstw, Int dsth, Float ir, Float ig, Float ib, Float ia, Float drdx, Float dgdx, Float dbdx, Float dadx, Float drdy, Float dgdy, Float dbdy, Float dady, String mode)
bool JS_LICE_IsFlipped(void* bitmap)
bool extension_api("JS_LICE_IsFlipped", void* bitmap)
boolean reaper.JS_LICE_IsFlipped(identifier bitmap)
Boolean JS_LICE_IsFlipped(void bitmap)
void JS_LICE_Line(void* bitmap, double x1, double y1, double x2, double y2, int color, double alpha, const char* mode, bool antialias)
extension_api("JS_LICE_Line", void* bitmap, x1, y1, x2, y2, int color, alpha, "mode", bool antialias)
reaper.JS_LICE_Line(identifier bitmap, number x1, number y1, number x2, number y2, integer color, number alpha, string mode, boolean antialias)
JS_LICE_Line(void bitmap, Float x1, Float y1, Float x2, Float y2, Int color, Float alpha, String mode, Boolean antialias)
LICE modes: "COPY" (default if empty string), "MASK", "ADD", "DODGE", "MUL", "OVERLAY" or "HSVADJ", any of which may be combined with "ALPHA".

LICE color format: 0xAARRGGBB (AA is only used in ALPHA mode).

void* JS_LICE_LoadPNG(const char* filename)
void* extension_api("JS_LICE_LoadPNG", "filename")
identifier reaper.JS_LICE_LoadPNG(string filename)
void JS_LICE_LoadPNG(String filename)

Returns a (non-system) LICE bitmap containing the PNG.

void JS_LICE_PutPixel(void* bitmap, int x, int y, int color, double alpha, const char* mode)
extension_api("JS_LICE_PutPixel", void* bitmap, int x, int y, int color, alpha, "mode")
reaper.JS_LICE_PutPixel(identifier bitmap, integer x, integer y, integer color, number alpha, string mode)
JS_LICE_PutPixel(void bitmap, Int x, Int y, Int color, Float alpha, String mode)
LICE modes: "COPY" (default if empty string), "MASK", "ADD", "DODGE", "MUL", "OVERLAY" or "HSVADJ", any of which may be combined with "ALPHA".

LICE color format: 0xAARRGGBB (AA is only used in ALPHA mode).

void JS_LICE_Resize(void* bitmap, int width, int height)
extension_api("JS_LICE_Resize", void* bitmap, int width, int height)
reaper.JS_LICE_Resize(identifier bitmap, integer width, integer height)
JS_LICE_Resize(void bitmap, Int width, Int height)
void JS_LICE_RotatedBlit(void* destBitmap, int dstx, int dsty, int dstw, int dsth, void* sourceBitmap, double srcx, double srcy, double srcw, double srch, double angle, double rotxcent, double rotycent, bool cliptosourcerect, double alpha, const char* mode)
extension_api("JS_LICE_RotatedBlit", void* destBitmap, int dstx, int dsty, int dstw, int dsth, void* sourceBitmap, srcx, srcy, srcw, srch, angle, rotxcent, rotycent, bool cliptosourcerect, alpha, "mode")
reaper.JS_LICE_RotatedBlit(identifier destBitmap, integer dstx, integer dsty, integer dstw, integer dsth, identifier sourceBitmap, number srcx, number srcy, number srcw, number srch, number angle, number rotxcent, number rotycent, boolean cliptosourcerect, number alpha, string mode)
JS_LICE_RotatedBlit(void destBitmap, Int dstx, Int dsty, Int dstw, Int dsth, void sourceBitmap, Float srcx, Float srcy, Float srcw, Float srch, Float angle, Float rotxcent, Float rotycent, Boolean cliptosourcerect, Float alpha, String mode)

LICE modes: "COPY" (default if empty string), "MASK", "ADD", "DODGE", "MUL", "OVERLAY" or "HSVADJ", any of which may be combined with "ALPHA".

void JS_LICE_RoundRect(void* bitmap, double x, double y, double w, double h, int cornerradius, int color, double alpha, const char* mode, bool antialias)
extension_api("JS_LICE_RoundRect", void* bitmap, x, y, w, h, int cornerradius, int color, alpha, "mode", bool antialias)
reaper.JS_LICE_RoundRect(identifier bitmap, number x, number y, number w, number h, integer cornerradius, integer color, number alpha, string mode, boolean antialias)
JS_LICE_RoundRect(void bitmap, Float x, Float y, Float w, Float h, Int cornerradius, Int color, Float alpha, String mode, Boolean antialias)
LICE modes: "COPY" (default if empty string), "MASK", "ADD", "DODGE", "MUL", "OVERLAY" or "HSVADJ", any of which may be combined with "ALPHA".

LICE color format: 0xAARRGGBB (AA is only used in ALPHA mode).

void JS_LICE_ScaledBlit(void* destBitmap, int dstx, int dsty, int dstw, int dsth, void* srcBitmap, double srcx, double srcy, double srcw, double srch, double alpha, const char* mode)
extension_api("JS_LICE_ScaledBlit", void* destBitmap, int dstx, int dsty, int dstw, int dsth, void* srcBitmap, srcx, srcy, srcw, srch, alpha, "mode")
reaper.JS_LICE_ScaledBlit(identifier destBitmap, integer dstx, integer dsty, integer dstw, integer dsth, identifier srcBitmap, number srcx, number srcy, number srcw, number srch, number alpha, string mode)
JS_LICE_ScaledBlit(void destBitmap, Int dstx, Int dsty, Int dstw, Int dsth, void srcBitmap, Float srcx, Float srcy, Float srcw, Float srch, Float alpha, String mode)

LICE modes: "COPY" (default if empty string), "MASK", "ADD", "DODGE", "MUL", "OVERLAY" or "HSVADJ", any of which may be combined with "ALPHA".

void JS_LICE_SetFontBkColor(void* LICEFont, int color)
extension_api("JS_LICE_SetFontBkColor", void* LICEFont, int color)
reaper.JS_LICE_SetFontBkColor(identifier LICEFont, integer color)
JS_LICE_SetFontBkColor(void LICEFont, Int color)
void JS_LICE_SetFontColor(void* LICEFont, int color)
extension_api("JS_LICE_SetFontColor", void* LICEFont, int color)
reaper.JS_LICE_SetFontColor(identifier LICEFont, integer color)
JS_LICE_SetFontColor(void LICEFont, Int color)
void JS_LICE_SetFontFromGDI(void* LICEFont, void* GDIFont, const char* moreFormats)
extension_api("JS_LICE_SetFontFromGDI", void* LICEFont, void* GDIFont, "moreFormats")
reaper.JS_LICE_SetFontFromGDI(identifier LICEFont, identifier GDIFont, string moreFormats)
JS_LICE_SetFontFromGDI(void LICEFont, void GDIFont, String moreFormats)
Converts a GDI font into a LICE font.

The font can be modified by the following flags, in a comma-separated list:

"VERTICAL", "BOTTOMUP", "NATIVE", "BLUR", "INVERT", "MONO", "SHADOW" or "OUTLINE".

void JS_MIDIEditor_ArrayAll(void* reaperarray)
extension_api("JS_MIDIEditor_ArrayAll", void* reaperarray)
reaper.JS_MIDIEditor_ArrayAll(identifier reaperarray)
JS_MIDIEditor_ArrayAll(void reaperarray)
Returns the addresses of all open MIDI windows (whether docked or not).
* The addresses are stored in the provided reaper.array.

* Each address can be converted to a REAPER object (HWND) by the function JS_Window_HandleFromAddress.

void JS_MIDIEditor_ListAll(char* buf, int buf_sz)
extension_api("JS_MIDIEditor_ListAll", #buf)
string buf = reaper.JS_MIDIEditor_ListAll(string buf)
(String buf, Int buf_sz) = JS_MIDIEditor_ListAll(buf, buf_sz)
Returns a list of HWNDs of all open MIDI windows (whether docked or not).
* The list is formatted as a comma-separated (and terminated) string of hexadecimal values.

* Each value is an address that can be converted to a HWND by the function Window_HandleFromAddress.

int JS_Mouse_GetState(int flags)
int extension_api("JS_Mouse_GetState", int flags)
integer reaper.JS_Mouse_GetState(integer flags)
Int JS_Mouse_GetState(Int flags)
Retrieves the states of mouse buttons and modifiers keys.

Parameters:

* flags, state: The parameter and the return value both use the same format as gfx.mouse_cap. I.e., to get the states of the left mouse button and the ctrl key, use flags = 0b00000101.

void* JS_Mouse_LoadCursor(int cursorNumber)
void* extension_api("JS_Mouse_LoadCursor", int cursorNumber)
identifier reaper.JS_Mouse_LoadCursor(integer cursorNumber)
void JS_Mouse_LoadCursor(Int cursorNumber)
Loads a cursor by number.
cursorNumber: Same as used for gfx.setcursor, and includes some of Windows' predefined cursors (with numbers > 32000; refer to documentation for the Win32 C++ function LoadCursor), and REAPER's own cursors (with numbers < 2000).

If successful, returns a handle to the cursor, which can be used in JS_Mouse_SetCursor.

void* JS_Mouse_LoadCursorFromFile(const char* pathAndFileName)
void* extension_api("JS_Mouse_LoadCursorFromFile", "pathAndFileName")
identifier reaper.JS_Mouse_LoadCursorFromFile(string pathAndFileName)
void JS_Mouse_LoadCursorFromFile(String pathAndFileName)
Loads a cursor from a .cur file.

If successful, returns a handle to the cursor, which can be used in JS_Mouse_SetCursor.

void JS_Mouse_SetCursor(void* cursorHandle)
extension_api("JS_Mouse_SetCursor", void* cursorHandle)
reaper.JS_Mouse_SetCursor(identifier cursorHandle)
JS_Mouse_SetCursor(void cursorHandle)

Sets the mouse cursor. (Only lasts while script is running, and for a single "defer" cycle.)

bool JS_Mouse_SetPosition(int x, int y)
bool extension_api("JS_Mouse_SetPosition", int x, int y)
boolean reaper.JS_Mouse_SetPosition(integer x, integer y)
Boolean JS_Mouse_SetPosition(Int x, Int y)

Moves the mouse cursor to the specified coordinates.

void* JS_PtrFromStr(const char* s)
void* extension_api("JS_PtrFromStr", "s")
identifier reaper.JS_PtrFromStr(string s)
void JS_PtrFromStr(String s)
void JS_ReaScriptAPI_Version(double* versionOut)
extension_api("JS_ReaScriptAPI_Version", &version)
number version = reaper.JS_ReaScriptAPI_Version()
(Float versionOut) JS_ReaScriptAPI_Version(versionOut)

Returns the version of the js_ReaScriptAPI extension.

int JS_WindowMessage_Intercept(void* windowHWND, const char* messages, bool passThrough)
int extension_api("JS_WindowMessage_Intercept", void* windowHWND, "messages", bool passThrough)
integer reaper.JS_WindowMessage_Intercept(identifier windowHWND, string messages, boolean passThrough)
Int JS_WindowMessage_Intercept(void windowHWND, String messages, Boolean passThrough)
Intercepts window messages to specified window.

Parameters:
* message: a single message type to be intercepted, either in WM_ or hexadecimal format. For example "WM_SETCURSOR" or "0x0020".
* passThrough: Whether message should be blocked (false) or passed through (true) to the window.
For more information on message codes, refer to the Win32 C++ API documentation.
For a list of message types that are valid cross-platform, refer to swell-types.h. Only these will be recognized by WM_ name.

Returns:
* 1: Success.
* 0: The message type is already being intercepted by another script.
* -2: message string could not be parsed.
* -3: Failure getting original window process / window not valid.

Notes:
* Intercepted messages can be polled using JS_WindowMessage_Peek.
* Intercepted messages can be edited, if necessary, and then forwarded to their original destination using JS_WindowMessage_Post or JS_WindowMessage_Send.

* To check whether a message type is being blocked or passed through, Peek the message type, or retrieve the entire List of intercepts.

int JS_WindowMessage_InterceptList(void* windowHWND, const char* messages)
int extension_api("JS_WindowMessage_InterceptList", void* windowHWND, "messages")
integer reaper.JS_WindowMessage_InterceptList(identifier windowHWND, string messages)
Int JS_WindowMessage_InterceptList(void windowHWND, String messages)
Intercepts window messages to specified window.

Parameters:
* messages: comma-separated string of message types to be intercepted (either in WM_ or hexadecimal format), each with a "block" or "passthrough" modifier to specify whether the message should be blocked or passed through to the window. For example "WM_SETCURSOR:block, 0x0201:passthrough".
For more information on message codes, refer to the Win32 C++ API documentation.
For a list of message types that are valid cross-platform, refer to swell-types.h. Only these will be recognized by WM_ name.

Returns:
* 1: Success.
* 0: The message type is already being intercepted by another script.
* -1: windowHWND is not a valid window.
* -2: message string could not be parsed.
* -3: Failure getting original window process.

Notes:
* Intercepted messages can be polled using JS_WindowMessage_Peek.
* Intercepted messages can be edited, if necessary, and then forwarded to their original destination using JS_WindowMessage_Post or JS_WindowMessage_Send.

* To check whether a message type is being blocked or passed through, Peek the message type, or retrieve the entire List of intercepts.

bool JS_WindowMessage_ListIntercepts(void* windowHWND, char* buf, int buf_sz)
bool extension_api("JS_WindowMessage_ListIntercepts", void* windowHWND, #buf)
boolean retval, string buf = reaper.JS_WindowMessage_ListIntercepts(identifier windowHWND, string buf)
(Boolean retval, void windowHWND, String buf, Int buf_sz) = JS_WindowMessage_ListIntercepts(windowHWND, buf, buf_sz)

Returns a string with a list of all message types currently being intercepted for the specified window.

bool JS_WindowMessage_Peek(void* windowHWND, const char* message, bool* passedThroughOut, double* timeOut, int* wParamLowOut, int* wParamHighOut, int* lParamLowOut, int* lParamHighOut)
bool extension_api("JS_WindowMessage_Peek", void* windowHWND, "message", bool &passedThrough, &time, int &wParamLow, int &wParamHigh, int &lParamLow, int &lParamHigh)
boolean retval, boolean passedThrough, number time, number wParamLow, number wParamHigh, number lParamLow, number lParamHigh = reaper.JS_WindowMessage_Peek(identifier windowHWND, string message)
(Boolean retval, void windowHWND, String message, Boolean passedThroughOut, Float timeOut, Int wParamLowOut, Int wParamHighOut, Int lParamLowOut, Int lParamHighOut) = JS_WindowMessage_Peek(windowHWND, message, passedThroughOut, timeOut, wParamLowOut, wParamHighOut, lParamLowOut, lParamHighOut)
Polls the state of an intercepted message.

Parameters:
* message: String containing a single message name, such as "WM_SETCURSOR", or in hexadecimal format, "0x0020".
(For a list of message types that are valid cross-platform, refer to swell-types.h. Only these will be recognized by WM_ name.)

Returns:
* A retval of false indicates that the message type is not being intercepted in the specified window.
* All messages are timestamped. A time of 0 indicates that no message if this type has been intercepted yet.
* For more information about wParam and lParam for different message types, refer to Win32 C++ documentation.
* For example, in the case of mousewheel, returns mousewheel delta, modifier keys, x position and y position.

* wParamHigh, lParamLow and lParamHigh are signed, whereas wParamLow is unsigned.

bool JS_WindowMessage_Post(void* windowHWND, const char* message, int wParamLow, int wParamHigh, int lParamLow, int lParamHigh)
bool extension_api("JS_WindowMessage_Post", void* windowHWND, "message", int wParamLow, int wParamHigh, int lParamLow, int lParamHigh)
boolean reaper.JS_WindowMessage_Post(identifier windowHWND, string message, integer wParamLow, integer wParamHigh, integer lParamLow, integer lParamHigh)
Boolean JS_WindowMessage_Post(void windowHWND, String message, Int wParamLow, Int wParamHigh, Int lParamLow, Int lParamHigh)
Posts a message in the message queue associated with the thread that created the specified window, and returns without waiting.

Parameters:
* message: String containing a single message name, such as "WM_SETCURSOR", or in hexadecimal format, "0x0020".
(For a list of message types that are valid cross-platform, refer to swell-types.h. Only these will be recognized by WM_ name.)

Notes:
* For more information about parameter values, refer to documentation for the Win32 C++ function PostMessage.
* Messages should only be sent to windows that were created from the main thread.
* The message will be sent directly to the window, skipping interception by scripts.

* Useful for simulating mouse clicks and calling mouse modifier actions from scripts.

int JS_WindowMessage_Release(void* windowHWND, const char* messages)
int extension_api("JS_WindowMessage_Release", void* windowHWND, "messages")
integer reaper.JS_WindowMessage_Release(identifier windowHWND, string messages)
Int JS_WindowMessage_Release(void windowHWND, String messages)
Release intercepts of specified message types.

Parameters:

* messages: "WM_SETCURSOR,WM_MOUSEHWHEEL" or "0x0020,0x020E", for example.

void JS_WindowMessage_ReleaseAll()
extension_api("JS_WindowMessage_ReleaseAll")
reaper.JS_WindowMessage_ReleaseAll()
JS_WindowMessage_ReleaseAll()

Release script intercepts of window messages for all windows.

void JS_WindowMessage_ReleaseWindow(void* windowHWND)
extension_api("JS_WindowMessage_ReleaseWindow", void* windowHWND)
reaper.JS_WindowMessage_ReleaseWindow(identifier windowHWND)
JS_WindowMessage_ReleaseWindow(void windowHWND)

Release script intercepts of window messages for specified window.

int JS_WindowMessage_Send(void* windowHWND, const char* message, int wParamLow, int wParamHigh, int lParamLow, int lParamHigh)
int extension_api("JS_WindowMessage_Send", void* windowHWND, "message", int wParamLow, int wParamHigh, int lParamLow, int lParamHigh)
integer reaper.JS_WindowMessage_Send(identifier windowHWND, string message, integer wParamLow, integer wParamHigh, integer lParamLow, integer lParamHigh)
Int JS_WindowMessage_Send(void windowHWND, String message, Int wParamLow, Int wParamHigh, Int lParamLow, Int lParamHigh)
Posts a message in the message queue associated with the thread that created the specified window, and returns without waiting.

Parameters:
* message: String containing a single message name, such as "WM_SETCURSOR", or in hexadecimal format, "0x0020".
(For a list of message types that are valid cross-platform, refer to swell-types.h. Only these will be recognized by WM_ name.)

Returns:
* Unlike JS_WindowMessage_Post, Send returns an LRESULT.

Notes:
* For more information about parameter and return values, refer to documentation for the Win32 C++ function SendMessage.
* Messages should only be sent to windows that were created from the main thread.
* The message will be sent directly to the window, skipping interception by scripts.

* Useful for simulating mouse clicks and calling mouse modifier actions from scripts.

void JS_Window_AddressFromHandle(void* handle, double* addressOut)
extension_api("JS_Window_AddressFromHandle", void* handle, &address)
number address = reaper.JS_Window_AddressFromHandle(identifier handle)
(void handle, Float addressOut) = JS_Window_AddressFromHandle(handle, addressOut)
void JS_Window_ArrayAllChild(void* parentHWND, void* reaperarray)
extension_api("JS_Window_ArrayAllChild", void* parentHWND, void* reaperarray)
reaper.JS_Window_ArrayAllChild(identifier parentHWND, identifier reaperarray)
JS_Window_ArrayAllChild(void parentHWND, void reaperarray)
Returns all child windows of the specified parent.

The addresses are stored in the provided reaper.array, and can be converted to REAPER objects (HWNDs) by the function JS_Window_HandleFromAddress.

void JS_Window_ArrayAllTop(void* reaperarray)
extension_api("JS_Window_ArrayAllTop", void* reaperarray)
reaper.JS_Window_ArrayAllTop(identifier reaperarray)
JS_Window_ArrayAllTop(void reaperarray)
Returns all top-level windows.

The addresses are stored in the provided reaper.array, and can be converted to REAPER objects (HWNDs) by the function JS_Window_HandleFromAddress.

void JS_Window_ArrayFind(const char* title, bool exact, void* reaperarray)
extension_api("JS_Window_ArrayFind", "title", bool exact, void* reaperarray)
reaper.JS_Window_ArrayFind(string title, boolean exact, identifier reaperarray)
JS_Window_ArrayFind(String title, Boolean exact, void reaperarray)
Returns all windows, whether top-level or child, whose titles match the specified string.

The addresses are stored in the provided reaper.array, and can be converted to REAPER objects (HWNDs) by the function JS_Window_HandleFromAddress.

Parameters: * exact: Match entire title exactly, or match substring of title.

void JS_Window_AttachResizeGrip(void* windowHWND)
extension_api("JS_Window_AttachResizeGrip", void* windowHWND)
reaper.JS_Window_AttachResizeGrip(identifier windowHWND)
JS_Window_AttachResizeGrip(void windowHWND)
void JS_Window_AttachTopmostPin(void* windowHWND)
extension_api("JS_Window_AttachTopmostPin", void* windowHWND)
reaper.JS_Window_AttachTopmostPin(identifier windowHWND)
JS_Window_AttachTopmostPin(void windowHWND)
void JS_Window_ClientToScreen(void* windowHWND, int x, int y, int* xOut, int* yOut)
extension_api("JS_Window_ClientToScreen", void* windowHWND, int x, int y, int &x, int &y)
number x, number y = reaper.JS_Window_ClientToScreen(identifier windowHWND, integer x, integer y)
(void windowHWND, Int x, Int y, Int xOut, Int yOut) = JS_Window_ClientToScreen(windowHWND, x, y, xOut, yOut)

Converts the client-area coordinates of a specified point to screen coordinates.

void JS_Window_Destroy(void* windowHWND)
extension_api("JS_Window_Destroy", void* windowHWND)
reaper.JS_Window_Destroy(identifier windowHWND)
JS_Window_Destroy(void windowHWND)

Destroys the specified window.

void JS_Window_Enable(void* windowHWND, bool enable)
extension_api("JS_Window_Enable", void* windowHWND, bool enable)
reaper.JS_Window_Enable(identifier windowHWND, boolean enable)
JS_Window_Enable(void windowHWND, Boolean enable)

Enables or disables mouse and keyboard input to the specified window or control.

void* JS_Window_Find(const char* title, bool exact)
void* extension_api("JS_Window_Find", "title", bool exact)
identifier reaper.JS_Window_Find(string title, boolean exact)
void JS_Window_Find(String title, Boolean exact)
Returns a HWND to the top-level window whose title matches the specified string. This function does not search child window, and is not case sensitive.

Parameters:

* exact: Match entire title exactly, or match substring of title.

void* JS_Window_FindChild(void* parentHWND, const char* title, bool exact)
void* extension_api("JS_Window_FindChild", void* parentHWND, "title", bool exact)
identifier reaper.JS_Window_FindChild(identifier parentHWND, string title, boolean exact)
void JS_Window_FindChild(void parentHWND, String title, Boolean exact)
Returns a HWND to the child window whose title matches the specified string.

Parameters:

* exact: Match entire title exactly, or match substring of title.

void* JS_Window_FromPoint(int x, int y)
void* extension_api("JS_Window_FromPoint", int x, int y)
identifier reaper.JS_Window_FromPoint(integer x, integer y)
void JS_Window_FromPoint(Int x, Int y)

Retrieves a HWND to the window that contains the specified point.

bool JS_Window_GetClientRect(void* windowHWND, int* leftOut, int* topOut, int* rightOut, int* bottomOut)
bool extension_api("JS_Window_GetClientRect", void* windowHWND, int &left, int &top, int &right, int &bottom)
boolean retval, number left, number top, number right, number bottom = reaper.JS_Window_GetClientRect(identifier windowHWND)
(Boolean retval, void windowHWND, Int leftOut, Int topOut, Int rightOut, Int bottomOut) = JS_Window_GetClientRect(windowHWND, leftOut, topOut, rightOut, bottomOut)
Retrieves the coordinates of the client area rectangle of the specified window. The dimensions are given in screen coordinates relative to the upper-left corner of the screen.
NOTE 1: Unlike the C++ function GetClientRect, this function returns the actual coordinates, not the width and height.

NOTE 2: The pixel at (right, bottom) lies immediately outside the rectangle.

void* JS_Window_GetFocus()
void* extension_api("JS_Window_GetFocus")
identifier reaper.JS_Window_GetFocus()
void JS_Window_GetFocus()

Retrieves a HWND to the window that has the keyboard focus, if the window is attached to the calling thread's message queue.

void* JS_Window_GetForeground()
void* extension_api("JS_Window_GetForeground")
identifier reaper.JS_Window_GetForeground()
void JS_Window_GetForeground()

Retrieves a HWND to the foreground window (the window with which the user is currently working).

void* JS_Window_GetLongPtr(void* windowHWND, const char* info)
void* extension_api("JS_Window_GetLongPtr", void* windowHWND, "info")
identifier reaper.JS_Window_GetLongPtr(identifier windowHWND, string info)
void JS_Window_GetLongPtr(void windowHWND, String info)
Returns information about the specified window.

info: "USERDATA", "WNDPROC", "DLGPROC", "ID", "EXSTYLE" or "STYLE".

For documentation about the types of information returned, refer to the Win32 function GetWindowLongPtr.

void* JS_Window_GetParent(void* windowHWND)
void* extension_api("JS_Window_GetParent", void* windowHWND)
identifier reaper.JS_Window_GetParent(identifier windowHWND)
void JS_Window_GetParent(void windowHWND)
Retrieves a HWND to the specified window's parent or owner.

Returns NULL if the window is unowned or if the function otherwise fails.

bool JS_Window_GetRect(void* windowHWND, int* leftOut, int* topOut, int* rightOut, int* bottomOut)
bool extension_api("JS_Window_GetRect", void* windowHWND, int &left, int &top, int &right, int &bottom)
boolean retval, number left, number top, number right, number bottom = reaper.JS_Window_GetRect(identifier windowHWND)
(Boolean retval, void windowHWND, Int leftOut, Int topOut, Int rightOut, Int bottomOut) = JS_Window_GetRect(windowHWND, leftOut, topOut, rightOut, bottomOut)
Retrieves the coordinates of the bounding rectangle of the specified window. The dimensions are given in screen coordinates relative to the upper-left corner of the screen.

NOTE: The pixel at (right, bottom) lies immediately outside the rectangle.

void* JS_Window_GetRelated(void* windowHWND, int relation)
void* extension_api("JS_Window_GetRelated", void* windowHWND, int relation)
identifier reaper.JS_Window_GetRelated(identifier windowHWND, integer relation)
void JS_Window_GetRelated(void windowHWND, Int relation)
Retrieves a handle to a window that has the specified relationship (Z-Order or owner) to the specified window.
relation: "LAST", "NEXT", "PREV", "OWNER" or "CHILD".

(Refer to documentation for Win32 C++ function GetWindow.)

bool JS_Window_GetScrollInfo(void* windowHWND, const char* scrollbar, int* positionOut, int* pageSizeOut, int* minOut, int* maxOut, int* trackPosOut)
bool extension_api("JS_Window_GetScrollInfo", void* windowHWND, "scrollbar", int &position, int &pageSize, int &min, int &max, int &trackPos)
boolean retval, number position, number pageSize, number min, number max, number trackPos = reaper.JS_Window_GetScrollInfo(identifier windowHWND, string scrollbar)
(Boolean retval, void windowHWND, String scrollbar, Int positionOut, Int pageSizeOut, Int minOut, Int maxOut, Int trackPosOut) = JS_Window_GetScrollInfo(windowHWND, scrollbar, positionOut, pageSizeOut, minOut, maxOut, trackPosOut)
Retrieves the scroll information of a window.

Parameters:
* scrollbar: "v" (or "SB_VERT", or "VERT") for vertical scroll, "h" (or "SB_HORZ" or "HORZ") for horizontal.

Returns:

* Leftmost or topmost visible pixel position, as well as the visible page size, the range minimum and maximum, and scroll box tracking position.

void JS_Window_GetTitle(void* windowHWND, char* buf, int buf_sz)
extension_api("JS_Window_GetTitle", void* windowHWND, #buf)
string buf = reaper.JS_Window_GetTitle(identifier windowHWND, string buf)
(void windowHWND, String buf, Int buf_sz) = JS_Window_GetTitle(windowHWND, buf, buf_sz)

Returns the title (if any) of the specified window.

void* JS_Window_HandleFromAddress(double address)
void* extension_api("JS_Window_HandleFromAddress", address)
identifier reaper.JS_Window_HandleFromAddress(number address)
void JS_Window_HandleFromAddress(Float address)

Converts an address to a handle (such as a HWND) that can be utilized by REAPER and other API functions.

bool JS_Window_IsChild(void* parentHWND, void* childHWND)
bool extension_api("JS_Window_IsChild", void* parentHWND, void* childHWND)
boolean reaper.JS_Window_IsChild(identifier parentHWND, identifier childHWND)
Boolean JS_Window_IsChild(void parentHWND, void childHWND)

Determines whether a window is a child window or descendant window of a specified parent window.

bool JS_Window_IsVisible(void* windowHWND)
bool extension_api("JS_Window_IsVisible", void* windowHWND)
boolean reaper.JS_Window_IsVisible(identifier windowHWND)
Boolean JS_Window_IsVisible(void windowHWND)

Determines the visibility state of the window.

bool JS_Window_IsWindow(void* windowHWND)
bool extension_api("JS_Window_IsWindow", void* windowHWND)
boolean reaper.JS_Window_IsWindow(identifier windowHWND)
Boolean JS_Window_IsWindow(void windowHWND)

Determines whether the specified window handle identifies an existing window.

void JS_Window_ListAllChild(void* parentHWND, const char* section, const char* key)
extension_api("JS_Window_ListAllChild", void* parentHWND, "section", "key")
reaper.JS_Window_ListAllChild(identifier parentHWND, string section, string key)
JS_Window_ListAllChild(void parentHWND, String section, String key)
Returns a list of HWNDs of all child windows of the specified parent.
The list is formatted as a comma-separated (and terminated) string of hexadecimal values.
Each value is an address that can be converted to a HWND by the function Window_HandleFromAddress.

Parameters:

* section, key: Since the list string can sometimes be much longer than the maximum length of strings that can be returned by the Lua API, the list will instead by stored as a temporary ExtState specified by section and key.

void JS_Window_ListAllTop(const char* section, const char* key)
extension_api("JS_Window_ListAllTop", "section", "key")
reaper.JS_Window_ListAllTop(string section, string key)
JS_Window_ListAllTop(String section, String key)
Returns a list of HWNDs of all top-level windows.
The list is formatted as a comma-separated (and terminated) string of hexadecimal values.
Each value is an address that can be converted to a HWND by the function Window_HandleFromAddress.

Parameters:

* section, key: Since the list string can sometimes be much longer than the maximum length of strings that can be returned by the Lua API, the list will instead by stored as a temporary ExtState specified by section and key.

void JS_Window_ListFind(const char* title, bool exact, const char* section, const char* key)
extension_api("JS_Window_ListFind", "title", bool exact, "section", "key")
reaper.JS_Window_ListFind(string title, boolean exact, string section, string key)
JS_Window_ListFind(String title, Boolean exact, String section, String key)
Returns a list of HWNDs of all windows (whether top-level or child) whose titles match the specified string.
The list is formatted as a comma-separated (and terminated) string of hexadecimal values.
Each value is an address that can be converted to a HWND by the function Window_HandleFromAddress.

Parameters:
* section, key: Since the list string can sometimes be much longer than the maximum length of strings that can be returned by the Lua API, the list will instead by stored as a temporary ExtState specified by section and key.

* exact: Match entire title exactly, or match substring of title.

void JS_Window_Move(void* windowHWND, int left, int top)
extension_api("JS_Window_Move", void* windowHWND, int left, int top)
reaper.JS_Window_Move(identifier windowHWND, integer left, integer top)
JS_Window_Move(void windowHWND, Int left, Int top)
Changes the position of the specified window, keeping its size constant.
* For a top-level window, the position is relative to the upper-left corner of the screen.

* For a child window, they are relative to the upper-left corner of the parent window's client area.

bool JS_Window_RemoveXPStyle(void* windowHWND, bool remove)
bool extension_api("JS_Window_RemoveXPStyle", void* windowHWND, bool remove)
boolean reaper.JS_Window_RemoveXPStyle(identifier windowHWND, boolean remove)
Boolean JS_Window_RemoveXPStyle(void windowHWND, Boolean remove)
void JS_Window_Resize(void* windowHWND, int width, int height)
extension_api("JS_Window_Resize", void* windowHWND, int width, int height)
reaper.JS_Window_Resize(identifier windowHWND, integer width, integer height)
JS_Window_Resize(void windowHWND, Int width, Int height)
Changes the dimensions of the specified window, keeping the top left corner position constant.

* If resizing script GUIs, call gfx.update() after resizing.

void JS_Window_ScreenToClient(void* windowHWND, int x, int y, int* xOut, int* yOut)
extension_api("JS_Window_ScreenToClient", void* windowHWND, int x, int y, int &x, int &y)
number x, number y = reaper.JS_Window_ScreenToClient(identifier windowHWND, integer x, integer y)
(void windowHWND, Int x, Int y, Int xOut, Int yOut) = JS_Window_ScreenToClient(windowHWND, x, y, xOut, yOut)

Converts the screen coordinates of a specified point on the screen to client-area coordinates.

void JS_Window_SetFocus(void* windowHWND)
extension_api("JS_Window_SetFocus", void* windowHWND)
reaper.JS_Window_SetFocus(identifier windowHWND)
JS_Window_SetFocus(void windowHWND)

Sets the keyboard focus to the specified window.

void JS_Window_SetForeground(void* windowHWND)
extension_api("JS_Window_SetForeground", void* windowHWND)
reaper.JS_Window_SetForeground(identifier windowHWND)
JS_Window_SetForeground(void windowHWND)

Brings the specified window into the foreground, activates the window, and directs keyboard input to it.

void JS_Window_SetPosition(void* windowHWND, int left, int top, int width, int height)
extension_api("JS_Window_SetPosition", void* windowHWND, int left, int top, int width, int height)
reaper.JS_Window_SetPosition(identifier windowHWND, integer left, integer top, integer width, integer height)
JS_Window_SetPosition(void windowHWND, Int left, Int top, Int width, Int height)

Sets the window position and size.

bool JS_Window_SetScrollPos(void* windowHWND, const char* scrollbar, int position)
bool extension_api("JS_Window_SetScrollPos", void* windowHWND, "scrollbar", int position)
boolean reaper.JS_Window_SetScrollPos(identifier windowHWND, string scrollbar, integer position)
Boolean JS_Window_SetScrollPos(void windowHWND, String scrollbar, Int position)
Parameters:
* scrollbar: "v" (or "SB_VERT", or "VERT") for vertical scroll, "h" (or "SB_HORZ" or "HORZ") for horizontal.

NOTE: API functions can scroll REAPER's windows, but cannot zoom them. Instead, use actions such as "View: Zoom to one loop iteration".

bool JS_Window_SetTitle(void* windowHWND, const char* title)
bool extension_api("JS_Window_SetTitle", void* windowHWND, "title")
boolean reaper.JS_Window_SetTitle(identifier windowHWND, string title)
Boolean JS_Window_SetTitle(void windowHWND, String title)

Changes the title of the specified window. Returns true if successful.

void JS_Window_SetZOrder(void* windowHWND, const char* ZOrder, void* insertAfterHWND)
extension_api("JS_Window_SetZOrder", void* windowHWND, "ZOrder", void* insertAfterHWND)
reaper.JS_Window_SetZOrder(identifier windowHWND, string ZOrder, identifier insertAfterHWND)
JS_Window_SetZOrder(void windowHWND, String ZOrder, void insertAfterHWND)
Sets the window Z order.

Parameters:
* ZOrder: "INSERT_AFTER", "BOTTOM", "TOPMOST", "NOTOPMOST" or "TOP" ).

* InsertAfterHWND: If ZOrder is INSERT_AFTER, insertAfterHWND must be a handle to the window to precede windowHWND in the Z order; otherwise, insertAfterHWND is ignored.

void JS_Window_Show(void* windowHWND, const char* state)
extension_api("JS_Window_Show", void* windowHWND, "state")
reaper.JS_Window_Show(identifier windowHWND, string state)
JS_Window_Show(void windowHWND, String state)
Sets the specified window's show state.

Parameters:

* state: Either "SHOW", "SHOWNA", "SHOWMINIMIZED", or "HIDE".

bool NF_AnalyzeTakeLoudness(MediaItem_Take* take, bool analyzeTruePeak, double* lufsIntegratedOut, double* rangeOut, double* truePeakOut, double* truePeakPosOut, double* shortTermMaxOut, double* momentaryMaxOut)
bool extension_api("NF_AnalyzeTakeLoudness", MediaItem_Take take, bool analyzeTruePeak, &lufsIntegrated, &range, & truePeak, &truePeakPos, &shortTermMax, &momentaryMax)
boolean retval, number lufsIntegrated, number range, number truePeak, number truePeakPos, number shortTermMax, number momentaryMax = reaper.NF_AnalyzeTakeLoudness(MediaItem_Take take, boolean analyzeTruePeak)
(Boolean retval, MediaItem_Take take, Boolean analyzeTruePeak, Float lufsIntegratedOut, Float rangeOut, Float truePeakOut, Float truePeakPosOut, Float shortTermMaxOut, Float momentaryMaxOut) = NF_AnalyzeTakeLoudness(take, analyzeTruePeak, lufsIntegratedOut, rangeOut, truePeakOut, truePeakPosOut, shortTermMaxOut, momentaryMaxOut)

Full loudness analysis. retval: returns true on successful analysis, false on MIDI take or when analysis failed for some reason. analyzeTruePeak=true: Also do true peak analysis. Returns true peak value and true peak position which can be jumped to with SetEditCurPos(). Considerably slower than without true peak analysis (since it uses oversampling). Note: Short term uses a time window of 3 sec. for calculation. So for items shorter than this shortTermMaxOut can't be calculated. Momentary uses a time window of 0.4 sec.

bool NF_AnalyzeTakeLoudness2(MediaItem_Take* take, bool analyzeTruePeak, double* lufsIntegratedOut, double* rangeOut, double* truePeakOut, double* truePeakPosOut, double* shortTermMaxOut, double* momentaryMaxOut, double* shortTermMaxPosOut, double* momentaryMaxPosOut)
bool extension_api("NF_AnalyzeTakeLoudness2", MediaItem_Take take, bool analyzeTruePeak, &lufsIntegrated, &range, & truePeak, &truePeakPos, &shortTermMax, &momentaryMax, &shortTermMaxPos, &momentaryMaxPos)
boolean retval, number lufsIntegrated, number range, number truePeak, number truePeakPos, number shortTermMax, number momentaryMax, number shortTermMaxPos, number momentaryMaxPos = reaper.NF_AnalyzeTakeLoudness2(MediaItem_Take take, boolean analyzeTruePeak)
(Boolean retval, MediaItem_Take take, Boolean analyzeTruePeak, Float lufsIntegratedOut, Float rangeOut, Float truePeakOut, Float truePeakPosOut, Float shortTermMaxOut, Float momentaryMaxOut, Float shortTermMaxPosOut, Float momentaryMaxPosOut) = NF_AnalyzeTakeLoudness2(take, analyzeTruePeak, lufsIntegratedOut, rangeOut, truePeakOut, truePeakPosOut, shortTermMaxOut, momentaryMaxOut, shortTermMaxPosOut, momentaryMaxPosOut)

Same as NF_AnalyzeTakeLoudness but additionally returns shortTermMaxPos and momentaryMaxPos which can be jumped to with SetEditCurPos(). Note: shortTermMaxPos and momentaryMaxPos actaully indicate the beginning of time intervalls, (3 sec. and 0.4 sec. resp.).

bool NF_AnalyzeTakeLoudness_IntegratedOnly(MediaItem_Take* take, double* lufsIntegratedOut)
bool extension_api("NF_AnalyzeTakeLoudness_IntegratedOnly", MediaItem_Take take, &lufsIntegrated)
boolean retval, number lufsIntegrated = reaper.NF_AnalyzeTakeLoudness_IntegratedOnly(MediaItem_Take take)
(Boolean retval, MediaItem_Take take, Float lufsIntegratedOut) = NF_AnalyzeTakeLoudness_IntegratedOnly(take, lufsIntegratedOut)

Does LUFS integrated analysis only. Faster than full loudness analysis (NF_AnalyzeTakeLoudness) . Use this if only LUFS integrated is required.

double NF_GetMediaItemAverageRMS(MediaItem* item)
double extension_api("NF_GetMediaItemAverageRMS", MediaItem item)
number reaper.NF_GetMediaItemAverageRMS(MediaItem item)
Float NF_GetMediaItemAverageRMS(MediaItem item)
Returns the average overall (non-windowed) RMS level of active channels of an audio item active take, post item gain, post take volume envelope, post-fade, pre fader, pre item FX.

Returns -150.0 if MIDI take or empty item.

double NF_GetMediaItemMaxPeak(MediaItem* item)
double extension_api("NF_GetMediaItemMaxPeak", MediaItem item)
number reaper.NF_GetMediaItemMaxPeak(MediaItem item)
Float NF_GetMediaItemMaxPeak(MediaItem item)
Returns the greatest max. peak value of all active channels of an audio item active take, post item gain, post take volume envelope, post-fade, pre fader, pre item FX.

Returns -150.0 if MIDI take or empty item.

double NF_GetMediaItemPeakRMS_NonWindowed(MediaItem* item)
double extension_api("NF_GetMediaItemPeakRMS_NonWindowed", MediaItem item)
number reaper.NF_GetMediaItemPeakRMS_NonWindowed(MediaItem item)
Float NF_GetMediaItemPeakRMS_NonWindowed(MediaItem item)
Returns the greatest overall (non-windowed) RMS peak level of all active channels of an audio item active take, post item gain, post take volume envelope, post-fade, pre fader, pre item FX.

Returns -150.0 if MIDI take or empty item.

double NF_GetMediaItemPeakRMS_Windowed(MediaItem* item)
double extension_api("NF_GetMediaItemPeakRMS_Windowed", MediaItem item)
number reaper.NF_GetMediaItemPeakRMS_Windowed(MediaItem item)
Float NF_GetMediaItemPeakRMS_Windowed(MediaItem item)
Returns the average RMS peak level of all active channels of an audio item active take, post item gain, post take volume envelope, post-fade, pre fader, pre item FX.

Obeys 'Window size for peak RMS' setting in 'SWS: Set RMS analysis/normalize options' for calculation. Returns -150.0 if MIDI take or empty item.

const char* NF_GetSWSTrackNotes(MediaTrack* track, WDL_FastString* trackNote_output)
bool extension_api("NF_GetSWSTrackNotes", #retval, MediaTrack track, WDL_FastString trackNote_output)
string reaper.NF_GetSWSTrackNotes(MediaTrack trackWDL_FastString trackNote_output)
String NF_GetSWSTrackNotes(MediaTrack track, WDL_FastString trackNote_output)

See SNM_CreateFastString and SNM_DeleteFastString.

void NF_SetSWSTrackNotes(MediaTrack* track, const char* str)
extension_api("NF_SetSWSTrackNotes", MediaTrack track, "str")
reaper.NF_SetSWSTrackNotes(MediaTrack track, string str)
NF_SetSWSTrackNotes(MediaTrack track, String str)
bool NF_TakeFX_GetOffline(MediaItem_Take* take, int fx)
bool extension_api("NF_TakeFX_GetOffline", MediaItem_Take take, int fx)
boolean reaper.NF_TakeFX_GetOffline(MediaItem_Take take, integer fx)
Boolean NF_TakeFX_GetOffline(MediaItem_Take take, Int fx)

See NF_TakeFX_SetOffline.

void NF_TakeFX_SetOffline(MediaItem_Take* take, int fx, bool offline)
extension_api("NF_TakeFX_SetOffline", MediaItem_Take take, int fx, bool offline)
reaper.NF_TakeFX_SetOffline(MediaItem_Take take, integer fx, boolean offline)
NF_TakeFX_SetOffline(MediaItem_Take take, Int fx, Boolean offline)

Set offline state for take FX (zero-based). If FX are floating when offlining they'll float again when brought back online. Note: no-op if recording. (To set bypass state use native API TakeFX_SetEnabled).

bool NF_TrackFX_GetOffline(MediaTrack* track, int fx)
bool extension_api("NF_TrackFX_GetOffline", MediaTrack track, int fx)
boolean reaper.NF_TrackFX_GetOffline(MediaTrack track, integer fx)
Boolean NF_TrackFX_GetOffline(MediaTrack track, Int fx)

See NF_TrackFX_SetOffline.

void NF_TrackFX_SetOffline(MediaTrack* track, int fx, bool offline)
extension_api("NF_TrackFX_SetOffline", MediaTrack track, int fx, bool offline)
reaper.NF_TrackFX_SetOffline(MediaTrack track, integer fx, boolean offline)
NF_TrackFX_SetOffline(MediaTrack track, Int fx, Boolean offline)

Set offline state for track FX (zero-based). If FX are floating when offlining they'll float again when brought back online. Note: no-op if recording. (To set bypass state use native API TrackFX_SetEnabled).

bool ReaPack_AboutInstalledPackage(PackageEntry* entry)
bool extension_api("ReaPack_AboutInstalledPackage", PackageEntry entry)
boolean reaper.ReaPack_AboutInstalledPackage(PackageEntry entry)
Boolean ReaPack_AboutInstalledPackage(PackageEntry entry)
Show the about dialog of the given package entry.

The repository index is downloaded asynchronously if the cached copy doesn't exist or is older than one week.

bool ReaPack_AboutRepository(const char* repoName)
bool extension_api("ReaPack_AboutRepository", "repoName")
boolean reaper.ReaPack_AboutRepository(string repoName)
Boolean ReaPack_AboutRepository(String repoName)
Show the about dialog of the given repository. Returns true if the repository exists in the user configuration.

The repository index is downloaded asynchronously if the cached copy doesn't exist or is older than one week.

bool ReaPack_AddSetRepository(const char* name, const char* url, bool enable, int autoInstall, char* errorOut, int errorOut_sz)
bool extension_api("ReaPack_AddSetRepository", "name", "url", bool enable, int autoInstall, #error)
boolean retval, string error = reaper.ReaPack_AddSetRepository(string name, string url, boolean enable, integer autoInstall)
(Boolean retval, String name, String url, Boolean enable, Int autoInstall, String errorOut, Int errorOut_sz) = ReaPack_AddSetRepository(name, url, enable, autoInstall, errorOut, errorOut_sz)
Add or modify a repository. Set url to nullptr (or empty string in Lua) to keep the existing URL. Call ReaPack_ProcessQueue(true) when done to process the new list and update the GUI.

autoInstall: usually set to 2 (obey user setting).

void ReaPack_BrowsePackages(const char* filter)
extension_api("ReaPack_BrowsePackages", "filter")
reaper.ReaPack_BrowsePackages(string filter)
ReaPack_BrowsePackages(String filter)

Opens the package browser with the given filter string.

int ReaPack_CompareVersions(const char* ver1, const char* ver2, char* errorOut, int errorOut_sz)
int extension_api("ReaPack_CompareVersions", "ver1", "ver2", #error)
integer retval, string error = reaper.ReaPack_CompareVersions(string ver1, string ver2)
(Int retval, String ver1, String ver2, String errorOut, Int errorOut_sz) = ReaPack_CompareVersions(ver1, ver2, errorOut, errorOut_sz)

Returns 0 if both versions are equal, a positive value if ver1 is higher than ver2 and a negative value otherwise.

bool ReaPack_EnumOwnedFiles(PackageEntry* entry, int index, char* pathOut, int pathOut_sz, int* sectionsOut, int* typeOut)
bool extension_api("ReaPack_EnumOwnedFiles", PackageEntry entry, int index, #path, int &sections, int &type)
boolean retval, string path, number sections, number type = reaper.ReaPack_EnumOwnedFiles(PackageEntry entry, integer index)
(Boolean retval, PackageEntry entry, Int index, String pathOut, Int pathOut_sz, Int sectionsOut, Int typeOut) = ReaPack_EnumOwnedFiles(entry, index, pathOut, pathOut_sz, sectionsOut, typeOut)
Enumerate the files owned by the given package. Returns false when there is no more data.

sections: 0=not in action list, &1=main, &2=midi editor, &4=midi inline editor

type: see ReaPack_GetEntryInfo.

bool ReaPack_FreeEntry(PackageEntry* entry)
bool extension_api("ReaPack_FreeEntry", PackageEntry entry)
boolean reaper.ReaPack_FreeEntry(PackageEntry entry)
Boolean ReaPack_FreeEntry(PackageEntry entry)

Free resources allocated for the given package entry.

bool ReaPack_GetEntryInfo(PackageEntry* entry, char* repoOut, int repoOut_sz, char* catOut, int catOut_sz, char* pkgOut, int pkgOut_sz, char* descOut, int descOut_sz, int* typeOut, char* verOut, int verOut_sz, char* authorOut, int authorOut_sz, bool* pinnedOut, int* fileCountOut)
bool extension_api("ReaPack_GetEntryInfo", PackageEntry entry, #repo, #cat, #pkg, #desc, int &type, #ver, #author, bool &pinned, int &fileCount)
boolean retval, string repo, string cat, string pkg, string desc, number type, string ver, string author, boolean pinned, number fileCount = reaper.ReaPack_GetEntryInfo(PackageEntry entry)
(Boolean retval, PackageEntry entry, String repoOut, Int repoOut_sz, String catOut, Int catOut_sz, String pkgOut, Int pkgOut_sz, String descOut, Int descOut_sz, Int typeOut, String verOut, Int verOut_sz, String authorOut, Int authorOut_sz, Boolean pinnedOut, Int fileCountOut) = ReaPack_GetEntryInfo(entry, repoOut, repoOut_sz, catOut, catOut_sz, pkgOut, pkgOut_sz, descOut, descOut_sz, typeOut, verOut, verOut_sz, authorOut, authorOut_sz, pinnedOut, fileCountOut)
Get the repository name, category, package name, package description, package type, the currently installed version, author name, pinned status and how many files are owned by the given package entry.

type: 1=script, 2=extension, 3=effect, 4=data, 5=theme, 6=langpack, 7=webinterface

PackageEntry* ReaPack_GetOwner(const char* fn, char* errorOut, int errorOut_sz)
PackageEntry extension_api("ReaPack_GetOwner", "fn", #error)
PackageEntry retval, string error = reaper.ReaPack_GetOwner(string fn)
(PackageEntry retval, String fn, String errorOut, Int errorOut_sz) = ReaPack_GetOwner(fn, errorOut, errorOut_sz)
Returns the package entry owning the given file.

Delete the returned object from memory after use with ReaPack_FreeEntry.

bool ReaPack_GetRepositoryInfo(const char* name, char* urlOut, int urlOut_sz, bool* enabledOut, int* autoInstallOut)
bool extension_api("ReaPack_GetRepositoryInfo", "name", #url, bool &enabled, int &autoInstall)
boolean retval, string url, boolean enabled, number autoInstall = reaper.ReaPack_GetRepositoryInfo(string name)
(Boolean retval, String name, String urlOut, Int urlOut_sz, Boolean enabledOut, Int autoInstallOut) = ReaPack_GetRepositoryInfo(name, urlOut, urlOut_sz, enabledOut, autoInstallOut)
Get the infos of the given repository.

autoInstall: 0=manual, 1=when sychronizing, 2=obey user setting

void ReaPack_ProcessQueue(bool refreshUI)
extension_api("ReaPack_ProcessQueue", bool refreshUI)
reaper.ReaPack_ProcessQueue(boolean refreshUI)
ReaPack_ProcessQueue(Boolean refreshUI)

Run pending operations and save the configuration file. If refreshUI is true the browser and manager windows are guaranteed to be refreshed (otherwise it depends on which operations are in the queue).

bool SNM_AddReceive(MediaTrack* src, MediaTrack* dest, int type)
bool extension_api("SNM_AddReceive", MediaTrack src, MediaTrack dest, int type)
boolean reaper.SNM_AddReceive(MediaTrack src, MediaTrack dest, integer type)
Boolean SNM_AddReceive(MediaTrack src, MediaTrack dest, Int type)
[S&M] Deprecated, see CreateTrackSend (v5.15pre1+). Adds a receive. Returns false if nothing updated.
type -1=Default type (user preferences), 0=Post-Fader (Post-Pan), 1=Pre-FX, 2=deprecated, 3=Pre-Fader (Post-FX).

Note: obeys default sends preferences, supports frozen tracks, etc..

bool SNM_AddTCPFXParm(MediaTrack* tr, int fxId, int prmId)
bool extension_api("SNM_AddTCPFXParm", MediaTrack tr, int fxId, int prmId)
boolean reaper.SNM_AddTCPFXParm(MediaTrack tr, integer fxId, integer prmId)
Boolean SNM_AddTCPFXParm(MediaTrack tr, Int fxId, Int prmId)

[S&M] Add an FX parameter knob in the TCP. Returns false if nothing updated (invalid parameters, knob already present, etc..)

WDL_FastString* SNM_CreateFastString(const char* str)
WDL_FastString extension_api("SNM_CreateFastString", "str")
WDL_FastString reaper.SNM_CreateFastString(string str)
WDL_FastString SNM_CreateFastString(String str)

[S&M] Instantiates a new "fast string". You must delete this string, see SNM_DeleteFastString.

void SNM_DeleteFastString(WDL_FastString* str)
extension_api("SNM_DeleteFastString", WDL_FastString str)
reaper.SNM_DeleteFastString(WDL_FastString str)
SNM_DeleteFastString(WDL_FastString str)

[S&M] Deletes a "fast string" instance.

double SNM_GetDoubleConfigVar(const char* varname, double errvalue)
double extension_api("SNM_GetDoubleConfigVar", "varname", errvalue)
number reaper.SNM_GetDoubleConfigVar(string varname, number errvalue)
Float SNM_GetDoubleConfigVar(String varname, Float errvalue)

[S&M] Returns a double preference (look in project prefs first, then in general prefs). Returns errvalue if failed (e.g. varname not found).

const char* SNM_GetFastString(WDL_FastString* str)
bool extension_api("SNM_GetFastString", #retval, WDL_FastString str)
string reaper.SNM_GetFastString(WDL_FastString str)
String SNM_GetFastString(WDL_FastString str)

[S&M] Gets the "fast string" content.

int SNM_GetFastStringLength(WDL_FastString* str)
int extension_api("SNM_GetFastStringLength", WDL_FastString str)
integer reaper.SNM_GetFastStringLength(WDL_FastString str)
Int SNM_GetFastStringLength(WDL_FastString str)

[S&M] Gets the "fast string" length.

int SNM_GetIntConfigVar(const char* varname, int errvalue)
int extension_api("SNM_GetIntConfigVar", "varname", int errvalue)
integer reaper.SNM_GetIntConfigVar(string varname, integer errvalue)
Int SNM_GetIntConfigVar(String varname, Int errvalue)

[S&M] Returns an integer preference (look in project prefs first, then in general prefs). Returns errvalue if failed (e.g. varname not found).

MediaItem_Take* SNM_GetMediaItemTakeByGUID(ReaProject* project, const char* guid)
MediaItem_Take extension_api("SNM_GetMediaItemTakeByGUID", ReaProject project, "guid")
MediaItem_Take reaper.SNM_GetMediaItemTakeByGUID(ReaProject project, string guid)
MediaItem_Take SNM_GetMediaItemTakeByGUID(ReaProject project, String guid)

[S&M] Gets a take by GUID as string. The GUID must be enclosed in braces {}. To get take GUID as string, see BR_GetMediaItemTakeGUID

bool SNM_GetProjectMarkerName(ReaProject* proj, int num, bool isrgn, WDL_FastString* name)
bool extension_api("SNM_GetProjectMarkerName", ReaProject proj, int num, bool isrgn, WDL_FastString name)
boolean reaper.SNM_GetProjectMarkerName(ReaProject proj, integer num, boolean isrgnWDL_FastString name)
Boolean SNM_GetProjectMarkerName(ReaProject proj, Int num, Boolean isrgn, WDL_FastString name)

[S&M] Gets a marker/region name. Returns true if marker/region found.

bool SNM_GetSetObjectState(void* obj, WDL_FastString* state, bool setnewvalue, bool wantminimalstate)
bool extension_api("SNM_GetSetObjectState", void* obj, WDL_FastString state, bool setnewvalue, bool wantminimalstate)
boolean reaper.SNM_GetSetObjectState(identifier objWDL_FastString state, boolean setnewvalue, boolean wantminimalstate)
Boolean SNM_GetSetObjectState(void obj, WDL_FastString state, Boolean setnewvalue, Boolean wantminimalstate)
[S&M] Gets or sets the state of a track, an item or an envelope. The state chunk size is unlimited. Returns false if failed.
When getting a track state (and when you are not interested in FX data), you can use wantminimalstate=true to radically reduce the length of the state. Do not set such minimal states back though, this is for read-only applications!

Note: unlike the native GetSetObjectState, calling to FreeHeapPtr() is not required.

bool SNM_GetSetSourceState(MediaItem* item, int takeidx, WDL_FastString* state, bool setnewvalue)
bool extension_api("SNM_GetSetSourceState", MediaItem item, int takeidx, WDL_FastString state, bool setnewvalue)
boolean reaper.SNM_GetSetSourceState(MediaItem item, integer takeidxWDL_FastString state, boolean setnewvalue)
Boolean SNM_GetSetSourceState(MediaItem item, Int takeidx, WDL_FastString state, Boolean setnewvalue)
[S&M] Gets or sets a take source state. Returns false if failed. Use takeidx=-1 to get/alter the active take.

Note: this function does not use a MediaItem_Take* param in order to manage empty takes (i.e. takes with MediaItem_Take*==NULL), see SNM_GetSetSourceState2.

bool SNM_GetSetSourceState2(MediaItem_Take* take, WDL_FastString* state, bool setnewvalue)
bool extension_api("SNM_GetSetSourceState2", MediaItem_Take take, WDL_FastString state, bool setnewvalue)
boolean reaper.SNM_GetSetSourceState2(MediaItem_Take takeWDL_FastString state, boolean setnewvalue)
Boolean SNM_GetSetSourceState2(MediaItem_Take take, WDL_FastString state, Boolean setnewvalue)
[S&M] Gets or sets a take source state. Returns false if failed.

Note: this function cannot deal with empty takes, see SNM_GetSetSourceState.

bool SNM_GetSourceType(MediaItem_Take* take, WDL_FastString* type)
bool extension_api("SNM_GetSourceType", MediaItem_Take take, WDL_FastString type)
boolean reaper.SNM_GetSourceType(MediaItem_Take takeWDL_FastString type)
Boolean SNM_GetSourceType(MediaItem_Take take, WDL_FastString type)

[S&M] Gets the source type of a take. Returns false if failed (e.g. take with empty source, etc..)

bool SNM_MoveOrRemoveTrackFX(MediaTrack* tr, int fxId, int what)
bool extension_api("SNM_MoveOrRemoveTrackFX", MediaTrack tr, int fxId, int what)
boolean reaper.SNM_MoveOrRemoveTrackFX(MediaTrack tr, integer fxId, integer what)
Boolean SNM_MoveOrRemoveTrackFX(MediaTrack tr, Int fxId, Int what)
[S&M] Move or removes a track FX. Returns true if tr has been updated.

fxId: fx index in chain or -1 for the selected fx. what: 0 to remove, -1 to move fx up in chain, 1 to move fx down in chain.

bool SNM_ReadMediaFileTag(const char* fn, const char* tag, char* tagval, int tagval_sz)
bool extension_api("SNM_ReadMediaFileTag", "fn", "tag", #tagval)
boolean retval, string tagval = reaper.SNM_ReadMediaFileTag(string fn, string tag, string tagval)
(Boolean retval, String fn, String tag, String tagval, Int tagval_sz) = SNM_ReadMediaFileTag(fn, tag, tagval, tagval_sz)

[S&M] Reads a media file tag. Supported tags: "artist", "album", "genre", "comment", "title", or "year". Returns false if tag was not found. See SNM_TagMediaFile.

bool SNM_RemoveReceive(MediaTrack* tr, int rcvidx)
bool extension_api("SNM_RemoveReceive", MediaTrack tr, int rcvidx)
boolean reaper.SNM_RemoveReceive(MediaTrack tr, integer rcvidx)
Boolean SNM_RemoveReceive(MediaTrack tr, Int rcvidx)

[S&M] Deprecated, see RemoveTrackSend (v5.15pre1+). Removes a receive. Returns false if nothing updated.

bool SNM_RemoveReceivesFrom(MediaTrack* tr, MediaTrack* srctr)
bool extension_api("SNM_RemoveReceivesFrom", MediaTrack tr, MediaTrack srctr)
boolean reaper.SNM_RemoveReceivesFrom(MediaTrack tr, MediaTrack srctr)
Boolean SNM_RemoveReceivesFrom(MediaTrack tr, MediaTrack srctr)

[S&M] Removes all receives from srctr. Returns false if nothing updated.

int SNM_SelectResourceBookmark(const char* name)
int extension_api("SNM_SelectResourceBookmark", "name")
integer reaper.SNM_SelectResourceBookmark(string name)
Int SNM_SelectResourceBookmark(String name)

[S&M] Select a bookmark of the Resources window. Returns the related bookmark id (or -1 if failed).

bool SNM_SetDoubleConfigVar(const char* varname, double newvalue)
bool extension_api("SNM_SetDoubleConfigVar", "varname", newvalue)
boolean reaper.SNM_SetDoubleConfigVar(string varname, number newvalue)
Boolean SNM_SetDoubleConfigVar(String varname, Float newvalue)

[S&M] Sets a double preference (look in project prefs first, then in general prefs). Returns false if failed (e.g. varname not found).

WDL_FastString* SNM_SetFastString(WDL_FastString* str, const char* newstr)
WDL_FastString extension_api("SNM_SetFastString", WDL_FastString str, "newstr")
WDL_FastString reaper.SNM_SetFastString(WDL_FastString str, string newstr)
WDL_FastString SNM_SetFastString(WDL_FastString str, String newstr)

[S&M] Sets the "fast string" content. Returns str for facility.

bool SNM_SetIntConfigVar(const char* varname, int newvalue)
bool extension_api("SNM_SetIntConfigVar", "varname", int newvalue)
boolean reaper.SNM_SetIntConfigVar(string varname, integer newvalue)
Boolean SNM_SetIntConfigVar(String varname, Int newvalue)

[S&M] Sets an integer preference (look in project prefs first, then in general prefs). Returns false if failed (e.g. varname not found).

bool SNM_SetProjectMarker(ReaProject* proj, int num, bool isrgn, double pos, double rgnend, const char* name, int color)
bool extension_api("SNM_SetProjectMarker", ReaProject proj, int num, bool isrgn, pos, rgnend, "name", int color)
boolean reaper.SNM_SetProjectMarker(ReaProject proj, integer num, boolean isrgn, number pos, number rgnend, string name, integer color)
Boolean SNM_SetProjectMarker(ReaProject proj, Int num, Boolean isrgn, Float pos, Float rgnend, String name, Int color)

[S&M] Deprecated, see SetProjectMarker4 -- Same function as SetProjectMarker3() except it can set empty names "".

bool SNM_TagMediaFile(const char* fn, const char* tag, const char* tagval)
bool extension_api("SNM_TagMediaFile", "fn", "tag", "tagval")
boolean reaper.SNM_TagMediaFile(string fn, string tag, string tagval)
Boolean SNM_TagMediaFile(String fn, String tag, String tagval)

[S&M] Tags a media file thanks to TagLib. Supported tags: "artist", "album", "genre", "comment", "title", or "year". Use an empty tagval to clear a tag. When a file is opened in REAPER, turn it offline before using this function. Returns false if nothing updated. See SNM_ReadMediaFileTag.

void SNM_TieResourceSlotActions(int bookmarkId)
extension_api("SNM_TieResourceSlotActions", int bookmarkId)
reaper.SNM_TieResourceSlotActions(integer bookmarkId)
SNM_TieResourceSlotActions(Int bookmarkId)

[S&M] Attach Resources slot actions to a given bookmark.

void SN_FocusMIDIEditor()
extension_api("SN_FocusMIDIEditor")
reaper.SN_FocusMIDIEditor()
SN_FocusMIDIEditor()

Focuses the active/open MIDI editor.

const char* ULT_GetMediaItemNote(MediaItem* item)
bool extension_api("ULT_GetMediaItemNote", #retval, MediaItem item)
string reaper.ULT_GetMediaItemNote(MediaItem item)
String ULT_GetMediaItemNote(MediaItem item)

[ULT] Get item notes.

void ULT_SetMediaItemNote(MediaItem* item, const char* note)
extension_api("ULT_SetMediaItemNote", MediaItem item, "note")
reaper.ULT_SetMediaItemNote(MediaItem item, string note)
ULT_SetMediaItemNote(MediaItem item, String note)

[ULT] Set item notes.

ReaScript/EEL Built-in Function List

abs(value)

Returns the absolute value of the parameter.

acos(value)

Returns the arc cosine of the value specified (return value is in radians). If the parameter is not between -1.0 and 1.0 inclusive, the return value is undefined.

asin(value)

Returns the arc sine of the value specified (return value is in radians). If the parameter is not between -1.0 and 1.0 inclusive, the return value is undefined.

atan(value)

Returns the arc tangent of the value specified (return value is in radians). If the parameter is not between -1.0 and 1.0 inclusive, the return value is undefined.

atan2(numerator,denominator)

Returns the arc tangent of the numerator divided by the denominator, allowing the denominator to be 0, and using their signs to produce a more meaningful result.

atexit("code")

Adds code to be executed when the script finishes or is ended by the user. Typically used to clean up after the user terminates defer() or runloop() code.

ceil(value)

Returns the value rounded to the next highest integer (ceil(3.1)==4, ceil(-3.9)==-3).

convolve_c(dest,src,size)

Multiplies each of size complex pairs in dest by the complex pairs in src. Often used for convolution.

cos(angle)

Returns the cosine of the angle specified (specified in radians).

defer("code")

Adds code to be called back by REAPER. Used to create persistent ReaScripts that continue to run and respond to input, while the user does other tasks. Identical to runloop().
Note that no undo point will be automatically created when the script finishes, unless you create it explicitly.

eval("code")

Executes code passed in. Code can use functions, but functions created in code can't be used elsewhere.

exp(exponent)

Returns the number e ($e, approximately 2.718) raised to the parameter-th power. This function is significantly faster than pow() or the ^ operator.

extension_api("function_name"[,...])

Used to call functions exported by extension plugins. The first parameter must be the exported function name, then its own parameters (as if the function was called directly).

fclose(fp)

Closes a file previously opened with fopen().

feof(fp)

Returns nonzero if the file fp is at the end of file.

fflush(fp)

If file fp is open for writing, flushes out any buffered data to disk.

fft(buffer,size)

Performs a FFT on the data in the local memory buffer at the offset specified by the first parameter. The size of the FFT is specified by the second parameter, which must be 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, or 32768. The outputs are permuted, so if you plan to use them in-order, call fft_permute(buffer, size) before and fft_ipermute(buffer,size) after your in-order use. Your inputs or outputs will need to be scaled down by 1/size, if used.
Note that fft()/ifft() require real / imaginary input pairs, so a 256 point FFT actually works with 512 items.
Note that fft()/ifft() must NOT cross a 65,536 item boundary, so be sure to specify the offset accordingly.

fft_ipermute(buffer,size)

Permute the input for ifft(), taking bands from in-order to the order ifft() requires. See fft() for more information.

fft_permute(buffer,size)

Permute the output of fft() to have bands in-order. See fft() for more information.

fft_real(buffer,size)

Performs an FFT, but takes size input samples and produces size/2 complex output pairs. Usually used along with fft_permute(size/2). Inputs/outputs will need to be scaled by 0.5/size.

fgetc(fp)

Reads a character from file fp, returns -1 if EOF.

fgets(fp,#str)

Reads a line from file fp into #str. Returns length of #str read.

floor(value)

Returns the value rounded to the next lowest integer (floor(3.9)==3, floor(-3.1)==-4).

fopen("fn","mode")

Opens a file "fn" with mode "mode". For read, use "r" or "rb", write "w" or "wb". Returns a positive integer on success.

fprintf(fp,"format"[,...])

Formats a string and writes it to file fp. For more information on format specifiers, see sprintf(). Returns bytes written to file.

fread(fp,#str,length)

Reads from file fp into #str, up to length bytes. Returns actual length read, or negative if error.

freembuf(address)

Hints the runtime that memory above the address specified may no longer be used. The runtime may, at its leisure, choose to lose the contents of memory above the address specified.

fseek(fp,offset,whence)

Seeks file fp, offset bytes from whence reference. Whence negative specifies start of file, positive whence specifies end of file, and zero whence specifies current file position.

ftell(fp)

Retunrs the current file position.

fwrite(fp,#str,len)

Writes up to len characters of #str to file fp. If len is less than 1, the full contents of #str will be written. Returns the number of bytes written to file.

get_action_context(#filename,sectionID,cmdID,mode,resolution,val)

Queries contextual information about the script, typically MIDI/OSC input values.
Returns true if a new value has been updated.
val will be set to a relative or absolute value depending on mode (=0: absolute mode, >0: relative modes). resolution=127 for 7-bit resolution, =16383 for 14-bit resolution.
Notes: sectionID, and cmdID will be set to -1 if the script is not part of the action list. mode, resolution and val will be set to -1 if the script was not triggered via MIDI/OSC.

gfx VARIABLES

The following global variables are special and will be used by the graphics system:

  • gfx_r, gfx_g, gfx_b, gfx_a - These represent the current red, green, blue, and alpha components used by drawing operations (0.0..1.0).
  • gfx_w, gfx_h - These are set to the current width and height of the UI framebuffer.
  • gfx_x, gfx_y - These set the "current" graphics position in x,y. You can set these yourselves, and many of the drawing functions update them as well.
  • gfx_mode - Set to 0 for default options. Add 1.0 for additive blend mode (if you wish to do subtractive, set gfx_a to negative and use gfx_mode as additive). Add 2.0 to disable source alpha for gfx_blit(). Add 4.0 to disable filtering for gfx_blit().
  • gfx_clear - If set to a value greater than -1.0, this will result in the framebuffer being cleared to that color. the color for this one is packed RGB (0..255), i.e. red+green*256+blue*65536. The default is 0 (black).
  • gfx_dest - Defaults to -1, set to 0..1024-1 to have drawing operations go to an offscreen buffer (or loaded image).
  • gfx_texth - Set to the height of a line of text in the current font. Do not modify this variable.
  • gfx_ext_retina - If set to 1.0 on initialization, will be updated to 2.0 if high resolution display is supported, and if so gfx_w/gfx_h/etc will be doubled.
  • mouse_x, mouse_y - mouse_x and mouse_y are set to the coordinates of the mouse relative to the graphics window.
  • mouse_wheel, mouse_hwheel - mouse wheel (and horizontal wheel) positions. These will change typically by 120 or a multiple thereof, the caller should clear the state to 0 after reading it.
  • mouse_cap is a bitfield of mouse and keyboard modifier state.
    • 1: left mouse button
    • 2: right mouse button
    • 4: Control key
    • 8: Shift key
    • 16: Alt key
    • 32: Windows key
    • 64: middle mouse button

gfx_arc(x,y,r,ang1,ang2[,antialias])

Draws an arc of the circle centered at x,y, with ang1/ang2 being specified in radians.

gfx_blit(source, scale, rotation[, srcx, srcy, srcw, srch, destx, desty, destw, desth, rotxoffs, rotyoffs])

srcx/srcy/srcw/srch specify the source rectangle (if omitted srcw/srch default to image size), destx/desty/destw/desth specify dest rectangle (if not specified, these will default to reasonable defaults -- destw/desth default to srcw/srch * scale).

gfx_blit(source,scale,rotation)

If three parameters are specified, copies the entirity of the source bitmap to gfx_x,gfx_y using current opacity and copy mode (set with gfx_a, gfx_mode). You can specify scale (1.0 is unscaled) and rotation (0.0 is not rotated, angles are in radians).
For the "source" parameter specify -1 to use the main framebuffer as source, or an image index (see gfx_loadimg()).

gfx_blitext(source,coordinatelist,rotation)

Deprecated, use gfx_blit instead.

gfx_blurto(x,y)

Blurs the region of the screen between gfx_x,gfx_y and x,y, and updates gfx_x,gfx_y to x,y.

gfx_circle(x,y,r[,fill,antialias])

Draws a circle, optionally filling/antialiasing.

gfx_clienttoscreen(x,y)

Converts client coordinates x,y to screen coordinates.

gfx_deltablit(srcimg,srcs,srct,srcw,srch,destx,desty,destw,desth,dsdx,dtdx,dsdy,dtdy,dsdxdy,dtdxdy[,usecliprect=1])

Blits from srcimg(srcx,srcy,srcw,srch) to destination (destx,desty,destw,desth). Source texture coordinates are s/t, dsdx represents the change in s coordinate for each x pixel, dtdy represents the change in t coordinate for each y pixel, etc. dsdxdy represents the change in dsdx for each line. If usecliprect is specified and 0, then srcw/srch are ignored.

gfx_dock(v[,wx,wy,ww,wh])

Call with v=-1 to query docked state, otherwise v>=0 to set docked state. State is &1 if docked, second byte is docker index (or last docker index if undocked). If wx-wh are specified, they will be filled with the undocked window position/size

gfx_drawchar(char)

Draws the character (can be a numeric ASCII code as well), to gfx_x, gfx_y, and moves gfx_x over by the size of the character.

gfx_drawnumber(n,ndigits)

Draws the number n with ndigits of precision to gfx_x, gfx_y, and updates gfx_x to the right side of the drawing. The text height is gfx_texth.

gfx_drawstr("str"[,flags,right,bottom])

Draws a string at gfx_x, gfx_y, and updates gfx_x/gfx_y so that subsequent draws will occur in a similar place.

If flags, right ,bottom passed in:

  • flags&1: center horizontally
  • flags&2: right justify
  • flags&4: center vertically
  • flags&8: bottom justify
  • flags&256: ignore right/bottom, otherwise text is clipped to (gfx_x, gfx_y, right, bottom)

  • gfx_getchar([char])

    If char is 0 or omitted, returns a character from the keyboard queue, or 0 if no character is available, or -1 if the graphics window is not open. If char is specified and nonzero, that character's status will be checked, and the function will return greater than 0 if it is pressed.

    Common values are standard ASCII, such as 'a', 'A', '=' and '1', but for many keys multi-byte values are used, including 'home', 'up', 'down', 'left', 'rght', 'f1'.. 'f12', 'pgup', 'pgdn', 'ins', and 'del'.

    Modified and special keys can also be returned, including:


    • Ctrl/Cmd+A..Ctrl+Z as 1..26
    • Ctrl/Cmd+Alt+A..Z as 257..282
    • Alt+A..Z as 'A'+256..'Z'+256
    • 27 for ESC
    • 13 for Enter
    • ' ' for space
    • 65536 for query of special flags, returns: &1 (supported), &2=window has focus, &4=window is visible

    gfx_getdropfile(idx[,#str])

    Enumerates any drag/dropped files. call gfx_dropfile(-1) to clear the list when finished. Returns 1 if idx is valid, 0 if idx is out of range.

    gfx_getfont([#str])

    Returns current font index. If a string is passed, it will receive the actual font face used by this font, if available.

    gfx_getimgdim(image,w,h)

    Retreives the dimensions of image (representing a filename: index number) into w and h. Sets these values to 0 if an image failed loading (or if the filename index is invalid).

    gfx_getpixel(r,g,b)

    Gets the value of the pixel at gfx_x,gfx_y into r,g,b.

    gfx_gradrect(x,y,w,h, r,g,b,a[, drdx, dgdx, dbdx, dadx, drdy, dgdy, dbdy, dady])

    Fills a gradient rectangle with the color and alpha specified. drdx-dadx reflect the adjustment (per-pixel) applied for each pixel moved to the right, drdy-dady are the adjustment applied for each pixel moved toward the bottom. Normally drdx=adjustamount/w, drdy=adjustamount/h, etc.

    gfx_init("name"[,width,height,dockstate,xpos,ypos])

    Initializes the graphics window with title name. Suggested width and height can be specified.

    Once the graphics window is open, gfx_update() should be called periodically.

    gfx_line(x,y,x2,y2[,aa])

    Draws a line from x,y to x2,y2, and if aa is not specified or 0.5 or greater, it will be antialiased.

    gfx_lineto(x,y[,aa])

    Draws a line from gfx_x,gfx_y to x,y. If aa is 0.5 or greater, then antialiasing is used. Updates gfx_x and gfx_y to x,y.

    gfx_loadimg(image,"filename")

    Load image from filename into slot 0..1024-1 specified by image. Returns the image index if success, otherwise -1 if failure. The image will be resized to the dimensions of the image file.

    gfx_measurechar(character,&w,&h)

    Measures the drawing dimensions of a character with the current font (as set by gfx_setfont).

    gfx_measurestr("str",&w,&h)

    Measures the drawing dimensions of a string with the current font (as set by gfx_setfont).

    gfx_muladdrect(x,y,w,h,mul_r,mul_g,mul_b[,mul_a,add_r,add_g,add_b,add_a])

    Multiplies each pixel by mul_* and adds add_*, and updates in-place. Useful for changing brightness/contrast, or other effects.

    gfx_printf("format"[, ...])

    Formats and draws a string at gfx_x, gfx_y, and updates gfx_x/gfx_y accordingly (the latter only if the formatted string contains newline). For more information on format strings, see sprintf()

    gfx_quit()

    Closes the graphics window.

    gfx_rect(x,y,w,h[,filled])

    Fills a rectangle at x,y, w,h pixels in dimension, filled by default.

    gfx_rectto(x,y)

    Fills a rectangle from gfx_x,gfx_y to x,y. Updates gfx_x,gfx_y to x,y.

    gfx_roundrect(x,y,w,h,radius[,antialias])

    Draws a rectangle with rounded corners.

    gfx_screentoclient(x,y)

    Converts screen coordinates x,y to client coordinates.

    gfx_set(r[,g,b,a,mode,dest])

    Sets gfx_r/gfx_g/gfx_b/gfx_a/gfx_mode, sets gfx_dest if final parameter specified

    gfx_setcursor(resource_id,custom_cursor_name)

    Sets the mouse cursor. resource_id is a value like 32512 (for an arrow cursor), custom_cursor_name is a string like "arrow" (for the REAPER custom arrow cursor). resource_id must be nonzero, but custom_cursor_name is optional.

    gfx_setfont(idx[,"fontface", sz, flags])

    Can select a font and optionally configure it. idx=0 for default bitmapped font, no configuration is possible for this font. idx=1..16 for a configurable font, specify fontface such as "Arial", sz of 8-100, and optionally specify flags, which is a multibyte character, which can include 'i' for italics, 'u' for underline, or 'b' for bold. These flags may or may not be supported depending on the font and OS. After calling gfx_setfont(), gfx_texth may be updated to reflect the new average line height.

    gfx_setimgdim(image,w,h)

    Resize image referenced by index 0..1024-1, width and height must be 0-2048. The contents of the image will be undefined after the resize.

    gfx_setpixel(r,g,b)

    Writes a pixel of r,g,b to gfx_x,gfx_y.

    gfx_showmenu("str")

    Shows a popup menu at gfx_x,gfx_y. str is a list of fields separated by | characters. Each field represents a menu item.
    Fields can start with special characters:

    # : grayed out
    ! : checked
    > : this menu item shows a submenu
    < : last item in the current submenu

    An empty field will appear as a separator in the menu. gfx_showmenu returns 0 if the user selected nothing from the menu, 1 if the first field is selected, etc.
    Example:

    gfx_showmenu("first item, followed by separator||!second item, checked|>third item which spawns a submenu|#first item in submenu, grayed out|<second and last item in submenu|fourth item in top menu")

    gfx_transformblit(srcimg,destx,desty,destw,desth,div_w,div_h,table)

    Blits to destination at (destx,desty), size (destw,desth). div_w and div_h should be 2..64, and table should point to a table of 2*div_w*div_h values (this table must not cross a 65536 item boundary). Each pair in the table represents a S,T coordinate in the source image, and the table is treated as a left-right, top-bottom list of texture coordinates, which will then be rendered to the destination.

    gfx_triangle(x1,y1,x2,y2,x3,y3[x4,y4...])

    Draws a filled triangle, or any convex polygon.

    gfx_update()

    Updates the graphics display, if opened

    ifft(buffer,size)

    Perform an inverse FFT. For more information see fft().

    ifft_real(buffer,size)

    Performs an inverse FFT, but takes size/2 complex input pairs and produces size real output values. Usually used along with fft_ipermute(size/2).

    invsqrt(value)

    Returns a fast inverse square root (1/sqrt(x)) approximation of the parameter.

    log(value)

    Returns the natural logarithm (base e) of the parameter. If the value is not greater than 0, the return value is undefined.

    log10(value)

    Returns the base-10 logarithm of the parameter. If the value is not greater than 0, the return value is undefined.

    loop(count,expression)

    Evaluates count once, and then executes expression count, but not more than 1048576, times.

    match("needle","haystack"[, ...])

    Searches for the first parameter in the second parameter, using a simplified regular expression syntax.


    • * = match 0 or more characters
    • *? = match 0 or more characters, lazy
    • + = match 1 or more characters
    • +? = match 1 or more characters, lazy
    • ? = match one character

    You can also use format specifiers to match certain types of data, and optionally put that into a variable:

    • %s means 1 or more chars
    • %0s means 0 or more chars
    • %5s means exactly 5 chars
    • %5-s means 5 or more chars
    • %-10s means 1-10 chars
    • %3-5s means 3-5 chars
    • %0-5s means 0-5 chars
    • %x, %d, %u, and %f are available for use similarly
    • %c can be used, but can't take any length modifiers
    • Use uppercase (%S, %D, etc) for lazy matching

    See also sprintf() for other notes, including specifying direct variable references via {}.

    matchi("needle","haystack"[, ...])

    Case-insensitive version of match().

    max(&value,&value)

    Returns (by reference) the maximum value of the two parameters. Since max() returns by reference, expressions such as max(x,y) = 5 are possible.

    mem_get_values(offset, ...)

    Reads values from memory starting at offset into variables specified. Slower than regular memory reads for less than a few variables, faster for more than a few. Undefined behavior if used with more than 32767 variables.

    mem_set_values(offset, ...)

    Writes values to memory starting at offset from variables specified. Slower than regular memory writes for less than a few variables, faster for more than a few. Undefined behavior if used with more than 32767 variables.

    memcpy(dest,src,length)

    Copies length items of memory from src to dest. Regions are permitted to overlap.

    memset(offset,value,length)

    Sets length items of memory at offset to value.

    min(&value,&value)

    Returns (by reference) the minimum value of the two parameters. Since min() returns by reference, expressions such as min(x,y) = 5 are possible.

    printf("format"[, ...])

    Output formatted string to system-specific destination, see sprintf() for more information

    rand([max])

    Returns a psuedorandom real number between 0 and the parameter, inclusive. If the parameter is omitted or less than 1.0, 1.0 is used as a maximum instead.

    runloop("code")

    Adds code to be called back by REAPER. Used to create persistent ReaScripts that continue to run and respond to input, while the user does other tasks. Identical to defer().
    Note that no undo point will be automatically created when the script finishes, unless you create it explicitly.

    sign(value)

    Returns 1.0 if the parameter is greater than 0, -1.0 if the parameter is less than 0, or 0 if the parameter is 0.

    sin(angle)

    Returns the sine of the angle specified (specified in radians -- to convert from degrees to radians, multiply by $pi/180, or 0.017453).

    sleep(ms)

    Yields the CPU for the millisecond count specified, calling Sleep() on Windows or usleep() on other platforms.

    sprintf(#dest,"format"[, ...])

    Formats a string and stores it in #dest. Format specifiers begin with %, and may include:


    • %% = %
    • %s = string from parameter
    • %d = parameter as integer
    • %i = parameter as integer
    • %u = parameter as unsigned integer
    • %x = parameter as hex (lowercase) integer
    • %X = parameter as hex (uppercase) integer
    • %c = parameter as character
    • %f = parameter as floating point
    • %e = parameter as floating point (scientific notation, lowercase)
    • %E = parameter as floating point (scientific notation, uppercase)
    • %g = parameter as floating point (shortest representation, lowercase)
    • %G = parameter as floating point (shortest representation, uppercase)

    Many standard C printf() modifiers can be used, including:

    • %.10s = string, but only print up to 10 characters
    • %-10s = string, left justified to 10 characters
    • %10s = string, right justified to 10 characters
    • %+f = floating point, always show sign
    • %.4f = floating point, minimum of 4 digits after decimal point
    • %10d = integer, minimum of 10 digits (space padded)
    • %010f = integer, minimum of 10 digits (zero padded)

    Values for format specifiers can be specified as additional parameters to sprintf, or within {} in the format specifier (such as %{varname}d, in that case a global variable is always used).

    sqr(value)

    Returns the square of the parameter (similar to value*value, but only evaluating value once).

    sqrt(value)

    Returns the square root of the parameter. If the parameter is negative, the return value is undefined.

    stack_exch(&value)

    Exchanges a value with the top of the stack, and returns a reference to the parameter (with the new value).

    stack_peek(index)

    Returns a reference to the item on the top of the stack (if index is 0), or to the Nth item on the stack if index is greater than 0.

    stack_pop(&value)

    Pops a value from the user stack into value, or into a temporary buffer if value is not specified, and returns a reference to where the stack was popped. Note that no checking is done to determine if the stack is empty, and as such stack_pop() will never fail.

    stack_push(&value)

    Pushes value onto the user stack, returns a reference to the parameter.

    str_delsub(#str,pos,len)

    Deletes len characters at offset pos from #str, and returns #str.

    str_getchar("str",offset[,type])

    Returns the data at byte-offset offset of str. If offset is negative, position is relative to end of string.type defaults to signed char, but can be specified to read raw binary data in other formats (note the single quotes, these are single/multi-byte characters):


    • 'c' - signed char
    • 'cu' - unsigned char
    • 's' - signed short
    • 'S' - signed short, big endian
    • 'su' - unsigned short
    • 'Su' - unsigned short, big endian
    • 'i' - signed int
    • 'I' - signed int, big endian
    • 'iu' - unsigned int
    • 'Iu' - unsigned int, big endian
    • 'f' - float
    • 'F' - float, big endian
    • 'd' - double
    • 'D' - double, big endian

    str_insert(#str,"srcstr",pos)

    Inserts srcstr into #str at offset pos. Returns #str

    str_setchar(#str,offset,val[,type]))

    Sets value at offset offset, type optional. offset may be negative to refer to offset relative to end of string, or between 0 and length, inclusive, and if set to length it will lengthen string. See str_getchar() for more information on types.

    str_setlen(#str,len)

    Sets length of #str (if increasing, will be space-padded), and returns #str.

    strcat(#str,"srcstr")

    Appends srcstr to #str, and returns #str

    strcmp("str","str2")

    Compares strings, returning 0 if equal

    strcpy(#str,"srcstr")

    Copies the contents of srcstr to #str, and returns #str

    strcpy_from(#str,"srcstr",offset)

    Copies srcstr to #str, but starts reading srcstr at offset offset

    strcpy_substr(#str,"srcstr",offs,ml))

    PHP-style (start at offs, offs<0 means from end, ml for maxlen, ml<0 = reduce length by this amt)

    stricmp("str","str2")

    Compares strings ignoring case, returning 0 if equal

    strlen("str")

    Returns the length of the string passed as a parameter

    strncat(#str,"srcstr",maxlen)

    Appends srcstr to #str, stopping after maxlen characters of srcstr. Returns #str.

    strncmp("str","str2",maxlen)

    Compares strings giving up after maxlen characters, returning 0 if equal

    strncpy(#str,"srcstr",maxlen)

    Copies srcstr to #str, stopping after maxlen characters. Returns #str.

    strnicmp("str","str2",maxlen)

    Compares strings giving up after maxlen characters, ignoring case, returning 0 if equal

    tan(angle)

    Returns the tangent of the angle specified (specified in radians).

    tcp_close(connection)

    Closes a TCP connection created by tcp_listen() or tcp_connect().

    tcp_connect("address",port[,block])

    Create a new TCP connection to address:port. If block is specified and 0, connection will be made nonblocking. Returns TCP connection ID greater than 0 on success.

    tcp_listen(port[,"interface",#ip_out])

    Listens on port specified. Returns less than 0 if could not listen, 0 if no new connection available, or greater than 0 (as a TCP connection ID) if a new connection was made. If a connection made and #ip_out specified, it will be set to the remote IP. interface can be empty for all interfaces, otherwise an interface IP as a string.

    tcp_listen_end(port)

    Ends listening on port specified.

    tcp_recv(connection,#str[,maxlen])

    Receives data from a connection to #str. If maxlen is specified, no more than maxlen bytes will be received. If non-blocking, 0 will be returned if would block. Returns less than 0 if error.

    tcp_send(connection,"str"[,len])

    Sends a string to connection. Returns -1 on error, 0 if connection is non-blocking and would block, otherwise returns length sent. If len is specified and not less than 1, only the first len bytes of the string parameter will be sent.

    tcp_set_block(connection,block)

    Sets whether a connection blocks.

    time([&val])

    Sets the parameter (or a temporary buffer if omitted) to the number of seconds since January 1, 1970, and returns a reference to that value. The granularity of the value returned is 1 second.

    time_precise([&val])

    Sets the parameter (or a temporary buffer if omitted) to a system-local timestamp in seconds, and returns a reference to that value. The granularity of the value returned is system defined (but generally significantly smaller than one second).

    while(expression)

    Executes expression until expression evaluates to zero, or until 1048576iterations occur. An alternate and more useful syntax is while (expression) ( statements ), which evaluates statements after every non-zero evaluation of expression.

    ReaScript/Lua Built-In Function list

    reaper.atexit(function)

    Adds code to be executed when the script finishes or is ended by the user. Typically used to clean up after the user terminates defer() or runloop() code.

    reaper.defer(function)

    Adds code to be called back by REAPER. Used to create persistent ReaScripts that continue to run and respond to input, while the user does other tasks. Identical to runloop().
    Note that no undo point will be automatically created when the script finishes, unless you create it explicitly.

    reaper.get_action_context()

    is_new_value,filename,sectionID,cmdID,mode,resolution,val = reaper.get_action_context()
    Returns contextual information about the script, typically MIDI/OSC input values.

    val will be set to a relative or absolute value depending on mode (=0: absolute mode, >0: relative modes). resolution=127 for 7-bit resolution, =16383 for 14-bit resolution.
    Notes: sectionID, and cmdID will be set to -1 if the script is not part of the action list. mode, resolution and val will be set to -1 if the script was not triggered via MIDI/OSC.

    gfx VARIABLES

    The following global variables are special and will be used by the graphics system:

    • gfx.r, gfx.g, gfx.b, gfx.a - These represent the current red, green, blue, and alpha components used by drawing operations (0.0..1.0).
    • gfx.w, gfx.h - These are set to the current width and height of the UI framebuffer.
    • gfx.x, gfx.y - These set the "current" graphics position in x,y. You can set these yourselves, and many of the drawing functions update them as well.
    • gfx.mode - Set to 0 for default options. Add 1.0 for additive blend mode (if you wish to do subtractive, set gfx.a to negative and use gfx.mode as additive). Add 2.0 to disable source alpha for gfx.blit(). Add 4.0 to disable filtering for gfx.blit().
    • gfx.clear - If set to a value greater than -1.0, this will result in the framebuffer being cleared to that color. the color for this one is packed RGB (0..255), i.e. red+green*256+blue*65536. The default is 0 (black).
    • gfx.dest - Defaults to -1, set to 0..1024-1 to have drawing operations go to an offscreen buffer (or loaded image).
    • gfx.texth - Set to the height of a line of text in the current font. Do not modify this variable.
    • gfx.ext_retina - If set to 1.0 on initialization, will be updated to 2.0 if high resolution display is supported, and if so gfx.w/gfx.h/etc will be doubled.
    • gfx.mouse_x, gfx.mouse_y - gfx.mouse_x and gfx.mouse_y are set to the coordinates of the mouse relative to the graphics window.
    • gfx.mouse_wheel, gfx.mouse_hwheel - mouse wheel (and horizontal wheel) positions. These will change typically by 120 or a multiple thereof, the caller should clear the state to 0 after reading it.
    • gfx.mouse_cap is a bitfield of mouse and keyboard modifier state.
      • 1: left mouse button
      • 2: right mouse button
      • 4: Control key
      • 8: Shift key
      • 16: Alt key
      • 32: Windows key
      • 64: middle mouse button

    gfx.arc(x,y,r,ang1,ang2[,antialias])

    Draws an arc of the circle centered at x,y, with ang1/ang2 being specified in radians.

    gfx.blit(source, scale, rotation[, srcx, srcy, srcw, srch, destx, desty, destw, desth, rotxoffs, rotyoffs])

    srcx/srcy/srcw/srch specify the source rectangle (if omitted srcw/srch default to image size), destx/desty/destw/desth specify dest rectangle (if not specified, these will default to reasonable defaults -- destw/desth default to srcw/srch * scale).

    gfx.blit(source,scale,rotation)

    If three parameters are specified, copies the entirity of the source bitmap to gfx.x,gfx.y using current opacity and copy mode (set with gfx.a, gfx.mode). You can specify scale (1.0 is unscaled) and rotation (0.0 is not rotated, angles are in radians).
    For the "source" parameter specify -1 to use the main framebuffer as source, or an image index (see gfx.loadimg()).

    gfx.blitext(source,coordinatelist,rotation)

    Deprecated, use gfx.blit instead.

    gfx.blurto(x,y)

    Blurs the region of the screen between gfx.x,gfx.y and x,y, and updates gfx.x,gfx.y to x,y.

    gfx.circle(x,y,r[,fill,antialias])

    Draws a circle, optionally filling/antialiasing.

    gfx.clienttoscreen(x,y)

    Converts the coordinates x,y to screen coordinates, returns those values.

    gfx.deltablit(srcimg,srcs,srct,srcw,srch,destx,desty,destw,desth,dsdx,dtdx,dsdy,dtdy,dsdxdy,dtdxdy[,usecliprect=1])

    Blits from srcimg(srcx,srcy,srcw,srch) to destination (destx,desty,destw,desth). Source texture coordinates are s/t, dsdx represents the change in s coordinate for each x pixel, dtdy represents the change in t coordinate for each y pixel, etc. dsdxdy represents the change in dsdx for each line. If usecliprect is specified and 0, then srcw/srch are ignored.

    gfx.dock(v[,wx,wy,ww,wh])

    Call with v=-1 to query docked state, otherwise v>=0 to set docked state. State is &1 if docked, second byte is docker index (or last docker index if undocked). If wx-wh specified, additional values will be returned with the undocked window position/size

    gfx.drawchar(char)

    Draws the character (can be a numeric ASCII code as well), to gfx.x, gfx.y, and moves gfx.x over by the size of the character.

    gfx.drawnumber(n,ndigits)

    Draws the number n with ndigits of precision to gfx.x, gfx.y, and updates gfx.x to the right side of the drawing. The text height is gfx.texth.

    gfx.drawstr("str"[,flags,right,bottom])

    Draws a string at gfx.x, gfx.y, and updates gfx.x/gfx.y so that subsequent draws will occur in a similar place.

    If flags, right ,bottom passed in:

  • flags&1: center horizontally
  • flags&2: right justify
  • flags&4: center vertically
  • flags&8: bottom justify
  • flags&256: ignore right/bottom, otherwise text is clipped to (gfx.x, gfx.y, right, bottom)

  • gfx.getchar([char])

    If char is 0 or omitted, returns a character from the keyboard queue, or 0 if no character is available, or -1 if the graphics window is not open. If char is specified and nonzero, that character's status will be checked, and the function will return greater than 0 if it is pressed.

    Common values are standard ASCII, such as 'a', 'A', '=' and '1', but for many keys multi-byte values are used, including 'home', 'up', 'down', 'left', 'rght', 'f1'.. 'f12', 'pgup', 'pgdn', 'ins', and 'del'.

    Modified and special keys can also be returned, including:


    • Ctrl/Cmd+A..Ctrl+Z as 1..26
    • Ctrl/Cmd+Alt+A..Z as 257..282
    • Alt+A..Z as 'A'+256..'Z'+256
    • 27 for ESC
    • 13 for Enter
    • ' ' for space
    • 65536 for query of special flags, returns: &1 (supported), &2=window has focus, &4=window is visible

    gfx.getdropfile(idx)

    Returns success,string for dropped file index idx. call gfx.dropfile(-1) to clear the list when finished.

    gfx.getfont()

    Returns current font index, and the actual font face used by this font (if available).

    gfx.getimgdim(handle)

    Retreives the dimensions of an image specified by handle, returns w, h pair.

    gfx.getpixel()

    Returns r,g,b values [0..1] of the pixel at (gfx.x,gfx.y)

    gfx.gradrect(x,y,w,h, r,g,b,a[, drdx, dgdx, dbdx, dadx, drdy, dgdy, dbdy, dady])

    Fills a gradient rectangle with the color and alpha specified. drdx-dadx reflect the adjustment (per-pixel) applied for each pixel moved to the right, drdy-dady are the adjustment applied for each pixel moved toward the bottom. Normally drdx=adjustamount/w, drdy=adjustamount/h, etc.

    gfx.init("name"[,width,height,dockstate,xpos,ypos])

    Initializes the graphics window with title name. Suggested width and height can be specified.

    Once the graphics window is open, gfx.update() should be called periodically.

    gfx.line(x,y,x2,y2[,aa])

    Draws a line from x,y to x2,y2, and if aa is not specified or 0.5 or greater, it will be antialiased.

    gfx.lineto(x,y[,aa])

    Draws a line from gfx.x,gfx.y to x,y. If aa is 0.5 or greater, then antialiasing is used. Updates gfx.x and gfx.y to x,y.

    gfx.loadimg(image,"filename")

    Load image from filename into slot 0..1024-1 specified by image. Returns the image index if success, otherwise -1 if failure. The image will be resized to the dimensions of the image file.

    gfx.measurechar(char)

    Measures the drawing dimensions of a character with the current font (as set by gfx.setfont). Returns width and height of character.

    gfx.measurestr("str")

    Measures the drawing dimensions of a string with the current font (as set by gfx.setfont). Returns width and height of string.

    gfx.muladdrect(x,y,w,h,mul_r,mul_g,mul_b[,mul_a,add_r,add_g,add_b,add_a])

    Multiplies each pixel by mul_* and adds add_*, and updates in-place. Useful for changing brightness/contrast, or other effects.

    gfx.printf("format"[, ...])

    Formats and draws a string at gfx.x, gfx.y, and updates gfx.x/gfx.y accordingly (the latter only if the formatted string contains newline). For more information on format strings, see sprintf()

    gfx.quit()

    Closes the graphics window.

    gfx.rect(x,y,w,h[,filled])

    Fills a rectangle at x,y, w,h pixels in dimension, filled by default.

    gfx.rectto(x,y)

    Fills a rectangle from gfx.x,gfx.y to x,y. Updates gfx.x,gfx.y to x,y.

    gfx.roundrect(x,y,w,h,radius[,antialias])

    Draws a rectangle with rounded corners.

    gfx.screentoclient(x,y)

    Converts the screen coordinates x,y to client coordinates, returns those values.

    gfx.set(r[,g,b,a,mode,dest])

    Sets gfx.r/gfx.g/gfx.b/gfx.a/gfx.mode, sets gfx.dest if final parameter specified

    gfx.setcursor(resource_id,custom_cursor_name)

    Sets the mouse cursor. resource_id is a value like 32512 (for an arrow cursor), custom_cursor_name is a string like "arrow" (for the REAPER custom arrow cursor). resource_id must be nonzero, but custom_cursor_name is optional.

    gfx.setfont(idx[,"fontface", sz, flags])

    Can select a font and optionally configure it. idx=0 for default bitmapped font, no configuration is possible for this font. idx=1..16 for a configurable font, specify fontface such as "Arial", sz of 8-100, and optionally specify flags, which is a multibyte character, which can include 'i' for italics, 'u' for underline, or 'b' for bold. These flags may or may not be supported depending on the font and OS. After calling gfx.setfont(), gfx.texth may be updated to reflect the new average line height.

    gfx.setimgdim(image,w,h)

    Resize image referenced by index 0..1024-1, width and height must be 0-2048. The contents of the image will be undefined after the resize.

    gfx.setpixel(r,g,b)

    Writes a pixel of r,g,b to gfx.x,gfx.y.

    gfx.showmenu("str")

    Shows a popup menu at gfx.x,gfx.y. str is a list of fields separated by | characters. Each field represents a menu item.
    Fields can start with special characters:

    # : grayed out
    ! : checked
    > : this menu item shows a submenu
    < : last item in the current submenu

    An empty field will appear as a separator in the menu. gfx.showmenu returns 0 if the user selected nothing from the menu, 1 if the first field is selected, etc.
    Example:

    gfx.showmenu("first item, followed by separator||!second item, checked|>third item which spawns a submenu|#first item in submenu, grayed out|<second and last item in submenu|fourth item in top menu")

    gfx.transformblit(srcimg,destx,desty,destw,desth,div_w,div_h,table)

    Blits to destination at (destx,desty), size (destw,desth). div_w and div_h should be 2..64, and table should point to a table of 2*div_w*div_h values (table can be a regular table or (for less overhead) a reaper.array). Each pair in the table represents a S,T coordinate in the source image, and the table is treated as a left-right, top-bottom list of texture coordinates, which will then be rendered to the destination.

    gfx.triangle(x1,y1,x2,y2,x3,y3[x4,y4...])

    Draws a filled triangle, or any convex polygon.

    gfx.update()

    Updates the graphics display, if opened

    reaper.new_array([table|array][size])

    Creates a new reaper.array object of maximum and initial size size, if specified, or from the size/values of a table/array. Both size and table/array can be specified, the size parameter will override the table/array size.

    reaper.runloop(function)

    Adds code to be called back by REAPER. Used to create persistent ReaScripts that continue to run and respond to input, while the user does other tasks. Identical to defer().
    Note that no undo point will be automatically created when the script finishes, unless you create it explicitly.

    {reaper.array}.clear([value, offset, size])

    Sets the value of zero or more items in the array. If value not specified, 0.0 is used. offset is 1-based, if size omitted then the maximum amount available will be set.

    {reaper.array}.convolve([src, srcoffs, size, destoffs])

    Convolves complex value pairs from reaper.array, starting at 1-based srcoffs, reading/writing to 1-based destoffs. size is in normal items (so it must be even)

    {reaper.array}.copy([src, srcoffs, size, destoffs])

    Copies values from reaper.array or table, starting at 1-based srcoffs, writing to 1-based destoffs.

    {reaper.array}.fft(size[, permute, offset])

    Performs a forward FFT of size. size must be a power of two between 4 and 32768 inclusive. If permute is specified and true, the values will be shuffled following the FFT to be in normal order.

    {reaper.array}.fft_real(size[, permute, offset])

    Performs a forward real->complex FFT of size. size must be a power of two between 4 and 32768 inclusive. If permute is specified and true, the values will be shuffled following the FFT to be in normal order.

    {reaper.array}.get_alloc()

    Returns the maximum (allocated) size of the array.

    {reaper.array}.ifft(size[, permute, offset])

    Performs a backwards FFT of size. size must be a power of two between 4 and 32768 inclusive. If permute is specified and true, the values will be shuffled before the IFFT to be in fft-order.

    {reaper.array}.ifft_real(size[, permute, offset])

    Performs a backwards complex->real FFT of size. size must be a power of two between 4 and 32768 inclusive. If permute is specified and true, the values will be shuffled before the IFFT to be in fft-order.

    {reaper.array}.multiply([src, srcoffs, size, destoffs])

    Multiplies values from reaper.array, starting at 1-based srcoffs, reading/writing to 1-based destoffs.

    {reaper.array}.resize(size)

    Resizes an array object to size. size must be [0..max_size].

    {reaper.array}.table([offset, size])

    Returns a new table with values from items in the array. Offset is 1-based and if size is omitted all available values are used.

    ReaScript/Python Built-In Function list

    RPR_atexit(String)

    Adds code to be executed when the script finishes or is ended by the user. Typically used to clean up after the user terminates defer() or runloop() code.

    RPR_defer(String code)

    Adds code to be called back by REAPER. Used to create persistent ReaScripts that continue to run and respond to input, while the user does other tasks. Identical to runloop().
    Note that no undo point will be automatically created when the script finishes, unless you create it explicitly.

    RPR_runloop(String code)

    Adds code to be called back by REAPER. Used to create persistent ReaScripts that continue to run and respond to input, while the user does other tasks. Identical to defer().
    Note that no undo point will be automatically created when the script finishes, unless you create it explicitly.