HISE Logo Forum
    • Categories
    • Register
    • Login

    How to link 2 knobs?

    Scheduled Pinned Locked Moved C++ Development
    16 Posts 4 Posters 1.0k 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
      titosg @ustk
      last edited by

      @ustk

      • It depends. Is it linear? Yes, it is linear
      • Does Knob1 need to react back when changing Knob2 or is it one way? I want to set specific values for each value, for example:
        when Knob1 is 1->Knob2 is 1.5
        when Knob1 is 2->Knob2 is 6
        when Knob1 is 13>Knob2 is 7.3

      Is it possible to do that?

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

        @d-healey What is that code? I've seen it in some posts but I don't know what it is or how to use it

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

          @titosg It's a snippet. Copy it, then in HISE go to File >> Import HISE snippet

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

          T 1 Reply Last reply Reply Quote 0
          • LindonL
            Lindon @titosg
            last edited by Lindon

            @titosg said in How to link 2 knobs?:

            @ustk

            • It depends. Is it linear? Yes, it is linear
            • Does Knob1 need to react back when changing Knob2 or is it one way? I want to set specific values for each value, for example:
              when Knob1 is 1->Knob2 is 1.5
              when Knob1 is 2->Knob2 is 6
              when Knob1 is 13>Knob2 is 7.3

            Is it possible to do that?

            Looks like its not linear - so use a lookUp Table

            var lookUpArray = [1.5,6,7.3,8.1,9.9,12.5,13,15,22,34];
            
            const var Knob2 = Content.getComponent("Knob2");
            
            
            // knob 1's range is set 1 to 10
            
            inline function onKnob1Control(component, value)
            {
            	//
            	Knob2.setValue(lookUpArray[value-1]);
            };
            
            Content.getComponent("Knob1").setControlCallback(onKnob1Control);
            

            HISE Development for hire.
            www.channelrobot.com

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

              @d-healey Oh ok thank you, I've installed it and it works perfectly, but that's not exactly what I need. Do you know how can I do what I said before? Set different Knob2 values for each Knob1 value

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

                @Lindon That's exactly what I wanted! Thank you!!

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

                  HiseSnippet 1320.3oc4X80aaaCDmJNpI1qIXsXOrWFfPvFlClqiky+ZPwPbhSRgQaRLhSBFPQQAiLsCQjHEnnRiWQ+NsOB8o84oOtWF1NRIaSm4kXk0tVroGLDOd+N9iGOd2I2Tv8HQQbAxJ+w8BIHq6a2pGSdd8ywTFpwNHq4s2GGIIBmDQa2KDGEQZirrx8Tk.q7SizOueysw9XlGYnHD5TN0i7bZ.UNTZyZOi56uGtM4XZfg1qTqgGmUm6yiA9jytBJD6cAtK4.rRsorQV2a21TIWzRhkjHj0zaya2q047WyRz+TZD8LehZfKpEXnDw6w8aqXr5cT8yo9sa1eeGgPV1MG5Exk3E9J68osoCjOza7k5IbFhvzeXM0MQO26H8rLn2zIz6A1s7DzP4vYTb6KravfCpNX3HvjVI5hl52srqyAMXxxA3KH6IfACPTbsJUJ4rZkJK9j4JLWgKwBGeN+hSB2RHv8b9QmW3Vd0RqUZ8xKW5wkcKsQ4MJ4VED4tbI2UKUsZokW4kZnvYXjzQYfmw3mUEf1eU6Rj04AgbFLn3B5YWHY4lqvRK4bAHvw86ibDXVWhCMxIhHcbcjbG2JJcnLeJi3zIl4IoblCmorgqx7BteQu91tDr59wjEmqvalqP9kVB9QuXkA6cpZlhFasWn08QtuTwj2pYyeOecWXQkQRWw5Xe+yfPzhiRjEehACOfKIGxJtXg2THeg2V35yzoy3lJ0P9Dw3lUcqQbCvJxhCNiH56ER0CBdFM57dSVzoWhyvPQNqAiJOLjjNdX7q6XheQodSHRdpTBBpJ0wwymFG2xm1lHPTvHyXqckHM2MyjflXvUuN3eaSzIM1AKwpaSozAnXHQHoJOg0NjKgzTI2sxauCI5BIOTy2zSeHIwsx3q.kr9UX45odQ.uDfuZHIZTCYXtYt08fAzWWq2fAuqYsqY1v9N6F.5GBruCN1WtK6RhOrEcgjnBH+IbMWM+r1aIkPHKjE9ujUAxswaG6ikilvSkkOcBHLajLKprGrHprmYUfLjErxXyBN1nnIjtOvtIU5c9346TigupvxOx7Mslxb161oCwSNjrSau2OcWKfb2nx2jPkGZ2RJH3.JqaKbPHjmQymB1oib+PTlObhKy2T.gp31sn+rgZuq11wf+RLpzeoldo1JfGyFYsRY9QjPBVBG+FXls1QG8TAON75nd+l5fkiEvEBvUXNwgLB32kl6w5BdTTGX6nsUj4TMiEcU9pgRNhbIQDMprChCfydFi3GoxPXAhNIhnNqod6ikB5UlZqWkJGi0m2emc0UJO5ykGB+z4GTutQc83DHtYGR0rCY4rCYkrCY0rCYsrCY8LAIIPaebn5FipmzqUVclIqrJXflXHTvPysocGX7DIil50P0AwhZpazA7X5e7deBZu8Ceh8+40gxMYGL2RG346ywVT0QU+xrZNNlhulrbeNiGdNmQ8FMSAbyuaWhvj6icCkV4dDr9DbjQptus1ygNjwhQS.9wxWbSmWecZiFNpj+N+2n+gb+uu+gax0MeZ2CNvpKjeleNeeacpeGU6Iepn5Q7XIz1Q+R+1P+Asfdh7HlcILkpyijwUTiUDpEg0VO3OfmzIc62RgZR29Sh75aJXuk9t9CgrxQXpRG51h8glU7MCoifNuTTBJu8uBKCvdB9q7R9.OEWmUKAXIS+W+j2de0XmAeVnx6F.Updkmm5ZvibQnwinZlQrblQrRlQrZlQrVlQrdlQ73a.gpsfshk7fjjhffl6lDHYs6f.obn+DvTdDE8
                  

                  I'm getting this error message: Interface:! Line 13, column 16: API call with undefined parameter 0 {SW50ZXJmYWNlfHwyNjN8MTN8MTY=}

                  The slider is changing its value but it is not affecting the parameter with wich it is linked to.

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

                    @titosg

                    The slider is changing its value but it is not affecting the parameter with wich it is linked to.

                    The error is telling you that you're using a parameter that doesn't exist aka undefined.

                    Just had a quick look at the snippet. Your array only has 10 elements but your knob has 5000 possible values, so you need to do something about that :)

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

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

                      I just fixed the error but it still not working, it doesn't change the linked parameter

                      This is what I'm using now:

                      const var Knob2 = Content.getComponent("Knob2");
                      const var Knob1 = Content.getComponent("Knob1");
                      
                      
                      inline function onKnob1Control(component, value)
                      {
                      	
                      	if (Knob1.getValue() == 5)
                              {
                      	        Knob2.setValue(12);
                              }
                      };
                      
                      
                      Content.getComponent("Knob1").setControlCallback(onKnob1Control);
                      
                      ustkU 1 Reply Last reply Reply Quote 0
                      • ustkU
                        ustk @titosg
                        last edited by ustk

                        @titosg Just use value:

                        const var Knob2 = Content.getComponent("Knob2");
                        const var Knob1 = Content.getComponent("Knob1");
                        
                        inline function onKnob1Control(component, value)
                        {
                        	if (value == 5)
                                {
                        	        Knob2.setValue(12);
                                }
                        };
                        Knob1.setControlCallback(onKnob1Control);
                        

                        Also, no need to getComponent if you already declared it

                        Can't help pressing F5 in the forum...

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

                          Still not working, it doesn't change the parameter, wich in this case is the release knob from the envelope

                          I just recorded a video: https://vimeo.com/430058912

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

                            Call Knob2.changed() after you set its value.

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

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

                              Yes!! Thank you, now works perfect

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

                              30

                              Online

                              1.7k

                              Users

                              11.9k

                              Topics

                              103.5k

                              Posts