Old 07-31-2016, 07:36 AM   #1
Mercado_Negro
Moderator
 
Mercado_Negro's Avatar
 
Join Date: Aug 2007
Location: Caracas, Venezuela
Posts: 8,686
Default Create tracks with sends from selected tracks

Hi folks, I've been looking for a while for an action or script to create new tracks with sends from selected tracks but apparently there's no such thing. Spk77 created something like that a while ago but unfortunately it's not lua/eel.

This script (or action) would just basically create new tracks with sends from selected tracks for reverb/delay duties (what most people call aux tracks). Ideally it would show a dialog with a few options:

A) name as source track or use new name

B) add prefix AND suffix (so we can add useful letters to it like RVB or DLY)

C) choose location (next to tracks or at the end of the TCP/MCP)

D) send type (pre, post, etc).

E) load template (so we can choose track templates when creating these new tracks)

If some of you smart script coding guys had something like that in your drawers I'd truly appreciate it. Bear in mind, I'm not asking anyone to code this because I can't pay for it (not because a lack of money, it's just my country and a stupid regulation with dollars) so please don't jump into this. I'm just asking in case someone coded something like this and have it for himself and of course is willing to share it in public.

Thanks!
__________________
Pressure is what turns coal into diamonds - Michael a.k.a. Runaway
Mercado_Negro is offline   Reply With Quote
Old 07-31-2016, 12:08 PM   #2
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,218
Default

Although I'm sure there was something like that recently (but can't recall where).

There's also the SWS cue buss creation action "thingy"

It was made for headphone mixes but it can do all the things you want here from what I recall

Let me know if you need an actual action name as I'm not near reaper now and have forgot but can get it later
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 07-31-2016, 02:22 PM   #3
Mercado_Negro
Moderator
 
Mercado_Negro's Avatar
 
Join Date: Aug 2007
Location: Caracas, Venezuela
Posts: 8,686
Default

Quote:
Originally Posted by musicbynumbers View Post
Although I'm sure there was something like that recently (but can't recall where).

There's also the SWS cue buss creation action "thingy"

It was made for headphone mixes but it can do all the things you want here from what I recall

Let me know if you need an actual action name as I'm not near reaper now and have forgot but can get it later
Hey MBN, yeah the Cue Buss actions were the first thing I thought about when I was looking for something like this. The problem is I can't select a bunch of tracks and make one send track for each. I can't make them have the name of the source track either (and prefixes/suffixes would be of trmendous help as well). It works but it's too limited for what I'm looking for. Anyways, thanks for pointing it out.
__________________
Pressure is what turns coal into diamonds - Michael a.k.a. Runaway
Mercado_Negro is offline   Reply With Quote
Old 08-01-2016, 08:51 AM   #4
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,218
Default

Ah, I see what you mean now.

Im sure someone had created scripts for something like this at some point in the past. I'll have a look at my script folder.
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 08-01-2016, 09:45 AM   #5
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

This is how it could work

(There's no GUI/dialog etc. This is just a quick test - try to change the settings to see how it works)

Code:
function create_send_tracks()
  local sel_tr_count = reaper.CountSelectedTracks(0)
  if sel_tr_count == 0 then
    return
  end
  
  -- These settings would be shown in a dialog----------------------------
  local tr_color = 383237
  local r, g, b = reaper.ColorFromNative(tr_color)
  local prefix = "PF"               -- if empty string -> don't add prefix
  local suffix = ""                 -- if empty string -> don't add suffix
  local send_track_name = ""        -- if empty -> use source track's name
  local fx_name = "ReaDelay"        -- if empty string -> don't insert FX
  local add_to_end = false          -- if true -> add send track next to source track
  local send_mode = 1               -- 0=post-fader, 1=pre-fx, 2=post-fx (deprecated), 3=post-fx
  ------------------------------------------------------------------------
  
  reaper.Undo_BeginBlock()
  reaper.PreventUIRefresh(1)
  for i=1, sel_tr_count do
    local source_tr = reaper.GetSelectedTrack(0, i-1)
    local source_tr_number=reaper.CSurf_TrackToID(source_tr, false)
    if add_to_end then
      source_tr_number = reaper.CountTracks(0)
    end  
    reaper.InsertTrackAtIndex(source_tr_number, true)
    local ret, source_tr_name = reaper.GetSetMediaTrackInfo_String(source_tr, "P_NAME", "", false)
    if send_track_name ~= "" then
      source_tr_name = send_track_name
    end
    
    
    local dest_tr = reaper.GetTrack(0, source_tr_number)
    reaper.SetTrackColor(dest_tr, reaper.ColorToNative(r,g,b))
    if fx_name ~= "" then
      reaper.TrackFX_AddByName(dest_tr, fx_name, false, -1)
    end
    local retval, name = reaper.GetSetMediaTrackInfo_String(dest_tr, "P_NAME", prefix .. " " .. source_tr_name .. " " .. suffix, true)
    local send_index = reaper.CreateTrackSend(source_tr, dest_tr)
    reaper.SetTrackSendInfo_Value(dest_tr, -1, send_index, "I_SENDMODE", send_mode) -- 1 = pre-fx
  end
  reaper.PreventUIRefresh(-1)
  reaper.Undo_EndBlock("Create send track(s)", -1)
end

create_send_tracks()


Last edited by spk77; 08-01-2016 at 09:58 AM.
spk77 is offline   Reply With Quote
Old 08-01-2016, 11:37 AM   #6
Mercado_Negro
Moderator
 
Mercado_Negro's Avatar
 
Join Date: Aug 2007
Location: Caracas, Venezuela
Posts: 8,686
Default

Whoa! That script is really great, spk77! Thank you very much, sir. You're really kind

It works great here, tried different combinations and what it does now it's doing it flawlessly. Solid code what you have there.

Is there something I can do to make send tracks have their sources colors? It would be really nice if it worked like the name (if empty, use source's color).

How can I make send tracks color-less? I guess people using colors for specific tracks with the Auto color/icon feature in SWS could really enjoy having their tracks colored automatically (maybe there's a way now in the script, I don't know).

If I may request a few things please:

a) Ability to load track templates

2) Ability to add more than 1 send and choose channels. Let me give you an example of this: most of my delays are ducked, i.e., I have a ReaComp right after my preferred delay (echoboy) set to 3/4 for sidechaining purposes so I always have to do two sends, one via 1/2 and one via 3/4.

Again, thank you very much for your kindness, spk77. You've really made my work more fun with this script (and of course, my other favorite script: manipulate take volume envelope).

Have a beautiful day!
__________________
Pressure is what turns coal into diamonds - Michael a.k.a. Runaway
Mercado_Negro is offline   Reply With Quote
Old 08-21-2016, 07:10 AM   #7
Mercado_Negro
Moderator
 
Mercado_Negro's Avatar
 
Join Date: Aug 2007
Location: Caracas, Venezuela
Posts: 8,686
Default

spk77, how can I make send tracks have no color? I've been working with the script as is but since I'm using the auto color/icon feature I'd prefer if send tracks had no color at all to begin with.
__________________
Pressure is what turns coal into diamonds - Michael a.k.a. Runaway
Mercado_Negro 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 04:12 PM.


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