From 8c0b2f48ce8218025739e7a27cac295169c71269 Mon Sep 17 00:00:00 2001 From: rumkommen Date: Mon, 27 May 2019 19:52:43 -0500 Subject: [PATCH] Release Set hardware outputs of selected tracks to post-fader v1.0 (#189) --- ...tputs of selected tracks to post-fader.lua | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Tracks Properties/tm_Set hardware outputs of selected tracks to post-fader.lua diff --git a/Tracks Properties/tm_Set hardware outputs of selected tracks to post-fader.lua b/Tracks Properties/tm_Set hardware outputs of selected tracks to post-fader.lua new file mode 100644 index 000000000..ba9186d29 --- /dev/null +++ b/Tracks Properties/tm_Set hardware outputs of selected tracks to post-fader.lua @@ -0,0 +1,26 @@ +-- @description Set hardware outputs of selected tracks to post-fader +-- @author TM +-- @version 1.0 +-- @donation https://www.paypal.me/cfillion +-- @about All credits go to cfillion for his original script and to nofish for helping me editing it. + +local self = ({reaper.get_action_context()})[2]:match('([^/\\_]+).lua$') +local UNDO_STATE_TRACKCFG = 1 +local HARDWARE_OUT = 1 -- > 0 +local postfader=0 +local prefx=1 +local postfx=3 + +local seltracks = reaper.CountSelectedTracks() +if seltracks < 1 then return reaper.defer(function() end) end + +reaper.Undo_BeginBlock() + +for ti=0, seltracks-1 do + local track = reaper.GetSelectedTrack(0, ti) + for si=0, reaper.GetTrackNumSends(track, HARDWARE_OUT)-1 do + reaper.SetTrackSendInfo_Value(track, 1, si, "I_SENDMODE", postfader) + end +end + +reaper.Undo_EndBlock(self, UNDO_STATE_TRACKCFG)