Forum

    • Register
    • Login
    • Search
    • Categories

    Two knobs controlling eachother

    Scripting Forum
    4
    8
    76
    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.
    • DanH
      DanH last edited by

      Is there a better way to achieve this than the code below?

      const var knobs2 = [];
      knobs2[0] = Content.getComponent("PITCHER_ATTACK");
      knobs2[1] = Content.getComponent("PITCHATTACK");
      knobs2[0].setControlCallback(knobCB2);
      knobs2[1].setControlCallback(knobCB2);
      
      inline function knobCB2(control, value)
      {
              for (i = 0; i < 2; i++)
              {
                  if (control == knobs2[i]) continue; //Skip the knob that triggered the callback
                  knobs2[i].setValue(value);
              }    
              for (te = 0; te < TE.length; te++)
              {
                  TE[te].setAttribute(2, value);
              }
      }
      
      Christoph Hart 1 Reply Last reply Reply Quote 0
      • Christoph Hart
        Christoph Hart @DanH last edited by

        @danh use the linkedTo property?

        DanH 2 Replies Last reply Reply Quote 0
        • d.healey
          d.healey last edited by

          I have a video all about linking knobs you may want to check out

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

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

            @christoph-hart Sounds good, can't see anything in the docs, how do you use it?

            1 Reply Last reply Reply Quote 0
            • trillbilly
              trillbilly last edited by

              @d-healey is this video on YouTube or Patreon?

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

                @trillbilly It's on YouTube, same one I linked to in your thread.

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

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

                  @d-healey that explains it, I've only made it a fraction of the way through right now lol

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

                    @christoph-hart oh this one 😂

                    Works great! 🙂

                    Screenshot 2022-01-27 at 15.51.54.png

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

                    25
                    Online

                    803
                    Users

                    5.5k
                    Topics

                    51.7k
                    Posts