After creating Aux sends, how to set volume to 0 db?
Hello,
Is there a piece of code I can add to the Create aux sends macro so that it sets all the newly created sends to 0db? And another piece of code that can turn on Send pan follows main for all newly created sends?
- samuel henriques @samuel_henriques
Hello @Michael_Hartung,
this should do it,
const outWin = sf.ui.proTools.mainTrackOutputWindow outWin.mouseClickElement({ relativePosition: { "x": 32, "y": 402 }, isShift: true, isOption: true, }); outWin.buttons.whoseTitle.is("Link Panner to Main").first.mouseClickElement({ isShift: true, isOption: true });
- MMichael Hartung @Michael_Hartung
Thanks for putting this together Samuel! Unfotunately, I'm having trouble with the code. When I run it it's giving me this error:
17.09.2021 00:01:12.18 [Backend]: Could not get UIElement for AxPtMainTrackOutputWindow: Could not find floating window for track output
Logging error in action (01) MouseClickElementAction: MouseClickAction requires valid UIElement17.09.2021 00:01:12.18 [Backend]: !! Command Error: Send to Fatso Fader 0db Follow pan script [user:cktd1fxit0000j010jivmxqgm:cktngx8em0002w610xbi5nxys]:
MouseClickAction requires valid UIElement (Send to Fatso Fader 0db Follow pan script: Line 11)
Could not find floating window for track output (AxPtMainTrackOutputWindow)<< Command: Send to Fatso Fader 0db Follow pan script [user:cktd1fxit0000j010jivmxqgm:cktngx8em0002w610xbi5nxys]
17.09.2021 00:01:44.100 [Backend]: [SF_FIREBASE_WS]: Sending keep-alive
Thoughts on what I can do to fix it?
Thanks again, really appreciate it.
- In reply toMichael_Hartung⬆:Chris Shaw @Chris_Shaw2021-09-16 21:49:33.286Z
I believe there's a preference in PT to default all newly created sends to 0 if that's something you want all of the time.
- MMichael Hartung @Michael_Hartung
Hi Chris!
Thanks for the input! I am aware of the preference, but it's not right for my workflow. However, the task for a set of sends that I send to a parallel compressor, I woudl like the basic fader balance to be the same that is sent to the parallel; post fader, but also panning exactly like it is on the large faders. Setting the fader to 0db in this scenario is perfect for what I would like to do.samuel henriques @samuel_henriques
With the script I posted, I was presuming the aux send was just created, and the track/tracks you created the send on are still selected and the send for the first track is still opened. Maybe I missed something.
Could you share what is the script/macro you are using to create the aux?
- MMichael Hartung @Michael_Hartung
Hi Samuel!
Sure, here's the script I was using. Note, I just copied your few lines of code at the end to see if it worked.sf.ui.proTools.selectedTrack.trackInsertOrSendSelect({ insertOrSend: "Send", pluginNumber: 7, pluginPath: ["bus","bus menu 1-128","Fatso (Stereo)"], selectForAllSelectedTracks: true, }); const outWin = sf.ui.proTools.mainTrackOutputWindow outWin.mouseClickElement({ relativePosition: { "x": 32, "y": 402 }, isShift: true, isOption: true, }); outWin.buttons.whoseTitle.is("Link Panner to Main").first.mouseClickElement({ isShift: true, isOption: true });
- MMichael Hartung @Michael_Hartung
Hi again Samuel!
Just to clarify... My hope is that the script would create the new sends based on the first part of the script, and then set the values of the send and panning follow main setting (Panning follows main is not that important really).samuel henriques @samuel_henriques
Hello Michael.
Of course I forgot something, need to wait for the window to show up.here you go:
sf.ui.proTools.selectedTrack.trackInsertOrSendSelect({ insertOrSend: "Send", pluginNumber: 7, pluginPath: ["bus","bus menu 1-128","Fatso (Stereo)"], selectForAllSelectedTracks: true, }); const outWin = sf.ui.proTools.mainTrackOutputWindow.elementWaitFor().element outWin.mouseClickElement({ relativePosition: { "x": 32, "y": -156 }, anchor:"BottomLeft", isShift: true, isOption: true, }); outWin.buttons.whoseTitle.is("Link Panner to Main").first.mouseClickElement({ isShift: true, isOption: true });
- MMichael Hartung @Michael_Hartung
@samuel_henriques That works!! Thank you! :-)
Just for programming ideas, is it a lot of work to program the script to set a value other than 0db, -6db for example?
samuel henriques @samuel_henriques
Hello o Michael,
Great to know it's working,
Here's a version you can choose from a set of volumes to set or choose a custom volume.
You can add delete from the set here:let volume = chooseAnOption(["6", "3", "0", "-3", "-6", "-12", "-20", "-∞", "Custom", "Cancel"])
Choose your options here:
//////// CHOOSE YOUR OPTIONS ////////////////// const sendNumber = 7 const sendPath = ["bus", "bus menu 1-128", "Fatso (Stereo)"]
Here's the script:
/** * @param {number} sendNumber * @param {string} volume */ function setVolume(sendNumber, volume) { sf.ui.proTools.appActivateMainWindow() // If send is closed, open. if (sf.ui.proTools.selectedTrack.sendSelectorButtons[sendNumber - 1].value.invalidate().value === "") { sf.ui.proTools.selectedTrack.trackSendToggleShow({ sendNumber: sendNumber, }); } let value volume === "-∞" ? value = "-150" : value = volume const sendWinVolume = sf.ui.proTools.floatingWindows[0].textFields.whoseTitle.is('Volume Numerical').first.elementWaitFor().element sendWinVolume.elementClick(); sf.keyboard.type({ text: value }); sf.keyboard.press({ keys: 'enter' }); } /** * @param {array} item */ function chooseAnOption(item) { let promptWin = sf.interaction.popupSearch({ items: item.map(x => ({ name: x })) }).item.name return promptWin } function getCustomValue() { let value = "" value = prompt("Type a value between +12 and -150") // if you cancel the prompt, stop the script if (value == undefined) throw 0 // if value not a number call function again if (isNaN(+value.replace(/[,]/g, '.').trim())) return getCustomValue() // else return volume as string return value.replace(/[,]/g, '.').trim() } ///////////////////////////////////////////////////////////////////////////////////////////////////////// sf.ui.proTools.appActivateMainWindow() sf.ui.proTools.invalidate() //////// CHOOSE YOUR OPTIONS ////////////////// const sendNumber = 6 const sendPath = ["bus", "bus menu 1-128", "Bus 33-34 (Stereo)"] //////////////////////////////////////////////////////// // Predefined Volume Options let volume = chooseAnOption(["6", "3", "0", "-3", "-6", "-12", "-20", "-∞", "Custom", "Cancel"]) // If Cancel, stop script if (volume === "Cancel") { throw 0 } // If custom, prompt to type // Only number is accepted if (volume === "Custom") { volume = getCustomValue() } /// Open sends on all selected tracks sf.ui.proTools.selectedTrack.trackInsertOrSendSelect({ insertOrSend: "Send", pluginNumber: sendNumber, pluginPath: sendPath, selectForAllSelectedTracks: true, }, "Path Not Found, check name spelling."); const outWin = sf.ui.proTools.mainTrackOutputWindow.elementWaitFor().element const panLinkBtn = outWin.buttons.whoseTitle.is("Link Panner to Main").first let isPanLinkEnabled = panLinkBtn.value.invalidate().value === "Selected"; // If Pan link is not Enabled, Enable if (!isPanLinkEnabled) { panLinkBtn.mouseClickElement({ isShift: true, isOption: true }); } //Get selected tracks const originalTracks = sf.ui.proTools.selectedTrackNames; //Do for each track. sf.ui.proTools.selectedTracks.trackHeaders.slice().map(track => { //Select track track.trackSelect(); //Scroll track into View track.trackScrollToView(); // Set volume setVolume(sendNumber, volume) }); //Restore previously selected tracks sf.ui.proTools.trackSelectByName({ names: originalTracks });
Hope it works for you