clear tcp.mute clear tcp.*
reset tcp.mute reset tcp.*
set tcp.mute [0 0 10 10] set myvar w<100 [0 0 10 10] [20 20 10 10] set myvar w<100 [0 0 10 10] w<200 [20 20 10 10] [40 40 10 10]
def square10 10 10 set tcp.mute [0 0 square10] ; sets tcp.mute to [0 0 10 10] def two_coords [10 10 0 0] [0 0 10 10] set tcp.mute + two_coords ; sets tcp.mute to [10 10 10 10] set tcp.mute w<100 two_coords ; like set.tcp.mute w<100 [10 10 0 0] [0 0 10 10]
front tcp.solo front tcp.mute
macro setall dest src set dest [src src src src src src src src] set master.##dest dest endmacro setall tcp.mute 1 ; set tcp.mute [1 1 1 1 1 1 1], set master.tcp.mute tcp.muteNote that using ## in a macro allows the parameter to be concatenated with another named string.
; variable name description for user default minimum maximum define_parameter "hide_mute" "Hide Mute Button" 0 0 1 ; later in script, hide tcp.mute if hide_mute is set set tcp.mute hide_mute==1 [0] ; note that variable name is used to make the value persist for this theme
custom tcp.custom.xyz text_label command_id accessibility_description button_imageNote that the custom element name must include the string 'custom.' Custom elements become a normal part of the layout that contains them and can be used with set, front, etc. If command_id is specified and valid, and button_image is a valid image name, element will be a button. Otherwise, it will be a static text element with 'text_label.' tcp.custom.xyz.font .color and .margin may all be specified.
Layout "Mute button mixer" clear mcp.* set mcp.size [20 20] set mcp.mute [0 0 20 20 0 0 1 1] EndLayoutYou can specify multiple Layouts with the same name, and they will be treated similar to a single Layout definiton, though for clarity it might be good to separate them based on the UI context (i.e. tcp.*, mcp.*, etc).
set foo 1.0 and set foo [1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0] ...or set foo h and set foo [h h h h h h h h]are equivalent.
scalar@x or scalar@0 scalar@y or scalar@1 scalar@w or scalar@2 scalar@h or scalar@3 scalar@ls or scalar@4 scalar@ts or scalar@5 scalar@rs or scalar@6 scalar@bs or scalar@7For example, the following are equivalent:
set foo 1.0@w and set foo [0 0 1.0 0] ...or set foo recarm@w and set foo [0 0 recarm 0]
Comparisons: val1<val2 -- if val1 is less than val2, use first expression, otherwise second val1>val2 -- if val1 is greater than val2 ... val1<=val2 -- if val1 is less than or equal to val2, use first expression, otherwise second val1>=val2 -- if val1 is greater than or equal to val2 ... val1==val2 -- if val1 equals val2 ... val1!=val2 -- if val1 does not equal val2 ... ?val1 -- if val1 is nonzero ... !val1 -- if val1 is zero ... val1&val2 -- bitwise AND (if any bit is set in both val1 and val2) Combinators: + -- sum first expression and second expression - -- subtract second expression from first expression (REAPER 5.0+) * -- multiply first expression and second expression / -- divide first expression by second expression (REAPER 5.0+) +:val1:val2 -- val1*(first expression) + val2*(second expression) *:val1:val2 -- ((first expression)+[val1 val1...])*((second expression)+[val2 val2...])If optional_expression is not specified, then in its place will be the current value of the destination, which can also be abbreviated as "." -- so, for example, the following commands are all compiled to the same logic:
set var w<100 [0] set var w<100 [0] . set var w<100 [0] varFinally, you can extend expressions (which are often nested and thus quite long) over multiple lines by ending each line (except the last) with a backslash ("\")(requires v4.25+).
w -- width of parent, pixels h -- height of parent, pixels reaper_version -- REAPER version (i.e. 4.25)(requires v4.15+) os_type -- (REAPER 5.972+) - set to 0 on Windows, 1 on macOS, 2 on Linux Track specific: folderstate -- folder state of track, if applicable (0 for normal, 1 for folder, -n for last track in folder(s)) folderdepth -- positive if in a folder (how many folders deep) maxfolderdepth -- highest folder depth of any track mcp_maxfolderdepth -- highest folder depth of any track in mixer(requires v4.15+) recarm -- nonzero if track record armed tcp_iconsize -- size of track panel icon column, if any mcp_iconsize -- size of mixer icon row, if any mcp_wantextmix -- flags indicating which extended mixer settings are desired (&1 for inserts, &2 for sends, &4 for fx parms) tracknch -- number of track channels (2-64) trackpanmode -- pan mode of track (0=classic 3.x, 3=new balance, 5=stereo pan, 6=dualpan) tcp_fxparms -- count of TCP FX parameters visible (0-n) (including sends or FX items, if visible) tcp_fxembed -- (REAPER 6.0+) - count of TCP embedded FX visible mcp_fxembed -- (REAPER 6.38+) count of MCP embedded FX visible tcp_sends_enabled -- (REAPER 7.0+) user preference to show sends in TCP is enabled tcp_fxlist_enabled -- (REAPER 7.0+) user preference to show FX inserts in TCP is enabled send_cnt -- (REAPER 7.0+) number of sends fx_parm_cnt -- (REAPER 7.0+) number of FX parameters fx_cnt -- (REAPER 7.0+) number of FX inserts recfx_cnt -- (REAPER 7.0+) number of record input FX trackcolor_valid -- (REAPER 5.0+) - set to 1 if track color set trackcolor_r -- (REAPER 5.0+) - valid if trackcolor_valid set, red value 0-255 trackcolor_g -- (REAPER 5.0+) - valid if trackcolor_valid set, green value 0-255 trackcolor_b -- (REAPER 5.0+) - valid if trackcolor_valid set, blue value 0-255 mixer_visible -- (REAPER 5.972+) - set to 1 if the mixer is visible track_selected -- (REAPER 5.972+) - set to 1 if track is selected trackidx -- (REAPER 6.47+) track index (0 for master, 1+) ntracks -- (REAPER 6.47+) total track count (not including master) trackfixedlanes -- (REAPER 7.0+) number of fixed lanes (or 0) Transport specific: trans_flags -- trans_flags&1 is nonzero if transport centered trans_flags&2 is nonzero if user wants playspeed controls visible trans_flags&4 is nonzero if user wants current time signature visible trans_docked -- nonzero if docked transport trans_center -- nonzero if transport centered Envelope specific: envcp_type -- 4 if FX envelope (can display additional controls) env_selected -- (REAPER 7.0+) set to 1 if envelope is selected
set tmp [1 2 3 4 5 6 7 8] tmp{x} or tmp{0} -- first item in coordinate_list (1) tmp{y} or tmp{1} tmp{w} or tmp{2} tmp{h} or tmp{3} tmp{ls} or tmp{4} tmp{ts} or tmp{5} tmp{rs} or tmp{6} tmp{bs} or tmp{7} -- last item in coordinate_list (8)So, in the above example, you can specify "tmp{y}" anywhere you would otherwise use "2". For example, instead of
set foo w>2 [1] [0 1 2 3 4 5 6 7]you could specify
set foo w>tmp{y} [1] [0 1 tmp{y} 3 4 5 6 7]Note: in the context of using coordinate_list names inside of [] coordinate_list, if the {} index is omitted, the current index will be used, i.e. the following are the same:
set tmp [1 2 3 4] set foo [0 0 tmp tmp] and set foo [0 0 tmp{2} tmp{3}]