HISE Logo Forum
    • Categories
    • Register
    • Login

    Reset Internal Clock on Transport Change

    Scheduled Pinned Locked Moved Unsolved Scripting
    3 Posts 2 Posters 52 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.
    • O
      obolig
      last edited by

      I'm building a plugin that includes a step sequencer that can either sync with the DAW or a custom BPM. This is done using a transportHandler that is set to PreferExternal or InternalOnly.

      While using a custom BPM, I would like the transportHandler clock to reset when the user presses play within the DAW. I tried using th.setOnTransportChange(), but it is not triggered when using th.setSyncMode(th.InternalOnly).

      Do you have any ideas of how to reset and retrigger the transpotHandler on Transport Change?

      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @obolig
        last edited by

        @obolig Mmmm... That seems an expected behaviour if you set InternalOnly...

        the MasterClock class shows:

        	enum class SyncModes
        	{
        		Inactive, //> No syncing going on
        		ExternalOnly, //< only reacts on external clock events
        		InternalOnly, //< only reacts on internal clock events
        		PreferInternal, //< override the clock value with the internal clock if it plays
        		PreferExternal, //< override the clock value with the external clock if it plays
        		SyncInternal, //< sync the internal clock when external playback starts
        		numSyncModes
        	};
        

        SyncInternal might do the job

        Hise made me an F5 dude, browser just suffers...

        O 1 Reply Last reply Reply Quote 1
        • O
          obolig @ustk
          last edited by

          @ustk Thanks for the suggestion. I just tried calling th.setSyncMode(th.SyncInternal) and it does trigger setOnTransportChange the first time the DAW is stopped. After that, the function is not triggered again by playing or stopping. The clock actually stops altogether.

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

          27

          Online

          2.0k

          Users

          12.9k

          Topics

          111.7k

          Posts