No internet connection
  1. Home
  2. How to

Converting Samples to Timecode

By Samuel Škubla @Samuel_Skubla
    2020-11-11 20:15:08.552Z

    Hello,

    The script I'm working on uses function sf.ui.proTools.clipDoForEachSelectedClip and I want to get length of each selected clip. Problem is that this function set counter to samples.

    When I tried to write function to change counter to timecode, get clip length and then change counter back to samples, I get error.

    So Is there any clever way to convert length (samples) saved in variable to length (TC), besides to do with with math?

    Thank you very much!

    Solved in post #6, click to view
    • 6 replies
    1. Hi Samuel,

      It should be possible to convert the counter to Timecode and convert it back. If you're having trouble getting it to work, please post your script here and your log (or even better, use the Script Help button - step 1 in this article - then we'll both get your script and your error logs)

      1. Out of curiosity - what do you need the length in Timecode for?
        As in, what's the full workflow?

        1. Samuel Škubla @Samuel_Skubla
            2020-11-11 20:39:38.746Z

            Normalizing and renaming before delivery.

            I often have multiple versions with different length on one timeline, and after printing all mixdowns, I use LC2n for final leveling. Then renaming all clips with Projectname_length_date and loudness sufix, as there are often versions for broadcast and online.

            1. Gotcha. Yea for that I'd just do as you were already trying to. Please use the Script Help so we can see it and help you with whatever was causing it to fail.

          • In reply tochrscheuer:
            Samuel Škubla @Samuel_Skubla
              2020-11-11 20:41:37.057Z

              It works. My bad. I tried to change counter, when there was rename window opened. I reordered few lines and everything works.

              Reply1 LikeSolution
              1. Awesome :)