1 knob - 2 values



  • is there a way a having a knob with two values?

    example: -10, +10 (so when you move it left is minus(-), when move it right plus(+).

    I'm doing this but is not working:

    inline function onKnobNameControl(component, value)
    {
    local index = EQ.Gain + 1 * EQ.BandOffset;
    EQ.setAttribute(index, value*-5); // for negative values
    EQ.setAttribute(index, value*5); // for positives values
    };
    Content.getComponent("KnobName").setControlCallback(onKnobNameControl);



  • Simply set these values in the knob property editor for min/max

    Then EQ.setAttribute(yourIndex, value) will work as expected



  • Notice that if your knob is only controling one thing, you can simply connect it directly from the property editor to you EQ, so you don't even need a custom callback and find the index...

    But be careful , it doesn't work if you want to connect it somewhere else at the same time, or add something else to control (like updating a label)... for this, effectively a custom callback is necessary
    And keep in mind you need to remove the connection from the property editor if you want to create a custom callback afterward (both are not allowed at the same time)



  • @ustk the reason I'm using a callback is because I'm using the same EQ to do some else



  • @Jay said in 1 knob - 2 values:

    @ustk the reason I'm using a callback is because I'm using the same EQ to do some else

    You can use the EQ to do many things even if the knob is linked via the property editor. But the knob can only do one thing.



  • @d-healey I got it figure it out.



  • @d-healey can you tell me what might be wrong with this? Because when I add the 2nd set of frequencies it stop working.

    const var EQ = Synth.getEffect("EQ"); // (1) instance of the EQ

    // ----- Low Shelf Gain
    inline function onlgKnbControl(component, value)
    {
    local index = EQ.Gain + 1 * EQ.BandOffset;
    EQ.setAttribute(index, value*-5); // I got this working
    Q.setAttribute(index, value*5); // I got this working
    };
    Content.getComponent("lgKnb").setControlCallback(onlgKnbControl);

    // ----- Low Cut [Frequencies]
    const var lcfreq = [12, 18, 24, 30, 36, 43, 54]
    inline function onlcKnbControl(component, value)
    {
    EQ.setAttribute(EQ.Freq + 0, lcfreq[value]);
    };
    Content.getComponent("lcKnb").setControlCallback(onxlcKnbControl);

    // ----- Low Shelf [Frequencies]
    const var lsfreq = [74, 84, 98, 116, 131, 166, 230, 361]
    inline function onlsKnbControl(component, value)
    {
    EQ.setAttribute(EQ.Freq + 1, lsfreq[value]);
    };
    Content.getComponent("lsKnb").setControlCallback(onlsKnbControl);

    Thanks in advance...



  • @Jay
    Are you trying to make something like that?

    You are using same local index for both parameters.

    HiseSnippet 960.3ocuV0saaaCElxwrcVaNnEXWOHDrKb1RCrRSZ6Pvvbi+YvqKIdycE8tVZJpXhPQ5IQkUihBr66KUeW5Cv1av1gTRQVopYwWr5bS347cN7iGdNehShUTVRhJF4z5oKWvPNeAd5Rodd+4DtDMd.xYS7wjDMK1KyzQKWPRRXAHGmM9QiAmVMQ1e+8ObDQPjTVoID5YJNk8y7Httz5jdOgKDiHArmxiVA898FSUx9JgJE3yF3tnED54jyXmPLvZfQN2ZX.WqhmpIZVBf4HUvxoyU+gLC+y3I7YBlYgOZJjnLyn9y4hfIEm0DDxo4jxS9FYm7uDeLOfeo8xJvcrN7JiX0ZfSipTpYEJ4+wnzHkHvjfOB8bVgdMyn2cwSow7E5ROFt843wR3xIj.k8UoUFVTiepAtuBPH06FQNmMJFVbYDc1ua2c77On61G11ssKT7SzdWPh8F9K9deumsQX2yX5gggLptyVf4s19PupXEm8D4L.cw1.36qhVnjvhNaY8tUV9M+wkBtj4ElJoZtR5ojVDlfiUhNzhH2AxsHksca2W21UnnDgGWFvdkgW.M10z548sdc89F6xiHxfSCCSX5Cq.eupv8qCdaWiI3+erVGymkpYcx1pBNXNw0CYuc7tWIl1tuAR20VGL4H+r1mHDyf96NUKAYkpUpOmnzrSkc1180tsbeyG3ILrNW4ISvhqyqYrK9ZBqiLMZFKt37miC5Dq1peqaVqNMqfrBPkbrjqOcAKec4vfeMCCn7JpYrHmf.TscnXy7ghoBd.KFwgjbarsbhrbOWb4kggeUOzuMd.QSJRCjQXWVvh0bygwY.6BPpJaVqEd.K4bsZgEa9kHxA+etou5R0r+7jdKKk1FzKhT5C808Pe3.NHynBREDcUsGSqatC3RpxPtYPVlv0KWUDdMDj5VqfTs2A2P5dW7DtlNud91nF9B2F+ey2b4813LYrRx1DO54eh0x2rn+peZ7Erg+tkGXLntTgHmjFMhK.UZfDXmFv4wnX0Mur0yzMaL3ma3cGzmZMrW0uFKCt+UMreog6XC4fUFQdmwvCJP79+5sVDO7p43QW0v2sZRc1359Fs+M+azneUkp4xyNl.ZtvvCFpJSgmFPYvUnTxDWVbxW20r1PhoLawB67Ovubm9l0N4N8Kb9IYOhHzX0KnYRWlNhOyZAN2R6CaZAuvBV64WnYYpGQvSNdAkZ5RuGzgWeD6s1Qb+0Nh8W6HNXsi3AqcDObsi3QWSDl2283TsJJSyBLLYn8aENNCkDna0NUh9Wf1zteJ
    


  • @orange No, I'm using the same parameter to control Gain and Frequency, but is two different thing 1 is gain 1 is freq, the first set of frequencies work well, the problem is after adding the second set of frequencies.

    But thanks man I can use this snippet you send me for a tilt plugin


Log in to reply
 

8
Online

544
Users

2.1k
Topics

16.2k
Posts