HISE Logo Forum
    • Categories
    • Register
    • Login

    Synchronizing Loop Lengths Between Two Loopers

    Scheduled Pinned Locked Moved Scripting
    6 Posts 2 Posters 354 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.
    • T
      treynterrio
      last edited by

      Hi there, I am working on plugin that includes two loopers. Each looper is activated by a button, and the recording starts when the button is pressed and stops when it is released.
      I would like to know if it's possible to save the duration for which the first looper is activated so that the second looper can also record for the same duration. For example, if I record the first looper for 6 seconds, I want the second looper to record for exactly 6 seconds as well, regardless of how long I play it back.
      Has anyone implemented something similar, or can you suggest how I might achieve this in my code?
      Thank you in advance for your help!

      T 1 Reply Last reply Reply Quote 0
      • T
        treynterrio @treynterrio
        last edited by

        @treynterrio I've something that tells me how long the button was pressed but I don't know what's next

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

          @treynterrio said in Synchronizing Loop Lengths Between Two Loopers:

          I've something that tells me how long the button was pressed

          You could store the time when the button was pressed, and when it's pressed again subtract the stored time from the current time and that will tell you how long between presses.

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

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

            @d-healey do you've an example?

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

              @treynterrio said in Synchronizing Loop Lengths Between Two Loopers:

              do you've an example?

              Nope, but I think it would be better for you to try it first before I write it out for you.

              Start by storing the current engine uptime in a variable when the button is clicked.

              Then when the button is clicked a second time, subtract that stored value from the current engine uptime.

              To tell if this is the first button click or the second you can check if the variable you're storing the time in has a positive value, if it does that means it's the second click. And after the second click you can reset the variable to a negative value like -1.

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

              T 1 Reply Last reply Reply Quote 1
              • T
                treynterrio @d.healey
                last edited by

                @d-healey Got it working!

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

                24

                Online

                1.8k

                Users

                12.0k

                Topics

                104.5k

                Posts