HISE Logo Forum
    • Categories
    • Register
    • Login

    Timer controlling both UI and Audio threads

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 157 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.
    • B
      Blake.Manternach
      last edited by

      Hello, I'm building a sequencer plugin where having real time audio in sync will be very important. Followed some threads online and it seems best practice is to instantiate the timer and handle the audio in an external script and then putting deferCallbacks on my UI script to ensure prioritization of the audio thread.

      However, I do want my timer to also control the UI in my sequencer for example by lighting up each step number in the sequencer....what is best practice and how do I go about relaying this information and communicating with the UI for the timer events while still allowing the audio to be prioritized?

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @Blake.Manternach
        last edited by

        @Blake-Manternach said in Timer controlling both UI and Audio threads:

        However, I do want my timer to also control the UI in my sequencer for example by lighting up each step number in the sequencer....what is best practice and how do I go about relaying this information and communicating with the UI for the timer events while still allowing the audio to be prioritized?

        You'll use a real-time script with the Synth timer callback - timer objects are not real time.

        In the UI script you have a separate timer (either synth or timer object) doing all the stuff you need to represent the sequencer's playback to the user. You don't need to do anything to have it in sync with the other script, because it never will be in sync, but we're talking a tiny amount of difference so there will be no practical issue.

        You will probably have knobs and buttons on the UI that controls the various settings of the sequencer, you can connect these to your sequencer module using the standard processor/parameter ID properties in the interface designer or using setAttribute - just like you would for the built in modules.

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        B 1 Reply Last reply Reply Quote 0
        • B
          Blake.Manternach @d.healey
          last edited by

          @d-healey
          Fantastic, thanks for the help - your video on building an entry level sequencer was my introductory point for this, you're the man.

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

          36

          Online

          1.7k

          Users

          11.9k

          Topics

          103.5k

          Posts