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]
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.mute
Note that using ## in a macro allows the parameter to be concatenated with another named string.
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 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] var
Finally, 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+)
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)
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
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)
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 ofset 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}]