Selected Track (s) output & Color to the respective routing folder
Hi there,
I was wondering if there's a script which would automatically assign the Output and Color of tracks inside a routing folder to the same color, and correct input of that respective folder?
My goal with this macro is so when I'm prepping a session I can just drag the audio tracks into the correct routing folders (pre-existed in my template), and then run a script which would route all those audio tracks correctly in accordance with which routing folders they are in.
Thanks in advance!
Vic
- Chris Shaw @Chris_Shaw2021-06-21 22:53:28.111Z
You could create a track preset for each folder in your template that recalls the track color and routing for the tracks and then create a macro / script for each preset.
So if you have a folder called DRUMS in your template that's blue, you could create a DRUMS preset that just recalls the routing to that folder and the color. Make one for each folder then write a macro/script that recalls each preset.
This would be the simplest way to do it.
Vic Cuccia @viccucciamusic
Hey Chris,
I've been using this way however the "track preset" function ends up being quite buggy, and quite laggy to be honest, hence why I don't want to rely on recalling track presets.
- In reply toviccucciamusic⬆:Raphael Sepulveda @raphaelsepulveda2021-06-21 23:01:59.328Z
Hey Vic! I just recently updated my utilities package with a command that will do most of what you're looking for. It's called "Move to Existing Folder" and it has the option to also route the selected tracks to a folder's input.
What I suggest you do is create a macro that looks like this for every folder in your template:
First, use the SoundFlow command "Set Track/Clip Color" to set the color of the selected tracks. Then use my Move to Existing Folder command to move and route them to the desired folder.
Hope that helps!
Vic Cuccia @viccucciamusic
Hey Raphael,
Cool set of macros man, I'll give this one a shot. It's a bit different than what I'm trying to do but could work as well.
Thanks,
- Vic
- AIn reply toviccucciamusic⬆:Andrew Downes @Andrew_Downes
Is this the sort of thing you are after
Vic Cuccia @viccucciamusic
Appreciate your reply, Andrew! Unfortunately it’s not. As described above, I want to work with pre-set routing folders within my mix template. In other words, I’m trying to have a script which automatically identifies what routing folder the selected audio tracks are in and assigns the correct output/color to those tracks.
- In reply toviccucciamusic⬆:Chris Shaw @Chris_Shaw2021-06-22 20:35:50.566Z
Getting a track or Folder's color is not an easy thing to do but this script will assign the output of a folder's tracks to its input.
I haven't throughly tested it but it seems to work.
sf.ui.proTools.appActivate(); const app = sf.ui.proTools function getTrackType(trackName) { var trackInfo = sf.ui.proTools.trackGetByName({ name: trackName }).track; var trackTypeValue = trackInfo.title.value return trackTypeValue.slice(trackTypeValue.lastIndexOf(" - ") + 3, trackTypeValue.length).trim(); }; // Get selected tracks var originalSelectedTracks = app.selectedTrackNames; // Keep moving up one track until a Folder track is selected var trackType = " "; var isTrackFolder = false; while (!isTrackFolder) { sf.keyboard.press({ keys: 'p' }); var currentTrack = app.selectedTrackNames[0]; trackType = getTrackType(currentTrack); if (trackType == "Routing Folder Track") { isTrackFolder = true } }; // get Input bus of folder track var folderInput = app.selectedTrack.groups.whoseTitle.is("Audio IO").first.popupButtons.first.value.invalidate().value; // Reselect original selected tracks app.invalidate(); app.trackSelectByName({ names: originalSelectedTracks, deselectOthers: true }); // Assign original selected track's output to Folder track input app.selectedTrack.groups.whoseTitle.is("Audio IO").whoseTitle.is("Audio IO").first.popupButtons.allItems[1].popupMenuSelect({ isShift: true, isOption: true, menuPath: ["search..."], }); sf.keyboard.type({ text: folderInput, }); sf.keyboard.press({ keys: 'return' });
Vic Cuccia @viccucciamusic
Amazing, Chris, thank you for your time! I feel as though perhaps we got something backwards: it should assign the INPUT of the folder track to the audio tracks inside it (:
Let me know if that's an easy fix/doable! And no worries about coloring, I can live without it!
Thanks in advance,
VicChris Shaw @Chris_Shaw2021-06-22 20:50:45.136Z
Hmm that's not how the request was worded:
assign the Output and Color of tracks inside a routing folder to the same color, and correct input of that respective folder?
I'll see if I can change it though. It will use the output of the first selected track in a folder to set the output of the folder.
Chris Shaw @Chris_Shaw2021-06-22 21:02:27.306Z2021-06-22 21:17:37.691Z
Try this:
sf.ui.proTools.appActivate(); const app = sf.ui.proTools function getTrackType(trackName) { var trackInfo = sf.ui.proTools.trackGetByName({ name: trackName }).track; var trackTypeValue = trackInfo.title.value return trackTypeValue.slice(trackTypeValue.lastIndexOf(" - ") + 3, trackTypeValue.length).trim(); }; // Get selected tracks var originalSelectedTracks = app.selectedTrackNames; // Get first visible track var firstVisibleTrack = app.visibleTrackNames[0] // Get first track's output var memberOutput = app.selectedTrack.groups.whoseTitle.is("Audio IO").whoseTitle.is("Audio IO").first.popupButtons.allItems[1].value.invalidate().value // keep moving up one track until a Folder track is selected var trackType = " "; var isTrackFolder = false while (!isTrackFolder) { sf.keyboard.press({ keys: 'p' }); var currentTrack = app.selectedTrackNames[0]; trackType = getTrackType(currentTrack); if (trackType == "Routing Folder Track") { isTrackFolder = true; var folderName = currentTrack }; if (currentTrack == firstVisibleTrack) { throw ("You seemed to have selected tracks that are outside of a folder. Try again") }; }; // get Input bus of folder track var folderInput = app.selectedTrack.groups.whoseTitle.is("Audio IO").first.popupButtons.first.value.invalidate().value; // Reselect original selected tracks app.invalidate(); app.trackSelectByName({ names: originalSelectedTracks, deselectOthers: true }); // Assign original track's output to Folder track input app.selectedTrack.groups.whoseTitle.is("Audio IO").whoseTitle.is("Audio IO").first.popupButtons.allItems[1].popupMenuSelect({ isShift: true, isOption: true, menuPath: ["search..."], }); sf.keyboard.type({ text: folderInput, }); sf.keyboard.press({ keys: 'return' }); // select Folder Track and set track Output app.trackSelectByName({ names: [folderName] }) app.selectedTrack.groups.whoseTitle.is("Audio IO").whoseTitle.is("Audio IO").first.popupButtons.allItems[1].popupMenuSelect({ isShift: true, isOption: true, menuPath: ["search..."], }); sf.keyboard.type({ text: memberOutput, }); sf.wait({ intervalMs: 200 }) sf.keyboard.press({ keys: 'return' });
- In reply toChris_Shaw⬆:
Vic Cuccia @viccucciamusic
I'd say "assign the output [...] of tracks inside a routing folder to the same [...] correct input of that respective folder" sounds the same to me as "assign the INPUT of the folder track to the audio tracks inside it", meaning the OUTPUT of those audio tracks (which are inside the routing folder) would match the respective routing folder's INPUT. This would then ensure they are routed to that respective routing folder. I know it sounds confusing so no big deal at all (:
Perhaps I'm not wording it the best way, as I can see the one you just made is now Output to Output, which would result in the audio tracks NOT being routed to the routing folder.
No pressure at all if it's weird to make this work, I can always manually assign each routing folder if needed be.
Chris Shaw @Chris_Shaw2021-06-23 00:24:03.153Z
The first script assumes that the folder is set up properly before putting anything in it - it has an assigned input and output. So when you throw some tracks into the folder and run the script it will route the output of those tracks to to the input of the folder track.
The second script assumes that you have some tracks who’s output you want to keep but you’d want to process them all via a folder track while retaining the enclosed tracks output (essentially routing the tracks through the folder without changing the destination of the original tracks). So you put the tracks in the folder and the script will route the tracks to the input of the folder and set the output of that folder to the original output of the tracks.
The only other variation left is you want to put some tracks in a folder without changing their routing and use the enclosed tracks’ output as the input to the folder. So the only thing that gets changed is the folder track’s input. Right?
Chris Shaw @Chris_Shaw2021-06-23 00:47:06.049Z
sf.ui.proTools.appActivate(); const app = sf.ui.proTools function getTrackType(trackName) { var trackInfo = sf.ui.proTools.trackGetByName({ name: trackName }).track; var trackTypeValue = trackInfo.title.value return trackTypeValue.slice(trackTypeValue.lastIndexOf(" - ") + 3, trackTypeValue.length).trim(); }; // Get selected tracks var originalSelectedTracks = app.selectedTrackNames; // Get first visible track var firstVisibleTrack = app.visibleTrackNames[0] // Get first track's output var memberOutput = app.selectedTrack.groups.whoseTitle.is("Audio IO").whoseTitle.is("Audio IO").first.popupButtons.allItems[1].value.invalidate().value // keep moving up one track until a Folder track is selected var trackType = " "; var isTrackFolder = false while (!isTrackFolder) { sf.keyboard.press({ keys: 'p' }); var currentTrack = app.selectedTrackNames[0]; trackType = getTrackType(currentTrack); if (trackType == "Routing Folder Track") { isTrackFolder = true; var folderName = currentTrack }; if (currentTrack == firstVisibleTrack) { throw ("You seemed to have selected tracks that are outside of a folder. Try again") }; }; // Assign folder input to member track's output app.selectedTrack.groups.whoseTitle.is("Audio IO").whoseTitle.is("Audio IO").first.popupButtons.first.popupMenuSelect({ isShift: true, isOption: true, menuPath: ["search..."], }); sf.keyboard.type({ text: memberOutput, }); sf.keyboard.press({ keys: 'return' });
- In reply toChris_Shaw⬆:
Vic Cuccia @viccucciamusic
Ah gotcha, perhaps there was some misunderstanding/misexplanation on the first script. I'll most definitely try it out the next couple days and report back to you, Chris. Thanks a ton!!
- In reply toChris_Shaw⬆:PPhilip weinrobe @Philip_weinrobe
this was working until yesterday for me. perhaps a pro tools 2022.4 issue? does this still work on for others?
issue is at reselecting original selected tracks. i'm getting an SF error because the script is failing to reselect the originally selected tracks....
30.04.2022 18:18:21.36 [Backend]: !! Command Error: Selected Tracks Output to Routing Folder Input [user:default:cl1ct39zw00095810u139g41s]:
No track selected (in Track List View)
Consider turning on Link Edit and Track Selection (Selected Tracks Output to Routing Folder Input: Line 66)Chris Shaw @Chris_Shaw2022-04-30 22:35:15.529Z
Be sure that you're running the latest version of SF (5.1.3)
You may need to download and install it manually.
2022.4 changed the way folders are named internally. SF 5.1.0 and above addresses this issue.- PPhilip weinrobe @Philip_weinrobe
i'm on 5.1.2
gonna update to 5.1.3 to see if it fixes it...will report back - In reply toChris_Shaw⬆:PPhilip weinrobe @Philip_weinrobe
same error on 5.1.3
30.04.2022 18:43:12.50 [Backend]: !! Command Error: Selected Tracks Output to Routing Folder Input [user:default:cl1ct39zw00095810u139g41s]:
No track selected (in Track List View)
Consider turning on Link Edit and Track Selection (Selected Tracks Output to Routing Folder Input: Line 66) - In reply toChris_Shaw⬆:
Kitch Membery @Kitch2022-05-02 19:52:51.547Z
Hi Chris,
Possible fix for this script here.
Rock on!
- PPhilip weinrobe @Philip_weinrobe
this works PERFECT. i'll work this into my larger script now. thanks Kitch!
- In reply toviccucciamusic⬆:Chris Shaw @Chris_Shaw2021-06-23 00:59:15.200Z
I think the confusion here is defining what changes. Do you want to change the output of the tracks to match the folder input or do you want to change the folder input to match the tracks' output?
Chris Shaw @Chris_Shaw2021-06-23 01:01:24.325Z
The first script changes the track outputs, the third script changes the folder input.
Vic Cuccia @viccucciamusic
First script worked BEAUTIFULLY! Thanks a ton, Chris! You're a legend!!
Chris Shaw @Chris_Shaw2021-06-26 02:06:04.264Z
👍
- In reply toChris_Shaw⬆:
Vic Cuccia @viccucciamusic
Exactly. I want to change the OUTPUT of the tracks (inside the folder) to match the folder input as you described (:
- In reply toChris_Shaw⬆:MMarco Ravelli @Marco_Ravelli
Hello everyone! Sorry I know this is an old thread... I am trying to do the same thing, but the first script you posted is not working for me... I'm sorry I'm not at all an expert, do you have any idea of what the problem could be? Thank you very very much in advance :) :)
Chris Shaw @Chris_Shaw2022-01-28 16:44:20.174Z
If you look through the thread I made updates later on. Try the third script