• Isadora
  • Get it
  • Forum
  • Help
  • ADD-ONS
  • Newsletter
  • Impressum
  • Dsgvo
  • Impressum
Forum

Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags

    converting timecode to seconds

    How To... ?
    timecode convert
    4
    6
    1057
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bonemap
      bonemap last edited by bonemap

      Hi,

      I am curious to know if the patch represented in this screengrab is the best approach for converting timecode to seconds? 

      best wishes

      Russell

      http://bonemap.com | Australia
      Izzy 3 STD/USB 3.2.5 | MBP 16” 2019 2.4 GHz Intel i9 64GB AMD Radeon Pro 5500 8 GB 4TB SSD | Mac Studio 2022 M1 Max 32GB | OSX 12.5.1 Monterey

      1 Reply Last reply Reply Quote 1
      • fubbi
        fubbi last edited by

        I found this javascript somewhere on the internetz and it can be modified to work with isdaora

        // set the frame rate or Frame Rat as we like to call him
        var frameRat = 30 // fps
        var numOfFrames = 60 // animation frame count
        var animTime = "00:01:00:00" // time code
        var a = convertTimeToFrames(animTime, frameRat);
        var result = animTime + " at " + frameRat + " fps\n = " + a + " frames.";
        alert(result);
        function convertTimeCodeToSeconds(timeString, framerate)
        {
          var timeArray = timeString.split(":");  var hours   = parseInt(timeArray[0]) * 60 * 60;  var minutes = parseInt(timeArray[1]) * 60;  var seconds = parseInt(timeArray[2]);  var frames  = parseInt(timeArray[3])*(1/framerate);  var str = "h:" + hours + "\nm:" + minutes + "\ns:" + seconds + "\nf:" + frames;  alert(str)  var totalTime = hours + minutes + seconds + frames;
          //alert(timeString + " = " + totalTime)  return totalTime;
        }
        function convertTimeToFrames(timeString, framerate)
        {  var secs = convertTimeCodeToSeconds(timeString, framerate);  return secs * framerate;
        }
        bonemap 1 Reply Last reply Reply Quote 2
        • bonemap
          bonemap @fubbi last edited by bonemap

          @fubbi said:

          found this

           👍 Thank you. The solution looks like it was much simpler than that. I assume there are built in converters at work here?

          function main()
          {
          var input1 = arguments[0]; //timecode input1
          var output1 = Math.trunc(input1);
          return output1;
          }

          http://bonemap.com | Australia
          Izzy 3 STD/USB 3.2.5 | MBP 16” 2019 2.4 GHz Intel i9 64GB AMD Radeon Pro 5500 8 GB 4TB SSD | Mac Studio 2022 M1 Max 32GB | OSX 12.5.1 Monterey

          1 Reply Last reply Reply Quote 0
          • DusX
            DusX Tech Staff last edited by

            To make things even easier, it should be possible to use Isadoras internal conversion for this.
            Since isadora tracks timecode internally in milliseconds, you can treat timecode as an interger (seconds).
            So this should provide the same conversion :)

            Troikatronix Technical Support

            • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
            • Isadora Add-ons: https://troikatronix.com/add-ons/
            • My Add-ons: https://troikatronix.com/add-ons/?u=dusx

            Running: Win 10 64bit, i7-8750H, M.2 PCIe SSD's, 16gb DDR4-2666, nVidia GTX 1070 | located in Ontario Canada.

            ? bonemap 2 Replies Last reply Reply Quote 2
            • ?
              A Former User @DusX last edited by

              @dusx

              Thank' s a lot.

              It is relative rare to find solutions here,

                which are able to do without beeing a programmer.

              R.h.

              1 Reply Last reply Reply Quote 0
              • bonemap
                bonemap @DusX last edited by bonemap

                @dusx said:

                even easier

                 That couldn’t be easier. So timecode can be patched to both text and numeric inputs? Our job Is done here.

                http://bonemap.com | Australia
                Izzy 3 STD/USB 3.2.5 | MBP 16” 2019 2.4 GHz Intel i9 64GB AMD Radeon Pro 5500 8 GB 4TB SSD | Mac Studio 2022 M1 Max 32GB | OSX 12.5.1 Monterey

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post