HISE Logo Forum
    • Categories
    • Register
    • Login

    Linking knobs together via a button

    Scheduled Pinned Locked Moved General Questions
    31 Posts 3 Posters 449 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.
    • ChazroxC
      Chazrox @pcs800
      last edited by

      @pcs800 You have all of your knobs connected via 'Property Editor' so those arent going to react to any script like you have.

      You can only do one or the other. If you know you're going to have scripting controlling the button/knob/slider, dont connect it via the 'Property Editor'.

      Also, you're not declaring any reference to your knob before you have it trying to execute an action, so that will cause an error as well on its own.

      Dave's 101 video is a great place to start. Best wishes!

      1 Reply Last reply Reply Quote 0
      • ChazroxC
        Chazrox
        last edited by

        Best advice....

        pcs800P 1 Reply Last reply Reply Quote 0
        • pcs800P
          pcs800 @Chazrox
          last edited by

          @Chazrox I watched a lot of the video above, and others.
          I now have a script that works as intended.

          Content.makeFrontInterface(566, 300);
          
          const var LDelay = Content.getComponent("LDelay1");
          const var RDelay = Content.getComponent("RDelay1");
          const var LFeedback = Content.getComponent("LFeedback");
          const var RFeedback = Content.getComponent("RFeedback");
          const var linkButton = Content.getComponent("LinkButton");
          
          inline function onLDelayControl(component, value)
          {
              if (linkButton.getValue()) 
              {
                  RDelay.setValueNormalized(LDelay.getValueNormalized());
              }
          }
          
          inline function onRDelayControl(component, value)
          {
              if (linkButton.getValue()) 
              {
                  LDelay.setValueNormalized(RDelay.getValueNormalized());
              }
          }
          
          inline function onLFeedbackControl(component, value)
          {
              if (linkButton.getValue()) 
              {
                  RFeedback.setValueNormalized(LFeedback.getValueNormalized());
              }
          }
          
          inline function onRFeedbackControl(component, value)
          {
              if (linkButton.getValue()) 
              {
                  LFeedback.setValueNormalized(RFeedback.getValueNormalized());
              }
          }
          
          LDelay.setControlCallback(onLDelayControl);
          RDelay.setControlCallback(onRDelayControl);
          LFeedback.setControlCallback(onLFeedbackControl);
          RFeedback.setControlCallback(onRFeedbackControl);
          
          d.healeyD 1 Reply Last reply Reply Quote 1
          • d.healeyD
            d.healey @pcs800
            last edited by

            @pcs800 Nice :)

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

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

              @d-healey
              So I overlooked something...
              Yes the delay time and feedback knobs are locked when the button is engaged, but they are not actually controlling the delay time and feedback, because I removed those assignments from the properties panel.
              I am struggling to figure out how to assign processorid and parameterid in the code editor.
              Can you help?

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

                @pcs800 said in Linking knobs together via a button:

                I am struggling to figure out how to assign processorid and parameterid in the code editor.

                Use .setAttribute to set the module parameters directly from the control callback.

                First you need to get a reference to the module (right click the header and select create generic script reference).

                Then in the callback you can call something like myModule.setAttribute(myModule.parameterName, value);

                To find out the parameterName you can again right-click the module header and select dump Parameter IDs and values.

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

                pcs800P 1 Reply Last reply Reply Quote 1
                • pcs800P
                  pcs800 @d.healey
                  last edited by

                  @d-healey said in Linking knobs together via a button:

                  myModule.setAttribute(myModule.parameterName, value);

                  Ok, I added the following to the code

                  const var Delay1 = Synth.getEffect("Delay1");
                  Delay1.setAttribute(Delay1.DelayTimeLeft, 0.00);
                  

                  It compiles without error, but the knob doesn't control delay time.

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

                    @pcs800

                    This needs to go in on init
                    const var Delay1 = Synth.getEffect("Delay1");

                    This needs to go within the control callback. It takes two parameters, the first parameter is the property you want to set (in this case DelayTimeLeft), the second parameter is the value you want to set that property to, you've put 0.00 but you want to use the knob's value, so put value there instead.

                    Delay1.setAttribute(Delay1.DelayTimeLeft, 0.00);

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

                    pcs800P 1 Reply Last reply Reply Quote 1
                    • pcs800P
                      pcs800 @d.healey
                      last edited by

                      @d-healey adding on init gives this error
                      Line 3, column 4: Found identifier when expecting ';'
                      I tried function onInit() but it then doesn't like the next line

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

                        @pcs800 said in Linking knobs together via a button:

                        Line 3, column 4: Found identifier when expecting ';'

                        That tells you that you are missing a semi-colon, probably on line 2

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

                        pcs800P 3 Replies Last reply Reply Quote 1
                        • pcs800P
                          pcs800 @d.healey
                          last edited by

                          @d-healey Yes, i knew it was telling me I was missing a semi colon, but I've tried adding one in a few spots without success.
                          Here's what I have when adding it to line 2

                          Content.makeFrontInterface(566, 400);
                          ;
                          on init
                          const var Delay1 = Synth.getEffect("Delay1");
                          Delay1.setAttribute(Delay1.DelayTimeLeft, 0.00);
                          

                          Still get the same error
                          It says line 3, column 4, which would make it like this on; init

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

                            @d-healey If I do this
                            on ;init;
                            it compiles without error

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

                              @d-healey
                              Back to your post above, when I set the word value instead of 0.00, I get this.

                              2025-05-27_131429.png

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

                                @pcs800 your code is getting crazy now 😀 go watch the scripting 101 video if you haven't

                                Wait you already did.

                                You never need to write on init. Just remove that bit and put the set attribute stuff within your callback - the callback is triggered when the knob is moved and that's when you want to change the value in the effect

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

                                pcs800P 1 Reply Last reply Reply Quote 1
                                • pcs800P
                                  pcs800 @d.healey
                                  last edited by

                                  @d-healey It is now working with the help of some online resources

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

                                  38

                                  Online

                                  1.7k

                                  Users

                                  11.8k

                                  Topics

                                  103.0k

                                  Posts