You want to record-arm selected tracks or have individual actions for record-arming their "own" tracks, AkeW?
This works:
Code:
-- PL9-switch record arm state on track01.lua
track_num =1 -- 01 to 99
rec_onoff = 1 -- 1 for arm, 0 for unarm
rec_toggle_comm_id = 8*track_num +17 -- calculate CommandID num for track
toggle_state = reaper.GetToggleCommandStateEx(0, rec_toggle_comm_id) -- get toggle state for track
if toggle_state ~= rec_onoff then reaper.Main_OnCommandEx(rec_toggle_comm_id, 0, 0) end -- if toggle_state isn't desired rec_onoff state, toggle
-- reaper.Main_OnCommandEx(integer command, integer flag, ReaProject proj)
Just set the "track_num" variable to the track you want to arm and save the script as "PL9-switch record arm state on track
nn.lua"
The above script is for track 1. You can have an action for individul tracks from 1 to 99 with this.
If you want to make the action
unarm, then set rec_onoff = 0 and save accordingly with a clear unarm filename inc track number.
I've just tested tracks 1 to 5 with the above and it works well -you could assign the scripts to your controller MIDI numbers and I think you'd be sorted. Shout back if there's anything you need clarifying...
>