Nudge settings
Is there a way to change both the Activity/Ruler setting while also changing the nudge value? I would like to be able to nudge in both seconds and frames without having to change the Activity with my mouse in the Nudge dropdown.
Alternatively is there a macro to change the Activity Ruler (I know PT doesn't have a kb shorcut) as this would then default to bar/second/frame using 1 & 2 on the numerical keypad?
Any info would be great
John
- samuel henriques @samuel_henriques
this should do it, if I understood properly what you asked for.
let me know:
/** * @param {"Bars|Beats"|"Min:Secs"|"Timecode"|"Feet+Frames"|"Samples"} timeScale */ function setNudge(timeScale, value){ sf.ui.proTools.mainWindow.groups.whoseTitle.is("Grid/Nudge Cluster").first.popupButtons.whoseTitle.is("Nudge value").first.popupMenuSelect({ menuPath: [timeScale], }); sf.ui.proTools.nudgeSet({ value: value }) } // Change Nudge Here // Time Scale Nudge value setNudge("Timecode", "00:00:01:00")
If you would like to have a toggle between a few settings, let me know what they are.
- JJohn McPhillips @John_McPhillips
Thanks Samuel - I've copied this into a newly created script and dragged it into a Stream Deck button but it's not working. Maybe I haven't pasted/formatted the script in properly. Sorry, I know little to nothing about script.....
samuel henriques @samuel_henriques
that's cool.
what doesn't work?
as it's written, it should set nudge to 1 frame.
does i work by itself?
samuel henriques @samuel_henriques
if you press run command on soundFlow, does it work?
the nudge area must be visible.
- JJohn McPhillips @John_McPhillips
Hi Samuel - it says "could not open popup menu"
Here's what I did - I copied all the script from your message, created a new script clicking the blue "+" button in editor and pasted in your script into the first line 1) on the right hand panel.
samuel henriques @samuel_henriques
can you see this when you press the command?
- JJohn McPhillips @John_McPhillips
No, it stays at the previous setting (Samples)
samuel henriques @samuel_henriques
to change these values, the area needs to be visible
are you using the mix window and want to change the nudge?
samuel henriques @samuel_henriques
here's a version that you don't see the popup if you are changing value of the same time scale.
// get current time scale function getTimeScale(value) { let timeScale /// Bars Beats . if (value.includes("|")) timeScale = "Bars|Beats" // Min Secs . else if (value.split(":").length == 2 && value.includes(".")) timeScale = "Min:Secs" // Time code else if (value.split(":").length == 4) timeScale = "Timecode" // Feet+Frames else if (value.includes("+")) timeScale = "Feet+Frames" // Samples. else timeScale = "Samples" return timeScale } function setNudge(value) { const curentNudgeValue = sf.ui.proTools.mainWindow.groups.whoseTitle.is("Grid/Nudge Cluster").first.textFields.first.value.invalidate().value const userTimeScale = getTimeScale(value) const currentTimeScale = getTimeScale(curentNudgeValue) if (currentTimeScale != userTimeScale) { sf.ui.proTools.mainWindow.groups.whoseTitle.is("Grid/Nudge Cluster").first.popupButtons.whoseTitle.is("Nudge value").first.popupMenuSelect({ menuPath: [userTimeScale], }); } sf.ui.proTools.nudgeSet({ value: value }) } sf.ui.proTools.appActivateMainWindow() sf.ui.proTools.menuClick({ menuPath: ['Window', 'Edit'] }); // nudge value exactly as writen in pro tools setNudge("00:00:00:01.00")
- JJohn McPhillips @John_McPhillips
Thanks, no, I was using the Edit window. I've tried that last one you sent and I get an error message saying "Parent's UI Element was null - Line 21"
John
samuel henriques @samuel_henriques
Just updated another version.
Could you test it please.
And test as well by running from the soundFlow editor?samuel henriques @samuel_henriques
From your descriptions, it seams the nudge area could be behind something, but if you can see it I'm not sure what it could be.
samuel henriques @samuel_henriques
Hello John,
Any luck with this?
- JJohn McPhillips @John_McPhillips
Hi Samuel - I'm still getting "Parent's UI Element was null"... I've tried running from the editor and from stream deck with the Edit window open and in view.
I wouldn't worry about it, I was just trying to avoid a click but I can live with it!
Thanks again for the help.
John
samuel henriques @samuel_henriques
very weird, it would be good to figure it out though, for future scripts.
@Kitch, could you check this out, please?
- In reply tosamuel_henriques⬆:
samuel henriques @samuel_henriques
@Davide_Docente did you figure how to do the min:sec nudge?
I can't see it anymore. I was trying to figure this, min:sec doesn't work like the others for custom value. But can't see your post anymore.
In the mean time I'm not sure if there are built in macros for this. And if you can live with what is available in the pro tools popup, it's easier to code.samuel henriques @samuel_henriques
Hers's a version that will work with min:sec.
It's manual labour for sf, but thats what I managed so far.function setMinSecNudge(value) { const clickCustomNudgeArea = () => sf.ui.proTools.mainWindow.gridNudgeCluster.textFields.whoseTitle.is("Nudge Custom Value").first.elementClick(); const right = () => sf.keyboard.press({ keys: "right", fast: true }); const zeroOut = () => sf.keyboard.press({ keys: "numpad 0", fast: true }); const type = (text) => sf.keyboard.type({ text: text }); const goToMin = () => sf.keyboard.press({ keys: "numpad equals", fast: true }); const pressReturn = () => sf.keyboard.press({ keys: "return", }); let [min, sec, msec] = value.split(/[:.]/) clickCustomNudgeArea(); zeroOut(); goToMin(); type(min); right(); type(sec); right(); type(msec); pressReturn(); }; // get current time scale function getTimeScale(value) { let timeScale /// Bars Beats . if (value.includes("|")) timeScale = "Bars|Beats" // Min Secs . else if (value.split(":").length == 2 && value.includes(".")) timeScale = "Min:Secs" // Time code else if (value.split(":").length == 4) timeScale = "Timecode" // Feet+Frames else if (value.includes("+")) timeScale = "Feet+Frames" // Samples. else timeScale = "Samples" return timeScale } function setNudge(value) { const curentNudgeValue = sf.ui.proTools.mainWindow.groups.whoseTitle.is("Grid/Nudge Cluster").first.textFields.first.value.invalidate().value const userTimeScale = getTimeScale(value) const currentTimeScale = getTimeScale(curentNudgeValue) if (currentTimeScale != userTimeScale) { sf.ui.proTools.mainWindow.groups.whoseTitle.is("Grid/Nudge Cluster").first.popupButtons.whoseTitle.is("Nudge value").first.popupMenuSelect({ menuPath: [userTimeScale], }); } if (userTimeScale === "Min:Secs") { setMinSecNudge(value) } else { sf.ui.proTools.nudgeSet({ value: value }) } } //sf.ui.proTools.appActivateMainWindow() sf.ui.proTools.menuClick({ menuPath: ['Window', 'Edit'] }); // nudge value exactly as writen in pro tools setNudge("03:01.550")
- RRobert Mallory @Robert_Mallory
Been looking all over this forum for a way to set the Nudge value to 500ms when working in Min:Sec mode in PT. This seems to do the trick, thanks so much. Do you think Min:Sec nudge and grid values will be included in future SF versions, along with the Bars|Beats and Feet+Frame and Timecode macros currently available? It would be so helpful.