HISE Logo Forum
    • Categories
    • Register
    • Login

    How to get Playhead Position of DAW

    Scheduled Pinned Locked Moved General Questions
    4 Posts 2 Posters 338 Views
    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.
    • toxonicT
      toxonic
      last edited by

      Is there a way to get the position of the playhead from the DAW. I know, i can use setOnTransportChange() to check, if it's playing or stopped. But how can I, for example, find out, if the playhead got reset to the start? I tried Engine.getPlayhead(), but I couldn't figuere out, how to use it... it just spit out an empty object.

      1 Reply Last reply Reply Quote 0
      • toxonicT
        toxonic
        last edited by

        Engine.getPlayhead() seems to be the method of choice, but how to use it? Any examples?

        lalalandsynthL 1 Reply Last reply Reply Quote 0
        • lalalandsynthL
          lalalandsynth @toxonic
          last edited by

          @toxonic For what purpose ? Syncing to playhead ?
          If so then this works.

           // Create a transport handler
          
          const var transportHandler = Engine.createTransportHandler();
          transportHandler.setEnableGrid(true, 8);
          transportHandler.setSyncMode(transportHandler.PreferExternal);
          transportHandler.startInternalClock(0);
          
           
           // The grid callback needs to be enabled for the LFO
           // to sync itself to the clock.
           
           // The clock will now prefer the external clock source. This
           // means that as long as the external clock isn't running
           // (the DAW playback is stopped) it will use the internal clock
           // and as soon as the DAW playback is started it will resync
           // itself to match the DAW position
           
           // Start the internal clock. This will cause the LFO to run
           // even if the DAW playback is stopped. (if you omit this line
           // the LFO will not move unless the DAW playback is started).
           
          

          https://lalalandaudio.com/

          https://lalalandsynth.com/

          https://www.facebook.com/lalalandsynth

          https://www.facebook.com/lalalandsynth

          toxonicT 1 Reply Last reply Reply Quote 1
          • toxonicT
            toxonic @lalalandsynth
            last edited by

            @lalalandsynth Thank you much, that's a good starting point! 😊

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

            23

            Online

            1.7k

            Users

            11.8k

            Topics

            102.8k

            Posts