Controlling bands on Parametric EQ.



  • I want to control two points on a parametric eq , hipass /Lopass.
    So I set the processorId to Parametric eq but the parameterId only shows one Freq parameter so I only have access to controlling one point as opposed to having a selection of Bands .

    Should I be using scripting callbacks for this type of scenario ?



  • 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);
    


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



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



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



  • 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 ?



  • @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);
    


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



  • This post is deleted!


  • 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);
    


  • @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);
    


  • @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);
    };
    


  • 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 😉



  • @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 🙂


Log in to reply
 

9
Online

672
Users

2.7k
Topics

22.7k
Posts