Invert value in delay time sync



  • Ok, this one is pretty obvious, I guess, but here I go! I'm trying to assign a knob to delay time and have it work not from 1/1 to 1/64T but the other way around. And for some reason

    inline function onDelayTimeControl(component, value)
    {
            Delay1.setAttribute(0, 1 - value); // left
            Delay1.setAttribute(1, 1 -value); // right
    };
    
    Content.getComponent("DelayTime").setControlCallback(onDelayTimeControl);
    

    ...doesn't seem to work.

    Delay Time is a knob going from 0 to 18. What obvious am I missing this time? 😉



  • @tomekslesicki If the knob goes from 0-18 then 1-value isn't going to work.

    Write out the result for each knob value and you'll see the problem.

    If the knob value is 1, then 1 - 1 = 0
    If the knob value is 2 then 1 - 2 = -1
    etc.



  • Ah, ok, this makes sense now! Thanks again!


Log in to reply
 

15
Online

648
Users

2.6k
Topics

21.5k
Posts