How to search for a specific ORIGINAL timecode stamp within a clip.
Say, i have a clip of sound coming from Production Sound, and i want to put my cursor on a specific timecode.
This happens when i want to re-sync something by hand, or when a sound report makes a note about a sound within a long audio take and tat note has a timecode reference.
There is no real way to do that within ProTools other then SPOT pasting the clip and jump to the wanted timecode in the main timecode window, or trial and error start point editing while looking at the original timecode stamp.
So, i want SF to ask for the wanted timecode, then SF should ask the user to select the clip (or the other way round) and then put the cursor, a sync marker or edit at exactly that point.
- SIn reply toFokke⬆:Sean @SeanH
bumping this.
anyone have a way to do it, soundflow or otherwise?
is it currently possible with scripting?
would be a KILLER feature for dx editing.
:)
- In reply toFokke⬆:Christian Scheuer @chrscheuer2019-02-26 03:30:51.202Z2019-02-26 06:57:28.351Z
This should do it - requires 2.2.0-preview 2
Note how in 2.2 we have built in support for calculating timecodes in all official frame rates.
const sampleRate = 48000; sf.ui.proTools.appActivate(); function formatTimestamp(timestampStr) { if (timestampStr.indexOf(':') >= 0) return timestampStr; if (timestampStr.length !== 8) return timestampStr; return timestampStr.replace(/^(\d\d)(\d\d)(\d\d)(\d\d)$/, '$1:$2:$3:$4'); } function gotoTimestampInSelectedClip(frameRateStr, timestampStr) { var timestamp = sf.projects.PxSmpteTime.newFromString({ frameRate: frameRateStr, value: formatTimestamp(timestampStr) }, 'Could not parse timestamp: ' + timestampStr).value; var originalTimestampStr = sf.ui.proTools.clipGetSpottingInfo().originalTimestamp.split('.')[0]; var originalTimestamp = sf.projects.PxSmpteTime.newFromString({ frameRate: frameRateStr, value: originalTimestampStr }, 'Could not parse SmpteTime: ' + originalTimestampStr).value; var timeRelativeToClipStart = timestamp.addFrames(-originalTimestamp.frameCount); //Since we ran clipGetSpottingInfo, our selection now starts at the clip start sf.ui.proTools.mainCounterDoWithValue({ targetValue: 'Timecode', action: function () { var timeClipStart = sf.projects.PxSmpteTime.newFromString({ frameRate: frameRateStr, value: sf.ui.proTools.selectionGet().selectionStart }, 'Could not parse selection start').value; var timeGoto = timeClipStart.addFrames(timeRelativeToClipStart.frameCount); var timeGotoStr = timeGoto.toString(); sf.ui.proTools.selectionSetTimecode({ selectionStart: timeGotoStr, selectionEnd: timeGotoStr }); }, }); } var frameRate = sf.interaction.selectFromList({ prompt: 'Please select a frame rate', items: [ 'Rate23_976_ND', 'Rate24_ND', 'Rate25_ND', 'Rate29_97_D', 'Rate29_97_ND', 'Rate30_ND', 'Rate50_ND', 'Rate59_94_D', 'Rate59_94_ND', 'Rate60_ND' ], }).list[0]; var timestampStr = prompt('Please select an original timestamp to go to for the selected clip', '01:00:00:00'); gotoTimestampInSelectedClip(frameRate, timestampStr);
- SSean @SeanH
it works! nice!
only improvement might be if there is a way to type in the TC on the numpad without having to add the colons : : : :
could sf be set to expect the user timecode input just in numbers and no colons?
because its seems usually when I'm in the type of situation where I would need this script, (manually assembling some alternate mics when field recorder workflow fails), I'm not getting the source timestamp from a place it is easily copied and pasted from, so its faster just to read and type in the numbers.
Christian Scheuer @chrscheuer2019-02-26 03:49:47.995Z
I've edited the code in my post to also work when not entering colons at all.
- In reply toFokke⬆:Christian Scheuer @chrscheuer2019-02-26 03:41:42.724Z
You can also see here for a simpler example of doing timecode math in 2.2.0+:
https://forum.soundflow.org/-467/how-to-work-with-timecode-math- SSean @SeanH
any timecode math i don't have to do myself is a BIG WIN.
- In reply toFokke⬆:Fokke van Saane @Fokke
Very very nice!
Some things to improve.
The result fails when the frame boundary is not in grid.
Like this:-Would be nice to remember the last frame rate setting so we don't have to select the same again and again.
-After the macro, leave revert back to the edit mode used before the macro was started, now it stays in SPOT.
Fokke van Saane @Fokke
Hmm. I was to quick with my enthusiasm. the action failed a few times here.
Have to sort out when.Fokke van Saane @Fokke
-
It fails when you run the action on an already selected clip. when you run the action and THEN select the clip it works.
-
When the frame boundary within the audio file is not on a frame boundary in the session it fails to find the exact beginning of the frame within the clip but spots the cursor to where the frame boundary is in the session.
-
Is it possible to read the session frame rate and use that instead of the dialog?
Christian Scheuer @chrscheuer2019-02-28 00:49:35.921Z
#1 Interesting - it should work only on selected clips actually.
Can you do a little screen record to show me what's going on? What's the error?#2 Is this a deal breaker? We could make this sample accurate I think with a little more math.
#3 It will be in the future yes
Fokke van Saane @Fokke
Of course i want Frame Boundary Accuracy, which is similar to sample accuracy i think. If i ask for TC 11:23:14:12 and get 11:23:14:11 as result.... naaah.
What you could do is use Samples instead of Timecode. You have to convert the wanted tc position to samples (can be done within ProTools too...) and then do the calculation.
I am writing a KM script for this now. will share with you of course. Even if you don't have KM you can get my idea.
Christian Scheuer @chrscheuer2019-04-13 21:35:23.941Z
Sounds great!
-
- Progresswith doing this idea
- Fokke van Saane @Fokke
Of course i want Frame Boundary Accuracy, which is similar to sample accuracy i think. If i ask for TC 11:23:14:12 and get 11:23:14:11 as result.... naaah.
What you could do is use Samples instead of Timecode. You have to convert the wanted tc position to samples (can be done within ProTools too...) and then do the calculation.
I am writing a KM script for this now. will share with you of course. Even if you don't have KM you can get my idea.
- Fokke van Saane @Fokke
Ok, i finished this macro for KM.
What i did is, i will put it short in words. Just for you to get my idea.Put PT in Spot mode and with the grabber let the user click a clip.
Put the goal timecode in the Spot Dialog which must be on Timecode.
Put the Timescale on Samples. PT will now calculate the Timecode to Samples, SSM i presume.
Click the Source timecode button and grab the start and End times (in samples)
Make sure the goal timecode (which is now goalsamples) is inbetween Start en End samples.
If not, throw an error.
Escape the Spot Dialog.
Put ProTools Timeline in Samples
Enter the main time scale (* key) and put a + in the main timescale and fill in the difference between goalsamples minus startsamples.
Place a sync marker.
Done.