Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
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,551
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".
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate

Last edited by Lokasenna; 08-06-2017 at 03:32 PM.
Lokasenna is offline   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: 7,417
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 online now   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,551
Default

I keep forgetting about it until halfway through a track and then I don't feel like doing it anymore. :P
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   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: 3,978
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,551
Default

I can look at adding multichannel support, sure.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   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: 373
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: 240
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,551
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.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 01-09-2018, 11:51 AM   #10
DynamicK
Human being with feelings
 
Join Date: Nov 2017
Location: Gloucestershire, UK
Posts: 223
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,551
Default

Small update - sends will now override the defaults to be at unity gain, post-fader.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 07-15-2019, 05:23 AM   #12
tapemelancholy
Human being with feelings
 
Join Date: Sep 2018
Posts: 92
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,551
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.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 08-17-2019, 07:42 PM   #14
Joe90
Human being with feelings
 
Join Date: Aug 2019
Posts: 853
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,629
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
Old 12-31-2019, 12:12 PM   #16
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
Default

handy script, thank you kindly
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi is offline   Reply With Quote
Old 12-31-2019, 01:35 PM   #17
SubbaseDnB
Human being with feelings
 
Join Date: May 2017
Posts: 454
Default

this i have to try when i get home in the studio
SubbaseDnB is offline   Reply With Quote
Old 01-01-2020, 05:06 AM   #18
SubbaseDnB
Human being with feelings
 
Join Date: May 2017
Posts: 454
Default

Quote:
Originally Posted by akademie View Post
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
was just going to post about adding a colour to busses
SubbaseDnB is offline   Reply With Quote
Old 01-10-2022, 09:05 AM   #19
K51
Human being with feelings
 
Join Date: Jul 2013
Posts: 2
Default

Is it possible to add a BUS not as the first but as the last track?
Yesterday I saw the Current Track option in FL Studio and found the 'Monitor selected track with track 1' script that enables this by using Track1 for this.
K51 is offline   Reply With Quote
Old 04-05-2022, 06:38 PM   #20
alonzo
Human being with feelings
 
Join Date: Jun 2013
Posts: 25
Default

Quote:
Originally Posted by K51 View Post
Is it possible to add a BUS not as the first but as the last track?
Yesterday I saw the Current Track option in FL Studio and found the 'Monitor selected track with track 1' script that enables this by using Track1 for this.

+1

Adding a mixbus as a last track would be highly beneficial for me, since I prefer my buses to be at the bottom of the arrangement, and on the right on the mixer
alonzo is offline   Reply With Quote
Old 01-31-2024, 08:11 PM   #21
timmdrumm
Human being with feelings
 
Join Date: Mar 2016
Posts: 4
Default Ever find a way to do this?

Quote:
Originally Posted by alonzo View Post
+1

Adding a mixbus as a last track would be highly beneficial for me, since I prefer my buses to be at the bottom of the arrangement, and on the right on the mixer
Wondering if you ever found a way to pull this off? I'm not up on scripting for Reaper, but I'm javascript capable, so I can read the code, just not sure how to modify to make the Mix Bus track be on the right side.
timmdrumm is offline   Reply With Quote
Old 02-01-2024, 03:43 AM   #22
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,596
Default

Easiest way would be just to move it to last track after everything is done:

Code:
 mixbuss_track = reaper.GetTrack(0,0)
 reaper.SetTrackSelected( mixbuss_track , true )
 reaper.ReorderSelectedTracks(  reaper.CountTracks(0), 0)
Sexan 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 02:47 PM.


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