Extend a clip by 0.25 frames start and end and apply a 0.50 fade at both ends.
By Tony Gibson @Tony_Gibson
Hey all, been trying to make a script to do this but am having a bit of trouble. Anyone have something that will help?
- Chris Shaw @Chris_Shaw2023-05-04 17:12:18.273Z
This thread may help:
Extend head and tail and fade 1 frame...- TTony Gibson @Tony_Gibson
Thanks Chris, will have a read.
- TIn reply toTony_Gibson⬆:Tony Gibson @Tony_Gibson
They seem to be having the same problems as I am, this is how far i got with the code. But I cant seem to get it to switch the nudge to 0.25 and back after it has completed the task. At the moment its extending by 1 frame and doing a 1 frame fade.
function extendAndFade() {
// Activate Pro Tools window
sf.ui.proTools.appActivateMainWindow();// Get original selection in samples const originalSel = sf.ui.proTools.selectionGetInSamples(); // Extend selection on both sides by 0.25 frames sf.keyboard.press({ keys: 'alt+numpad minus', repetitions: 1 }); sf.keyboard.press({ keys: 'cmd+numpad plus', repetitions: 1 }); // Create fade in and fade out const fadeLength = 120; // 0.5 frames in samples at 48000Hz sf.ui.proTools.selectionSetInSamples({ mainCounter: originalSel.selectionEnd, startCounter: Math.max(0, originalSel.selectionEnd - fadeLength), endCounter: originalSel.selectionEnd }); sf.ui.proTools.menuClick({ menuPath: ["Edit", "Fades", "Fade to End"] }); sf.ui.proTools.selectionSetInSamples({ mainCounter: originalSel.selectionStart, startCounter: originalSel.selectionStart, endCounter: Math.min(originalSel.lengthInSamples, originalSel.selectionStart + fadeLength) }); sf.ui.proTools.menuClick({ menuPath: ["Edit", "Fades", "Fade to Start"] });
}
extendAndFade();
- Progress