HISE Logo Forum
    • Categories
    • Register
    • Login

    Controlling bands on Parametric EQ.

    Scheduled Pinned Locked Moved General Questions
    14 Posts 3 Posters 596 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.
    • lalalandsynthL
      lalalandsynth
      last edited by

      Works like this :)

      // Control EQ
          const var ParametriqEQ = Synth.getEffect("Parametriq EQ");
      
      inline function onloPassKnobControl(component, value)
      {
      	local index = ParametriqEQ.Freq  + 0 * ParametriqEQ.BandOffset;
      	ParametriqEQ.setAttribute(index, value);
      };
      
      Content.getComponent("loPassKnob").setControlCallback(onloPassKnobControl);
      
      1 Reply Last reply Reply Quote 1
      • ustkU
        ustk @lalalandsynth
        last edited by

        @lalalandsynth You need to use a callback for the parEQ, and use the bandOffset property to find the good node index

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

        lalalandsynthL 1 Reply Last reply Reply Quote 1
        • lalalandsynthL
          lalalandsynth @ustk
          last edited by

          @ustk Yessir , figured it out , working nicely . Any tips on inverting a knob value ?

          ustkU 1 Reply Last reply Reply Quote 0
          • ustkU
            ustk @lalalandsynth
            last edited by

            @lalalandsynth component.get("max") - value

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

            1 Reply Last reply Reply Quote 0
            • lalalandsynthL
              lalalandsynth
              last edited by lalalandsynth

              Hmm, not sure where to place that in the code to be honest.
              I am such a noob , i hit a wall at every turn :)

              I am setting the ranges with the property editor , do I need to set the ranges in the scripteditor to implement any inversion ?

              ustkU 1 Reply Last reply Reply Quote 0
              • ustkU
                ustk @lalalandsynth
                last edited by

                @lalalandsynth Yes you need to script it:

                const var Knob1 = Content.getComponent("Knob1");
                
                var invertedValue;
                
                inline function onKnob1Control(component, value)
                {
                	invertedValue = component.get("max") - value;
                	
                	Console.print(invertedValue);
                };
                Knob1.setControlCallback(onKnob1Control);
                

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

                ustkU 1 Reply Last reply Reply Quote 0
                • ustkU
                  ustk @ustk
                  last edited by

                  @ustk You cannot invert min and max in the property editor. min always need to be smaller than max, hence the solution above

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

                  1 Reply Last reply Reply Quote 0
                  • lalalandsynthL
                    lalalandsynth
                    last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • lalalandsynthL
                      lalalandsynth
                      last edited by

                      This works to invert the knob value.

                       // Invert loPass Knob;
                          
                        
                          const var loPassKnob = Content.getComponent("loPassKnob");
                      
                      var invertedValue;
                      
                      inline function onloPassKnobControl(component, value)
                      {
                      	invertedValue = component.get("max") - value;
                      	
                      	Console.print(invertedValue);
                      };
                      loPassKnob.setControlCallback(onloPassKnobControl);;
                      ;
                      

                      But has no impact on the control part , where its still un-inverted..I would assume that if the knob is declared as const var it would apply the inversion where the knob is called later in the code ?

                      // Invert loPass Knob;
                          
                        
                          const var loPassKnob = Content.getComponent("loPassKnob");
                      
                      var invertedValue;
                      
                      inline function onloPassKnobControl(component, value)
                      {
                      	invertedValue = component.get("max") - value;
                      	
                      	Console.print(invertedValue);
                      };
                      loPassKnob.setControlCallback(onloPassKnobControl);;
                      ;
                      // Control - Lopass;
                          
                      inline function onloPassKnobControl(component, value)
                      {
                      	local index = ParametriqEQ.Freq  + 1 * ParametriqEQ.BandOffset;
                      	ParametriqEQ.setAttribute(index, value);
                      };
                      
                      Content.getComponent("loPassKnob").setControlCallback(onloPassKnobControl);
                      
                      ustkU LindonL 2 Replies Last reply Reply Quote 0
                      • ustkU
                        ustk @lalalandsynth
                        last edited by

                        @lalalandsynth A mix of the two ;)

                        // Invert loPass Knob;
                        const var loPassKnob = Content.getComponent("loPassKnob");
                        
                        inline function onloPassKnobControl(component, value)
                        {
                        	local index = ParametriqEQ.Freq  + 1 * ParametriqEQ.BandOffset;
                        	ParametriqEQ.setAttribute(index, component.get("max") - value);
                        };
                        
                        Content.getComponent("loPassKnob").setControlCallback(onloPassKnobControl);
                        

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

                        1 Reply Last reply Reply Quote 1
                        • LindonL
                          Lindon @lalalandsynth
                          last edited by

                          @lalalandsynth you didnt set the eq to the inverted value...

                          inline function onloPassKnobControl(component, value)
                          {
                          	local index = ParametriqEQ.Freq  + 1 * ParametriqEQ.BandOffset;
                          	ParametriqEQ.setAttribute(index, component.get("max") - value);
                          };
                          

                          HISE Development for hire.
                          www.channelrobot.com

                          1 Reply Last reply Reply Quote 1
                          • lalalandsynthL
                            lalalandsynth
                            last edited by lalalandsynth

                            Ah, thanks ! Works now !

                            One more thing , in the property editor i set this lopass to max 20000 and min 400 , it seems to respect the max setting but it goes down to 20 hz , any thoughts on that ? When I start scripting a knob at all is it expected that i set the min and max via scripting as well or should I be able to combine ?

                            Also , the show value popup still shows the non inverted value .
                            Must say , flipping the values in the min max would be simpler ;)

                            ustkU 1 Reply Last reply Reply Quote 0
                            • ustkU
                              ustk @lalalandsynth
                              last edited by ustk

                              @lalalandsynth You can combine with the property editor for min/max, but NOT for processorId/parameterId. You must remove them if using script callbacks. And everything that is set by script overwrite the parameter in the propety editor

                              In your case (because min is not 0) you need to add it to the total:

                              // Invert loPass Knob;
                              const var loPassKnob = Content.getComponent("loPassKnob");
                              
                              inline function onloPassKnobControl(component, value)
                              {
                              	local index = ParametriqEQ.Freq  + 1 * ParametriqEQ.BandOffset;
                              	ParametriqEQ.setAttribute(index, component.get("max") - value + component.get("min"));
                              };
                              
                              Content.getComponent("loPassKnob").setControlCallback(onloPassKnobControl);
                              

                              Of course, the popup still displays the original Value of the knob, not the inverted one you made by script... For this, you have to create your own popup label.

                              Flipping the min/max would create some weird edge cases because it's checked in the Juce core.
                              Although, adding a button in the property editor to invert the value might be do-able, but I'm not Christoph :)

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

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

                              53

                              Online

                              1.7k

                              Users

                              11.7k

                              Topics

                              101.9k

                              Posts