How to automate consolidating silence onto start and end of bounces
I'm a complete novice at programming. I would love to create an app that, finds my Full Mix track, cuts my burnt in mix to length, cuts 6 frames off the tail, cuts 6 frames off the front, then consolidates the clip. Ensuring my UK mixes have 6 frames of silence top and tail. Not sure how to start. Please can you help?
- samuel henriques @samuel_henriques
Hello @unnamed_976 ,
Could you help me by clarifying a bit?Selecting your "full mix track" is possible, does the track always have the same name? What is it?
Cutting it to length, would mean knowing when the audio starts and ends, this might not be possible.
It looks like you want to add 6 frames f silence to the start and to the end of the clip. But one step you are describing is "cut off 6 frames" do you have 12 frames and need to cut them to 6?
Adding 6 frames to the start then 6 frames to the end then consolidate, is definitely possible.
samuel henriques @samuel_henriques
Here's a good start (I think),
Hope it helps.
function setGridViewEnabled() { var viewGrid = sf.ui.proTools.mainWindow.groups.whoseTitle.is('Grid/Nudge Cluster').first.buttons.whoseTitle.is('Show Grid Lines').first if (viewGrid.value.invalidate().value !== "Selected") viewGrid.elementClick() var gridBtn = sf.ui.proTools.mainWindow.editModeCluster.gridModeButton.invalidate(); var isAbsolute = gridBtn.title.invalidate().value.indexOf("Absolute") === 0; var isSelected = ![ sf.ui.proTools.mainWindow.editModeCluster.slipModeButton, sf.ui.proTools.mainWindow.editModeCluster.shuffleModeButton, sf.ui.proTools.mainWindow.editModeCluster.spotModeButton, ].some(btn => btn.value.invalidate().value === 'Selected'); if (!isSelected) gridBtn.elementClick(); if (!isAbsolute) { gridBtn.elementClick(); } sf.ui.proTools.gridSet({ gridValueName: "1 frame", executionMode: "Foreground", }); } function extendSelectionOnEitherSide(frameCount) { setGridViewEnabled(); sf.keyboard.press({ keys: 'alt+shift+numpad minus', repetitions: frameCount, fast: true }); sf.keyboard.press({ keys: 'cmd+shift+numpad plus', repetitions: frameCount, fast: true }); } function main(){ sf.ui.proTools.appActivate(); sf.ui.proTools.invalidate(); let fullMixTrack = sf.ui.proTools.trackSelectByName({ names: ["Full Mix"], deselectOthers: true, }); sf.ui.proTools.selectedTrack.trackScrollToView() sf.ui.proTools.menuClick({ menuPath: ["Edit", "Select All"], }); extendSelectionOnEitherSide(6) sf.ui.proTools.menuClick({ menuPath: ["Edit", "Consolidate Clip"], }); } main()
- In reply tosamuel_henriques⬆:DDavid Poole @David_Poole
Hi Samuel
Thanks for your reply.
The track I burn down to is called FULL MIX in my Pro Tools template.
I have used a set up previously where you had an option of different lengths to choose from. If you've mixed a 60 second commercial you could hit the 60, if you've mixed a 30 second you would hit another macro, named 30 and so on.
So the audio would start at 1 hour for example, then the next mix that needs chopping would be at 1 hour 1 minute and so on.
I would burn my mix in to the FULL MIX track. At this point you would have the audio cut to it's length of 60 seconds or 30 seconds, or 15 seconds etc. For UK we need to take off 6 frames top and tail. So go to end of this clip, go back 6 frames, cut tail. Go to the start of the clip, cursor forwards 6 frames, cut the head off clip. Then consolidate the clip back to its original length, 60, 30 etc. Then move the cursor 1 minute up the timeline and do to the next mix. The next mix might be a different length.
It could also be useful if you've burnt the the mix into the FULL MIX track but just want to make sure the WAV will be the correct length. You hit the button and it cuts the WAV to the desired, length from a choice of a few lengths.
Thanks for any help
Dave
- Comment deleted
samuel henriques @samuel_henriques
Hey David,
I'll try something and let you knowsamuel
samuel henriques @samuel_henriques
Hello David,
this will trim 6 frames to start and end, and then consolidate to the original clip duration.
And will do it for all selected clipsfunction setGridViewEnabled() { var viewGrid = sf.ui.proTools.mainWindow.groups.whoseTitle.is('Grid/Nudge Cluster').first.buttons.whoseTitle.is('Show Grid Lines').first if (viewGrid.value.invalidate().value !== "Selected") viewGrid.elementClick() var gridBtn = sf.ui.proTools.mainWindow.editModeCluster.gridModeButton.invalidate(); var isAbsolute = gridBtn.title.invalidate().value.indexOf("Absolute") === 0; var isSelected = ![ sf.ui.proTools.mainWindow.editModeCluster.slipModeButton, sf.ui.proTools.mainWindow.editModeCluster.shuffleModeButton, sf.ui.proTools.mainWindow.editModeCluster.spotModeButton, ].some(btn => btn.value.invalidate().value === 'Selected'); if (!isSelected) gridBtn.elementClick(); if (!isAbsolute) { gridBtn.elementClick(); } const nudgeCluster = sf.ui.proTools.mainWindow.groups.whoseTitle.is('Grid/Nudge Cluster') const nudgeValue = nudgeCluster.first.textFields.first.invalidate().value.value; if (nudgeValue !== "00:00:00:01.00") { nudgeCluster.first.popupButtons.whoseTitle.is('Nudge value').first.popupMenuSelect({ menuPath: ["Timecode"], targetValue: "Enable", }); sf.ui.proTools.nudgeSet({ value: "00:00:00:01.00" }); } } function trimSelectionOnEitherSide(frameCount) { setGridViewEnabled(); sf.keyboard.press({ keys: 'alt+shift+numpad plus', repetitions: frameCount, fast: true }); sf.keyboard.press({ keys: 'cmd+shift+numpad minus', repetitions: frameCount, fast: true }); } function trimAndConsolidatetoToOriginalSelection() { sf.ui.proTools.appActivate(); const originalSelection = sf.ui.proTools.selectionGetInSamples() trimSelectionOnEitherSide(6) sf.ui.proTools.menuClick({ menuPath: ["Edit", "Trim Clip", "To Selection"] }); sf.ui.proTools.selectionSetInSamples({ selectionStart: originalSelection.selectionStart, selectionEnd: originalSelection.selectionEnd }); sf.ui.proTools.menuClick({ menuPath: ["Edit", "Consolidate Clip"] }); } sf.ui.proTools.clipDoForEachClip({ action: trimAndConsolidatetoToOriginalSelection, onError: "Continue" });
let me know if it works for you
samuel henriques @samuel_henriques
so far, whats missing from your description is the first step. cut to length,
am I right?.So you burn the duration of all videos and get one long clip on the "FULL MIX" track?
samuel henriques @samuel_henriques
Another question, wouldn't you want to have a very short fade in and fade out to avoid a sudden cut?
- DIn reply tounnamed_976⬆:David Poole @David_Poole
Hey Samuel,
Thank you fo r your replies.
I'm such a novice I've no idea what to do with the what I think is code? ;)
I would need to cut 6 frames off the start and end of the clip that has been burnt in, then consolidate it back to its original length.
I would set an in and out point, potentially by using each video file, but this is not always the case as I'm often sent video files that are too long or short by 1 or 2 frames. In this instance I make a selection around the video files and increase/decrease the length of the selection to the exact length required. Or, I sometimes use the length of the music track if that is the exact length of the mix.
Another option I have occasionally used is creating a mute clip, on its own track to the exact length of the mix. Then selecting this clip, to get the selection to the exact length, when burning files in. Maybe this could be of some use?
Speak soon
Davesamuel henriques @samuel_henriques
hey David,
Before we move to that one, did you have a chance to try what I sent, to see if it's what you are looking for?
Just cut the "FULL MIX" clip to size and then run the script with all selected clips.
samuel henriques @samuel_henriques
this is what should happen,
- DIn reply tounnamed_976⬆:David Poole @David_Poole
Whatever is on that gif sequence looks great. You would not need fades.
samuel henriques @samuel_henriques
yep sorry, just changed it to link.
is the script working for you?
- DIn reply tounnamed_976⬆:David Poole @David_Poole
Please excuse my ignorance as a beginner in this field. What would I do with the script?
samuel henriques @samuel_henriques
no problem,
check out this video from Kitch,
- DIn reply tounnamed_976⬆:David Poole @David_Poole
Just trying it out now. It is really exciting (well, for me anyway, probably a niche area for excitement)