HISE Logo Forum
    • Categories
    • Register
    • Login

    Invert value in delay time sync

    Scheduled Pinned Locked Moved Scripting
    3 Posts 2 Posters 231 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
      tomekslesicki
      last edited by

      Ok, this one is pretty obvious, I guess, but here I go! I'm trying to assign a knob to delay time and have it work not from 1/1 to 1/64T but the other way around. And for some reason

      inline function onDelayTimeControl(component, value)
      {
              Delay1.setAttribute(0, 1 - value); // left
              Delay1.setAttribute(1, 1 -value); // right
      };
      
      Content.getComponent("DelayTime").setControlCallback(onDelayTimeControl);
      

      ...doesn't seem to work.

      Delay Time is a knob going from 0 to 18. What obvious am I missing this time? ;-)

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

        @tomekslesicki If the knob goes from 0-18 then 1-value isn't going to work.

        Write out the result for each knob value and you'll see the problem.

        If the knob value is 1, then 1 - 1 = 0
        If the knob value is 2 then 1 - 2 = -1
        etc.

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

        1 Reply Last reply Reply Quote 0
        • T
          tomekslesicki
          last edited by

          Ah, ok, this makes sense now! Thanks again!

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

          19

          Online

          1.8k

          Users

          12.1k

          Topics

          105.4k

          Posts