From a chat: @Jens_Johansson
Jens - moving your chat here to the regular forum :)
Hi!
Is there any way to modify the AA Post script so I can set the sidechain input to a specific channel?
Also, if the plugin would close automatically after processing it would be nice :)
All the best // Jens
- Christian Scheuer @chrscheuer2019-09-13 20:34:38.554Z
Hi Jens!
Thanks for posting this idea - that could definitely be possible.
Can I get you to post the AA Post script that you're referring to here, then I'd be happy to augment it. - JIn reply tochrscheuer⬆:Jens Johansson @Jens_Johansson
Here's what I came up with after some copy/pasting from other scripts. Works for selecting the right sidechain input.
But if I align a large number of clips at the same time the closing of AA Post window doesn't work.
Is there a way to make the code for closing the window wait until the processing is finished?//Open the plugin and save the plugin window to the "asWin" variable
var asWin = sf.ui.proTools.audioSuiteOpenPlugin({
category: 'Other',
name: "Auto-Align Post"
}).window;//Set processing options
asWin.audioSuiteSetOptions({
processingInputMode: "ClipByClip",
processingOutputMode: "CreateIndividualFiles"
});// Select Sidechain Track
var keyInputName = 'D1 Boom';
sf.ui.proTools.appActivate();var asWin = sf.ui.proTools.getAudioSuiteWindow("Auto-Align Post");
asWin.elementRaise();var keyInputBtn = sf.ui.proTools.firstAudioSuiteWindow.invalidate().popupButtons.whoseTitle.is('Key Input').first;
keyInputBtn.popupMenuSelect({
menuPath: [keyInputName]
});// Render Audiosuite
sf.ui.proTools.audioSuiteRenderCurrent();// Wait
// Close Plugin Window
asWin.windowClose(); - NIn reply tochrscheuer⬆:N Leyers @NickLeyers_old_acc
Hi Jens
I use this code to set the sidechain to any track my selection is on. Got a key for that. Processing i something I do with another key and script because that gives me more possibilities( in my workflow). I got a seperate screen where I keep a lot of audiosuites open for fast processing. Protools is to slow to wait for opening and closing these plugins all the time :-)
//Get first track from selection
var name = sf.ui.proTools.selectedTrackNames[0];//Focus AAP
var asWin = sf.ui.proTools.getAudioSuiteWindow("Auto-Align Post");
asWin.elementRaise();//Set Key input
sf.ui.proTools.appActivate();
var keyInputBtn = sf.ui.proTools.firstAudioSuiteWindow.invalidate().popupButtons.whoseTitle.is('Key Input').first;
keyInputBtn.popupMenuSelect({
menuPath: [name]
});PS: I forgot how to put the code in a 'code box' in this forum.... Tips? :-)
- JJens Johansson @Jens_Johansson
Thanks Nick will try that out.
I also keep plugins open on a second screen but just the ones I look at during mix.
AA Post is a "render and forget" type of plugin for me :) So if the window would close after
rendering it would be awesome.- NN Leyers @NickLeyers_old_acc
Sure, got some plugins that will open and close as well.
For waiting I use this://Wait for window to complete
sf.wait({intervalMs: 500});And make the 500 longer depending on how long it will take more or less.
But I think it's also possible (and better) to wait for the action to complete. This was a possibility but I'm not sure if it is functional?...
sf.ui.proTools.waitForNoModals();
Or you can write and if-loop who checks if there is a window that is named 'processing'. Like every 200mS. But that's a lot of code for a small action...
Christian Scheuer @chrscheuer2019-09-17 14:47:31.960Z
The wait for no modals works yes for rendering audiosuite plugins.
But if you get access to the window via thegetAudioSuiteWindow
action, then you can also make use of theaudioSuiteRender
action, which will take care of waiting for you.So for example you can do this:
var asWin = sf.ui.proTools.getAudioSuiteWindow("Auto-Align Post"); asWin.audioSuiteRender(); asWin.windowClose();
- JJens Johansson @Jens_Johansson
Works like a dream! Thanks Christian!
Dario Ramaglia @dario.ramaglia
I use this script so I can choose the sidechain on the StreamDeck.
You can change the colors of course and I also included a "Name-Shortener" :)//Focus AAP var asWin = sf.ui.proTools.getAudioSuiteWindow("Auto-Align Post"); asWin.elementRaise(); //Select SideChain var trackNames = ['Boom1', 'Boom2', 'Boom3', 'Boom4', 'Boom5', 'Radio1', 'Radio2', 'Radio3', 'Radio4', 'Radio5','Adr Sync B']; ///Title Shortener function shortenTitle(s) { var res = '', i = 0; while (s.length > 0 && i < 3) { if (i > 0) res += '\n'; res += s.substring(0, 8); s = s.substring(8); i++; } return res; } ///Assing Colors var selectedName = sf.devices.streamDeck.firstDevice.showModal({ items: trackNames.map(function (name, i) { var color; if (name.indexOf('Boom') >= 0) color = { r: 74, g: 0, b: 106 }; else if (name.indexOf('Radio') >= 0) color = { r: 22, g: 100, b: 106 }; else if (name.indexOf('Adr Sync B') >= 0) color = { r: 142, g: 15, b: 8 }; return { title: shortenTitle(name), value: name, color: color }; }) }).selectedItem.value; /// Select the Key Input sf.ui.proTools.appActivate(); var keyInputBtn = sf.ui.proTools.firstAudioSuiteWindow.invalidate().popupButtons.whoseTitle.is('Key Input').first; keyInputBtn.popupMenuSelect({ menuPath: [selectedName] }); ///Analyze asWin.getFirstWithTitle("Analyze").elementClick(); ///Wait till analyze done sf.ui.proTools.waitForNoModals(); //Render asWin.audioSuiteRender();
- JJens Johansson @Jens_Johansson
Wow looks really nice! Thanks Dario!