Lord of the Knobs :)



  • Hi guys
    I have a one knob. And I will control three different parameters with this Lord of the Knobs πŸ™‚ But each parameter has different ranges.

    For example;

    A parameter: 0 to -28
    B parameter: -3 to 10
    C parameter: -10 to 50

    The Knob: 0 to 1

    When Knob is 0: A=0, B= -3, C= -10
    When Knob is 1: A= -28, B= 10, C=50

    How can I implement it guys? @d-healey @Christoph-Hart



  • @orange Does the knob only act in one mode at a time?



  • inline function normalisedToRange(normalisedValue, min, max)
    {
        return min + normalisedValue * (max - min);
    }
    
    inline function onKnob1Control(component, value)
    {
    	local v1 = normalisedToRange(value, 0, -28);
    	local v2 = normalisedToRange(value, -3, 10);
    	local v3 = normalisedToRange(value, -10, 50);
    	
    	Console.print("v1: " + v1);
    	Console.print("v2: " + v2);
    	Console.print("v3: " + v3);
    	Console.print("----");
    };
    
    Content.getComponent("Knob1").setControlCallback(onKnob1Control);
    


  • @d-healey Yes,it will be in one mode allthe time. I'm trying to make a "One Knob" style plugin that has complicated structure underhood but user will be able to change only one knob for a easier user experience.



  • @christoph-hart That's what exactly what I want. Thank you so much!



  • @orange said in Lord of the Knobs πŸ™‚:

    @d-healey Yes,it will be in one mode allthe time.

    My solution would be to use three knobs (so that I could link them up via parameter ID in the interface designer) and just display a different knob depending on which mode is selected.



  • @d-healey said in Lord of the Knobs πŸ™‚:

    @orange said in Lord of the Knobs πŸ™‚:

    @d-healey Yes,it will be in one mode allthe time.

    My solution would be to use three knobs (so that I could link them up via parameter ID in the interface designer) and just display a different knob depending on which mode is selected.

    Cool but all of these 3 knobs will have different ranges. How can I operate this different range knobs with this way? Besides the One Knob will control these 3 knobs at one time, simultaneously



  • @orange

    Cool but all of these 3 knobs will have different ranges. How can I operate this different range knobs with this way?

    Well there will be 3 knobs so each can have a different range

    Besides the One Knob will control these 3 knobs at one time, simultaneously

    I thought it would be only controlling one parameter at a time.

    HiseSnippet 943.3ocsVE0aaaCDlxwLaVatHEnOrGIxSxHsAVIosCHKXd1NovnKoFycECnnnfVhNlMRj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GBOz38dd5DwS.lWMhCpMhCqMhipMhmVaDOq1HddsQ7seBD5W08CoJYXdaArv3SytX1x5TAEppxp.Q+MfTW7S.
    


  • @d-healey Thank you so much, I will try this snippet when I get home in 4 hours πŸ˜‰



  • @christoph-hart said in Lord of the Knobs πŸ™‚:

    inline function normalisedToRange(normalisedValue, min, max)
    {
        return min + normalisedValue * (max - min);
    }
    
    inline function onKnob1Control(component, value)
    {
    	local v1 = normalisedToRange(value, 0, -28);
    	local v2 = normalisedToRange(value, -3, 10);
    	local v3 = normalisedToRange(value, -10, 50);
    	
    	Console.print("v1: " + v1);
    	Console.print("v2: " + v2);
    	Console.print("v3: " + v3);
    	Console.print("----");
    };
    
    Content.getComponent("Knob1").setControlCallback(onKnob1Control);
    

    I've added this local variants to dedicated knobs and The One Knob (named Knob1) will control all of the 3 knobs with their individual value ranges! The best thing is value lineerity can change due to middle values of the controlled knobs. That's a very very good thing! I'm sharing the snippet. Thank you so much bros!! @Christoph-Hart @d-healey

    HiseSnippet 1054.3ocsVEsaZbDEcVrWk.otpQJR80Qn7vRqwhkEml1npPM1tB4ZLI3Z0JUojw6N.i7ryf1cfFRjkxeP9FxeQezpeI8g1ma+.pT6c1cgcg.D3AuFg7cN2y8d16b4NS6.oKMLTFfLxe93ATjwmX1YrP0uQeBSfZdHxnf4YsN5jVmcfM5fwCHggTOjgwVeuF2H+1nnm+4oGP3DgKMcID5BIyk9CLelJc010Ogw4GS7nmy7y3cs5MckhFRtbHnksLqfFPbuhzi1hncKmIxv7HOlRFzQQTzPjw1GH8F2ou7WEw9eAKjcImpMrQcf.Eu7wRtmVw5UQM5y3dsm7NGhfnzNsBrUbE3Almx7XSWOsR7YQ.3TFYqGF4Vk7ryJuJqu7LxHusik28M63FvFnRQzZ6dlMEJZPWBrEjUVw9hx89sLaHAODp87IWQON.Llxv5QUprKd+JUJ8jcJn+C1JBU3Qj.7IB4k0veKdB4dTUCo+.o.LrJFgVTyZVFNqjgyBXTckLpVbhxXBNSPwcGJbULo.KjA9DNCdaOW9bhnG0JckKH7gzcw9LA7E4Uk1ova1o.FdBnpgABM.9Kwy4O9KvVfy3xZXcVudQoUJzxxVq3.I2xchb2EdgffDmp7boKgiGYCuaenNGEqNnvWd+GqSzD2qtJ2K6rK1tRV2cVk61ZuicG9.xMTxo6MHfoqrir+FbQnBLxNxg4QqlfVcgnNInNKBsL7TbRVgOQ8I6ERUQkXqjDF0KjY0pSWsZlUcRhSzWWG0Fr7FE6hkzTS1WZP37KgwHVytcU5IY1GaIUzyDVkJ7lB4Kbcg4Q51cQPIAhSCVDpdxVvJnYIF5eIMXRuRhevOvmcBh4xmfjc.mabwHiiRQSASc1.pXYyUPIUP8.vDQAtphlu7oIyW5vYdz.DCFibGynxGJRuIyre4698+5on0lb0rjq+mu9AOq95S1YlL+uV+xmuAjqMC4+9Y+ViaP+XyCIJhd9ZRg.JNCnAJlttabHcDbvU7z17lGRCuRIGDUoR50f++iVqd0zy19CV8wSMdaaszmFm67QKaow4sMyDGbu59yd.LLzJ07mATOONssLjoa9RQd3FkemL4ud+L4GMW9u6Myj+Gtz7G07s14uV17OJS9e4b4+zYyOBsr7+02f9vyTgS1kdC4D0rG2quiSBfNFYOWUe1o.h83raA2J2AXck68MayTt8Wrdys.8Bs+215M4FU6XdT2tTWUpX2173e51+5SnmKGpXhdmRTALn6vr0P+NvELcofRDBJWOk0HmtkL1th1VWY5PEdQF+G7j.ZqsMR.sm.h7ItAxW3FONRems6FsBnIQzUWyadp1FOc7oV2P2I6Ett5BQYP4KlQ0MlgyFyn1FyX+Mlwi1XFe0Fy3wqfg9V6e2PkzO9mEHz+Cgp7dO.
    


  • Hi guys
    If we put an if / else statement to this code, it doesn't accept the values.
    I mean we have a combobox and it has 3 states. Each state will define different max & min values. The One Knob controll this parameters acording to combobox selection that defines min / max values.

    @Christoph-Hart @d-healey What am I missing?

    Content.makeFrontInterface(600, 300);
    
    const var Knob4 = Content.getComponent("Knob4");
    const var Knob3 = Content.getComponent("Knob3");
    const var Knob2 = Content.getComponent("Knob2");
    const var ComboBox1 = Content.getComponent("ComboBox1");
    
    
    inline function normalisedToRange(normalisedValue, min, max)
    {
        return min + normalisedValue * (max - min);
    }
    
    inline function onKnob1Control(component, value)
    {
        
    if(ComboBox1 == 1)
      {   
    	local v1 = normalisedToRange(value, 0, -58);
    	local v2 = normalisedToRange(value, -3, 10);
    	local v3 = normalisedToRange(value, 1, 100);
    	
    	Console.print("v1: " + v1);
    	Console.print("v2: " + v2);
    	Console.print("v3: " + v3);
    	Console.print("----");
    	
    	
    	Knob4.setValue(v1);
    	Knob3.setValue(v2);
    	Knob2.setValue(v3);	
     	}
    		
    	
    if(ComboBox1 == 2)
     {   
    	local v1 = normalisedToRange(value, 0, -18);
    	local v2 = normalisedToRange(value, -3, 18);
    	local v3 = normalisedToRange(value, 1, 18);
    	
    	Console.print("v1: " + v1);
    	Console.print("v2: " + v2);
    	Console.print("v3: " + v3);
    	Console.print("----");
    	
    	
    	Knob4.setValue(v1);
    	Knob3.setValue(v2);
    	Knob2.setValue(v3);
    		
     	}
    		
    if(ComboBox1 == 3)
       {   
    	local v1 = normalisedToRange(value, 0, -65);
    	local v2 = normalisedToRange(value, -3, 28);
    	local v3 = normalisedToRange(value, 1, 28);
    	
    	Console.print("v1: " + v1);
    	Console.print("v2: " + v2);
    	Console.print("v3: " + v3);
    	Console.print("----");
    	
    	
    	Knob4.setValue(v1);
    	Knob3.setValue(v2);
    	Knob2.setValue(v3);
    	
    	
    }
    	
    	
    	
    	
    };
    
    Content.getComponent("Knob1").setControlCallback(onKnob1Control);
    

    This is the snippet

    HiseSnippet 1175.3oc2WEzaaaCElJIZo1YYnEXmKHB5Amsj.KojrzUTTm3jLXjkDi5rfsSsLRzwDQhzPh1KFAAnW5+qbZ+N18co+C1dTR1h1Q10Z.8RkEBB4688de7iTjO1LT3RihDgHiRWLnKEY7slsFvkcp2gv3nFGhLJad9YGcxYmefE5fAcIQQTOjgwh+hxtQokPwOe5MGP7IbWZVWHzkBl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ksK6.WH4QEXCk4K754SjiW6u5BOoFTbUuHaUgzbXLLPen9E4BAyKcelYSlzsS97cgb3K7Y1WZ9ld8pUMOpcapqLirKYd7u++8tT4eUup4Qk2J5IY7qOkHCYpkCm0KnEbaSWJvDNm5qNPvXA0R+j1UUsUJSKJ2Ktw+BOoFsTsMRMZMzHJf3FJdmaxlepKv8j3d.NwiuGaIySUswi1uSwU3q.16bcUBwlfHlOB6BivovH1tvH1ovH1svH9oBiXuYfPcE986IEAIeVfP+GjEnFVN
    


  • Combobox.getValue()



  • This post is deleted!


  • Ah ok I get it. Thank you so much... @Christoph-Hart

    if(ComboBox.getValue() != 0)
        {
        }
    if(ComboBox.getValue() != 1)
        {
        }
    if(ComboBox.getValue() != 2)
        {
        }
    
    


  • How would you add to this so that which ever knob you turned, the others were linked? So the lord of the knobs was actually all of the individual knobs? Maybe selectable with a link button?



  • @duno You can link this LOTK to whatever parameter that you want like this for example;

    Dynamics.setAttribute(Dynamics.CompressorThreshold, v1);
    
    


  • Yeah, I mean say if you have 2 samplers, compressor on each, and two knobs controlling the threshold on each of the compressors. I’ve figured out how to link those controls to one knob, or have another knob (the lord of the knobs), to control them both, but what if you wanted to select a link button which then allows you to move either of the two threshold knobs and it updates the other as well? Does that make sense? I haven’t really played around yet trying to figure it out, just thinking out loud!



  • I've laid out a script below that I'd use in KSP to do what I mean. Finding it so difficult to translate everything to JavaScript! I found what you've done above really helpful, but not sure about how to alter it to relate to each knob. Is the thinking the same as in KSP? Or is it done differently? I'd do the below twice relating to the two separate knobs controlling the release, with a button controlling the link. Be super grateful if someone could guide us a little!

    
    on ui_control($knb_rls1)
    
        $i := 0
        $j := 0
    
        select($swi_link_rls)
            case 0
                while($j < $Channels)
                    while($i < num_elements(%CH1))
                        set_engine_par($ENGINE_PAR_RELEASE, $knb_rls1, ($groups * $j) + %CH1[$i], 0, -1)
                        inc($i)
                    end while
                    inc($j)
                    $i := 0
                end while
            case 1
                while($j < $Channels)
                    while($i < num_elements(%CH1))
                        set_engine_par($ENGINE_PAR_RELEASE, $knb_rls1, ($groups * $j) + %CH1[$i], 0, -1)
                        inc($i)
                    end while
                    $i := 0
                    while($i < num_elements(%CH2))
                        set_engine_par($ENGINE_PAR_RELEASE, $knb_rls1, ($groups * $j) + %CH2[$i], 0, -1)
                        $knb_rls2 := $knb_rls1
                        inc($i)
                    end while
                    inc($j)
                    $i := 0
                end while
        end select
    end on
    
    


  • Hi @duno
    I don't have any experience with KSP. but @d-healey is the pro for KSP. you may ask to him.



  • @duno There are a few ways to do this. This is the first method that came to mind for me (I use simpleGain instead of compressor but you can use any FX you want).

    HiseSnippet 1242.3oc6X0saZbDEdVvqSgVhhi5CvHeEnj5rfSRqjqUHfsiPw+fJ1tsJJJcX2YgQL6Lq1c1TnQVpuFsW2Whdmej5aP67yBrXiIPUZTsTlKr7YNmyLemyb9aocD2EGGyi.VENcTHFX8E1cFwD8a1GQXfV6ArV2tKE0GzXTHJNF6Arrx+BEOqBqAzq+5YMPTDyEOcK.3bNwEeHIfHlta65ujPoGf7vmRBxH8iq2xkyZxo7DINxa6.BQtCP8vGiThkyVBh88HBdTGARfikxzf6MpSe9OyLxeNIlzkhUDUAcjGjYaPy9DpW6w1XL.XsV6oVbdiE+k1GQ7HS1epkeOMC3TMx5CrxMKjVaFHU8lfzAbpm5.tA3YkAdqYf2F1cbiHghobTX6ysawD3HejzsmEVFYA49i71M4RIXhsBPCvGDIIlnQ4m537P3SbbprSohkJFg6AI5+S9LDKfuEEA8GB2E9pWK20e3qbdsjPGVrUOrXeeerqn7lcHAgTLTELrYEifUeeBVayJW4h5JXGRXCj5MFuRMaxCB4LIQ4MajHDbV0qo2.Fua7XLpILvb9mxKkBXNCinUWrnig43ycqXkHLQDm1DQockgmkU7Z1H6QtXoJUjvnDFF5mvbEDNCZ3U10nxCklEMAWoTw2UpHTtnbWDER7TuD5qXKByCO7D+wZnNUkfl+R7gkSclJK5b0gUtBb2cgNUfO5Qo.KFx3BnDGCvdF8RuM0R9BJuN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