Old 03-27-2017, 12:07 PM   #1
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,269
Default Script: Create mix bus and reroute all top-level tracks to it

I don't know how many people will find this useful, but whatever.

Lokasenna_Create mix bus and reroute all top-level tracks to it.lua
Lokasenna_Create mix bus and reroute all selected tracks to it.lua

Nothing fancy at the moment; it just adds a new track called "Mix Bus", then disables the Master send for all tracks at the "top" level (read: folder parents) and routes them to the mix bus instead. Due to Reaper's sends/receives being a bit complicated to deal with, this only affects channels 1/2 - tracks that were outputting to the Master on 3/4 will get messed up, etc.

Reasons to use a mix bus instead going straight to the Master include:
  • Slight performance gain, since the Master can't use anticipative FX processing. Or something. I think.
  • Duplicate the mix bus a dozen times, mess with the send faders on each copy, and you can quickly have all of the variants that labels tend to ask for ready to go without having to mess up the actual mix: Vocals Up, Drums Down, Guitars Down, No Vocals, Less Reverb, etc.
  • Put your metering and analysis plugins on the Master, your actual mastering chain on the mix bus, and you can A/B the mastering chain by turning the mix bus's FX chain on/off without disabling the meters at the same time.

Enjoy.

Edit: Added an equivalent action for "selected tracks".

Last edited by Lokasenna; 08-06-2017 at 03:32 PM.
Lokasenna is online now   Reply With Quote
Old 03-27-2017, 12:18 PM   #2
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 5,453
Default

Very useful!
I've been doing this by hand for so long... no more!
Thanks
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 03-27-2017, 12:31 PM   #3
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,269
Default

I keep forgetting about it until halfway through a track and then I don't feel like doing it anymore. :P
Lokasenna is online now   Reply With Quote
Old 03-27-2017, 03:51 PM   #4
stereolost
Human being with feelings
 
stereolost's Avatar
 
Join Date: Mar 2015
Location: Moscow, Russia
Posts: 206
Default

Thanks! Wish i had it a week ago))
stereolost is offline   Reply With Quote
Old 03-27-2017, 04:34 PM   #5
akademie
Human being with feelings
 
Join Date: Mar 2007
Posts: 556
Default

Thanks Lokasenna,
it is very useful script

FR - what if master is multichannel? then tracks may also be multichannel and not sending only 1/2 to master... Is it easily possible to modify script to take such cases into account, please?

BTW, I tried to modify the script myself to automatically give a new "Mix Bus" created track specific color (e.g. green)
So, after line 46 I added:
reaper.SetTrackColor(bus, 0x0000FF00)
... seems to work ok, nice

once again - thanks!
akademie

Last edited by akademie; 03-27-2017 at 04:44 PM.
akademie is offline   Reply With Quote
Old 03-27-2017, 05:56 PM   #6
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,269
Default

I can look at adding multichannel support, sure.
Lokasenna is online now   Reply With Quote
Old 06-28-2017, 04:14 PM   #7
robgb
Human being with feelings
 
Join Date: Apr 2017
Location: Los Angeles, CA
Posts: 134
Default

I love this script. Thanks. But I'm wondering if there's also a way to retool it to make a buss track only for selected tracks rather than top level tracks? What would I have to change in the script?
robgb is offline   Reply With Quote
Old 06-28-2017, 04:50 PM   #8
junh1024
Human being with feelings
 
Join Date: Feb 2014
Posts: 126
Default

Sounds like some of these things could be accomplished by making a new track on top, and then making that track a folder of all lower tracks
junh1024 is offline   Reply With Quote
Old 06-29-2017, 04:28 AM   #9
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,269
Default

So I did look into multichannel support but... the way Reaper handles sends/receives with extra channels is (IMO) really weird and I can't figure it out. So that's not happening.

Quote:
Originally Posted by robgb View Post
I love this script. Thanks. But I'm wondering if there's also a way to retool it to make a buss track only for selected tracks rather than top level tracks? What would I have to change in the script?
I don't have time to actually test this, but try replacing lines 49 through 73 with:
Code:
-- Loop through all tracks in the project
for i = 1, reaper.CountSelectedTracks(0) - 1 do
	
	_=dm and Msg("looking at track "..i)
	
	local tr = reaper.GetSelectedTrack(0, i)
	
	_=dm and Msg("\tdepth = "..reaper.GetTrackDepth(tr))
	_=dm and Msg("\tp_send = "..tostring( reaper.GetMediaTrackInfo_Value(tr, "B_MAINSEND") ) )
	
	_=dm and Msg("\trerouting")
	
	-- Disable Master Out
	reaper.SetMediaTrackInfo_Value(tr, "B_MAINSEND", 0)
		
	-- Add a post-fader send to idx 1
	reaper.CreateTrackSend(tr, bus)
	
end
There's also a feature provided by the SWS extension called "Cue Buss Generator" that does something similar, I think.

Quote:
Originally Posted by junh1024 View Post
Sounds like some of these things could be accomplished by making a new track on top, and then making that track a folder of all lower tracks
Definitely. I prefer to only use folders for things that I might want to hide, just to keep the project less cluttered.
Lokasenna is online now   Reply With Quote
Old 01-09-2018, 11:51 AM   #10
DynamicK
Human being with feelings
 
Join Date: Nov 2017
Location: Gloucestershire, UK
Posts: 220
Default

Quote:
Originally Posted by Lokasenna View Post
I don't know how many people will find this useful, but whatever.
Lokasenna_Create mix bus and reroute all selected tracks to it.lua
Thanks for this...very useful for fast creation. Anyway I can modify it so the the MixBus is added at the end of the tracks instead of at the top?
DynamicK is offline   Reply With Quote
Old 07-22-2018, 06:56 AM   #11
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,269
Default

Small update - sends will now override the defaults to be at unity gain, post-fader.
Lokasenna is online now   Reply With Quote
Old 07-15-2019, 05:23 AM   #12
tapemelancholy
Human being with feelings
 
Join Date: Sep 2018
Posts: 6
Default Naming

Hello!
I'm absolutely love this script, it's the main routing instrument for me.
I'm creating several busses in any project every time.

It would be incredibly handy if the script added the name of the receive track after "Mix Buss (drums - for example)"

I don't understand programming, so what do I need to add to the code?

Thanks!
tapemelancholy is offline   Reply With Quote
Old 07-15-2019, 07:12 AM   #13
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,269
Default

It would be a fair bit of work to modify these scripts for that, since you would need to specify a name for the mix bus first - otherwise all of your sends would just have "(Mix Bus)" after them which isn't very helpful.

However, I've just uploaded Lokasenna_Append selected track names with their first send destination to ReaPack. After creating a bus, rename it, then select the original tracks and run "Append selected track names..." to rename them.
Lokasenna is online now   Reply With Quote
Old 08-17-2019, 07:42 PM   #14
Joe90
Human being with feelings
 
Join Date: Aug 2019
Posts: 82
Default

Amazing script, thank you!
Joe90 is offline   Reply With Quote
Old 08-17-2019, 11:17 PM   #15
technogremlin
Human being with feelings
 
technogremlin's Avatar
 
Join Date: Mar 2008
Location: Netherlands
Posts: 2,585
Default

Ah, just what the doctor ordered. I'm about to change my last project to this setup (use a mix bus as master), mainly to have reference tracks in the project (for A-B'ing) that should not go through the master FX chain. Indeed I want to keep measurement stuff on the master so I can see how the reference tracks are measuring.

Maybe add this reason to use a mix bus to your list of reasons
technogremlin is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.