View Single Post
Old 11-21-2016, 01:35 PM   #9
AkeW
Human being with feelings
 
Join Date: Dec 2008
Posts: 39
Default

planetnine - Modified your script to read rec_onoff from midi value. It works great Thanks!

Code:
track_num = 1    -- 01 to 99

is_new,name,sec,cmd,rel,res,val = reaper.get_action_context()
if val > 62 then 
  rec_onoff = 1
else
  rec_onoff = 0
end

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
AkeW is offline   Reply With Quote