|
|
|
05-24-2019, 10:33 AM
|
#1
|
Human being with feelings
Join Date: Jan 2012
Location: Germany
Posts: 1,130
|
Q: How to change all HW outs to pre-fader?
EDIT:
These three scripts can be found in ReaPack now: - Set hardware outputs of selected tracks to post-fader
- Set hardware outputs of selected tracks to pre-fader (post-fx)
- Set hardware outputs of selected tracks to pre-fader (pre-fx)
-----------------------------------------------
Original post:
I posted this in another subforum and got a script from J Reverb.
His original idea was to create pre-fader sends, but I want to change already existing ones.
So here is his original script.
I cut it down to this:
Code:
--I_SENDMODE : returns int *, 0=post-fader, 1=pre-fx, 2=post-fx (deprecated), 3=post-fx
----------------------------------------------------
sendmode=1
----------------------------------------------------
local cnt_trks = reaper.CountSelectedTracks(0)
for i = 0, cnt_trks - 1 do
local sel_track = reaper.GetSelectedTrack(0, i)
hw_out_code=1024
--I_SRCCHAN : returns int *, index,&1024=mono, -1 for none
--I_DSTCHAN : returns int *, index, &1024=mono, otherwise stereo pair, hwout:&512=rearoute
reaper.SetTrackSendInfo_Value(sel_track, 1, 0, "I_SENDMODE", sendmode)
end
---------------------------------------------------
It nearly does everything I need. The only missing thing is that it only affects the first HW out on the selected track. Instead I would like it to affect all HW outs. Is this possible?
I know that it has to do with the "0" in this line:
Code:
reaper.SetTrackSendInfo_Value(sel_track, 1, 0, "I_SENDMODE", sendmode)
But... how can I tell an integer to use various numbers? This goes beyond my common sense. As you can see I have got no idea of scripting at all!
Do I need to use "GetTrackNumSends" and make a loop for all sends? I wish I knew how to do that, haha!
Last edited by timothys_monster; 05-27-2019 at 08:37 PM.
|
|
|
05-24-2019, 12:40 PM
|
#2
|
Human being with feelings
Join Date: Jan 2012
Location: Germany
Posts: 1,130
|
Since I have no idea how to do it from scratch I just try editing other people's scripts.
So I took cfillion's "cfillion_Remove hardware outputs of selected tracks.lua" since it seems to affect all hardware outs.
After editing it like this, it also only changes the first hardware out, though
Code:
local self = ({reaper.get_action_context()})[2]:match('([^/\\_]+).lua$')
local UNDO_STATE_TRACKCFG = 1
local HARDWARE_OUT = 1 -- > 0
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, 0, "I_SENDMODE", 1)
end
end
reaper.Undo_EndBlock(self, UNDO_STATE_TRACKCFG)
|
|
|
05-25-2019, 11:45 AM
|
#3
|
Human being with feelings
Join Date: Jan 2012
Location: Germany
Posts: 1,130
|
Anyone got any ideas on how to do this?
|
|
|
05-25-2019, 02:05 PM
|
#4
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
In the inner loop where you loop through the track sends
Code:
for si=0, reaper.GetTrackNumSends(track, HARDWARE_OUT)-1 do
reaper.SetTrackSendInfo_Value(track, 1, 0, "I_SENDMODE", 1)
end
you have si as the incrementing variable but you don't use it for send index.
The function signature for SetTrackSendInfo_Value() is:
Code:
reaper.SetTrackSendInfo_Value( tr, category, sendidx, parmname, newvalue )
so it should be like this (untested):
Code:
reaper.SetTrackSendInfo_Value(track, 1, si, "I_SENDMODE", 1)
Last edited by nofish; 05-25-2019 at 02:44 PM.
|
|
|
05-25-2019, 04:35 PM
|
#5
|
Human being with feelings
Join Date: Jan 2012
Location: Germany
Posts: 1,130
|
Thaaaank you, nofish!
That was it. So easy!
Awesome, now to include it in ReaPack would I definitely need a GitHub account or could someone else upload it?
Maybe I should ask cfillion to add it to his repository, since it is basically his script...
|
|
|
05-26-2019, 08:33 AM
|
#6
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
You're welcome.
In case you want to add it to ReaPack yourself, cfillion has made web based upload tools, no GitHub account necessary I think.
https://reapack.com/upload
edit:
Nah, sorry, it says "A GitHub account is required."
|
|
|
05-26-2019, 10:57 AM
|
#7
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Fwiw, I've added to my Ultraschall-Api dozens of functions who deal with routing and hwout-management in a more comfortable way.
https://mespotin.uber.space/Ultrasch...1_Introduction
Maybe helpful for you in the future
|
|
|
05-27-2019, 09:31 AM
|
#8
|
Human being with feelings
Join Date: Jan 2012
Location: Germany
Posts: 1,130
|
Amazing! I should have looked it up first...
You created a CountTrackHWOuts, that's awesome. I could have needed it. But who knows, maybe some day I will actually start to code
|
|
|
05-27-2019, 09:36 AM
|
#9
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Nice funfact: they are faster than Reaper's original functions, when applying changes to multiple HWOuts/Sends
|
|
|
05-27-2019, 09:42 AM
|
#10
|
Human being with feelings
Join Date: Jan 2012
Location: Germany
Posts: 1,130
|
Seeing all these, do you think it might be possible to make a toggle script that could add HW Outs as pre-fx or post-fx sends?
I mean by activating the script and just clicking the desired channel in the routing matrix?
|
|
|
08-23-2019, 01:57 AM
|
#11
|
Human being with feelings
Join Date: Nov 2016
Posts: 37
|
Change send/rcv for selected tracks -NOT hardware?
Hi, I came across this thread as I am trying to achieve the same goal i.e
Set Sends/Rcv of selected tracks to post-fader
Set Sends/Rcv of selected tracks to pre-fader (post-fx)
Set Sends/Rcv of selected tracks to pre-fader (pre-fx)
BUT-- Not for the hardware sends.
Does anyone know of way to achieve this?
It's frustrating to have to change each send/rcv one by one.
Many thanks
|
|
|
11-22-2019, 03:41 AM
|
#12
|
Human being with feelings
Join Date: Jan 2019
Location: UK
Posts: 938
|
Quote:
Originally Posted by mespotine
|
Sorry to hijack you fellas, can I ask a quick question?
I'm trying to add a hardware out (3: Output 3 / Output 4) to the selected track in lua and it's all above my skill level. Trying to learn from this thread but it's all a bit much.
Could either of you help? :¬)
Edit: Done it. In case it helps someone else:
https://forum.cockos.com/showpost.ph...postcount=1898
Last edited by b0se; 11-22-2019 at 06:04 AM.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 03:42 AM.
|