Howdy Sound Flow peeps!
Are there any pre-built actions for the Clip FX window? I'm tring to create a macro to do the following once I have highlighted a specific clip region:
- Edit highlighted region into a single clip (Cmd E)
- Enable a clip fx preset on selected clip
- Expand selcted area by 5ms on both sides
- Cross fade the newly selected area (Cmd F + "OK)
I'm having difficulties finding actions for the clip fx window and commands to expand current selection. Any tips would be grately appreciated!
- MIn reply toMaxwell_Smith⬆:Maxwell Smith @Maxwell_Smith
Update on this! Think I'm getting close with this...
sf.keyboard.press({
keys: "cmd+e",
});sf.keyboard.press({
keys: "cmd+1",
});sf.keyboard.press({
keys: "cmd++",
});sf.keyboard.press({
keys: "alt++",
});sf.keyboard.press({
keys: "cmd+f",
});sf.ui.proTools.windows.whoseTitle.contains('Batch Fades').first.buttons.whoseTitle.is('OK').allItems[0].elementClick();
samuel henriques @samuel_henriques
hello @Maxwell_Smith,
almost there, it's always best to use menu items whenever possible. And I think I would be safe to set the grid value, otherwise it will extend on whatever is there. I can't choose 5msec though, how do you do it?
As for the fades, are you using a preset as well?
sf.ui.proTools.appActivateMainWindow() let gridValue = sf.ui.proTools.mainWindow.groups.whoseTitle.is("Grid/Nudge Cluster").first.popupButtons.whoseTitle.is("Grid Value").first.value.invalidate().value // Set Grid value if it's not 0:00.010 if (gridValue.trim() != "0:00.010") { sf.ui.proTools.gridSet({ gridValueName: "Min:Secs" }) sf.ui.proTools.gridSet({ gridValueName: "10 msec" }) } // Separate Clips sf.ui.proTools.menuClick({ menuPath: ["Edit", "Separate Clip", "At Selection"], }); // Extent end selection by Grid Value sf.keyboard.press({ keys: "alt+numpad minus", }); // Extent start selection by Grid Value sf.keyboard.press({ keys: "cmd+numpad plus", }); sf.ui.proTools.menuClick({ menuPath: ["Edit", "Fades", "Create..."], }); // Set preset [0] for presset 1, [1] for presset 2... sf.ui.proTools.windows.whoseTitle.is('Batch Fades').first.buttons.whoseTitle.is('Fade Preset Toggle').allItems[0].elementClick(); sf.ui.proTools.windows.whoseTitle.is('Batch Fades').first.buttons.whoseTitle.is('OK').first.elementClick(); // Open Clip Effects sf.ui.proTools.menuClick({ menuPath: ["View", "Other Displays", "Clip Effects"], targetValue: "Enable" }); // Set preset [0] for presset 1, [1] for presset 2... sf.ui.proTools.mainWindow.buttons.whoseTitle.is("ClipFX Preset Toggle").allItems[0].elementClick();
samuel henriques @samuel_henriques
just noticed a mistake, and updated above.
Let me know how it goes.
samuel henriques @samuel_henriques
Updated: It will set grid, only if to set already.
- MMaxwell Smith @Maxwell_Smith
This worked beautifully! Thank you so much for sharing this... We did make one change below, we had to add "shift" to get the nudge to work...
sf.ui.proTools.appActivateMainWindow() let gridValue = sf.ui.proTools.mainWindow.groups.whoseTitle.is("Grid/Nudge Cluster").first.popupButtons.whoseTitle.is("Grid Value").first.value.invalidate().value // Set Grid value if it's not 0:00.010 if (gridValue.trim() != "0:00.010") { sf.ui.proTools.gridSet({ gridValueName: "Min:Secs" }) sf.ui.proTools.gridSet({ gridValueName: "10 msec" }) } // Separate Clips sf.ui.proTools.menuClick({ menuPath: ["Edit", "Separate Clip", "At Selection"], }); // Extent end selection by Grid Value sf.keyboard.press({ keys: "alt+shift+numpad minus", }); // Extent start selection by Grid Value sf.keyboard.press({ keys: "cmd+shift+numpad plus", }); sf.ui.proTools.menuClick({ menuPath: ["Edit", "Fades", "Create..."], }); // Set preset [0] for presset 1, [1] for presset 2... sf.ui.proTools.windows.whoseTitle.is('Batch Fades').first.buttons.whoseTitle.is('Fade Preset Toggle').allItems[0].elementClick(); sf.ui.proTools.windows.whoseTitle.is('Batch Fades').first.buttons.whoseTitle.is('OK').first.elementClick(); // Open Clip Effects sf.ui.proTools.menuClick({ menuPath: ["View", "Other Displays", "Clip Effects"], targetValue: "Enable" }); // Set preset [0] for presset 1, [1] for presset 2... sf.ui.proTools.mainWindow.buttons.whoseTitle.is("ClipFX Preset Toggle").allItems[0].elementClick();
samuel henriques @samuel_henriques
cool,
on mine, if I add shift, it will do a larger selection, but not by trimming.check out his video where Kitch explains how to quote code in the forum
How to quote code in the SoundFlow forum.samuel henriques @samuel_henriques
And you are using the first code I sent, the current one, won't change the grid value every time you run the code, only if it's not correct
- MMaxwell Smith @Maxwell_Smith
Thanks for that! Well update the code.
Curious what the syntax might be for editing specific parameters in the clip FX window? We have a preset made currently but it would be great to set HP settings in the code if the presets ever change. Any good resources for learning that sort of sytax?
Thanks again for all the help with this!
samuel henriques @samuel_henriques
that's a bit tricky, the way to click stuff would be using the "click UI element" action do get the "address" of the buttons, but avid designed the clip effects as it would a plugin, in the sense that soundFlow doesn't have access to the buttons. So to click them you would use "Mouse Click Relative to UI Element", Kitch made a video explaining how you use it here:
How to use "Mouse Click Relative to UI Element" to simulate mouse clicks in Pro Tools.
The problem here is that you can't read the state of the buttons, to be able to know if you need to click them, and to move eq, it's possible, but not great, because you need to program mouse movements, It's really cool to see it move though.