Forum

    • Register
    • Login
    • Search
    • Categories

    Pause, Wait, Sleep?

    Scripting Forum
    2
    6
    797
    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.
    • d.healey
      d.healey last edited by

      Is there a way to pause the execution of a script for a given number of milliseconds? I want to play note in a loop when two keys are held but there doesn't seem to be a function to slow down the script.

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

      1 Reply Last reply Reply Quote 0
      • Christoph Hart
        Christoph Hart last edited by Christoph Hart

        Pausing a script like in KONTAKT is not possible, but there are two options how to handle stuff in the future:

        1. Add a time stamp to generated messages
        2. Use the onTimer callback.

        I think for your use case the second option suits better. If you give me more information, I could sketch out an example script for you.

        Allowing the user to yield callbacks introduces all kinds of problems so I'd like to avoid adding this.

        1 Reply Last reply Reply Quote 0
        • d.healey
          d.healey last edited by

          I'd forgotten about the timer callback, I think it will do the job perfectly.

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

          1 Reply Last reply Reply Quote 0
          • d.healey
            d.healey last edited by

            Is there a way to alter the timer frequency on the fly?

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

            1 Reply Last reply Reply Quote 0
            • Christoph Hart
              Christoph Hart last edited by

              Synth.startTimer() changes the speed and can be called at any time (even in the onTimer callback itself)

              1 Reply Last reply Reply Quote 0
              • d.healey
                d.healey last edited by

                Thanks, really easy 🙂

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

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

                11
                Online

                741
                Users

                5.4k
                Topics

                50.4k
                Posts