LinearSmoothedValue - weirdness or misunderstanding?


#1

I have a 8 LSVs smoothing out a punch of paramaters… two of them behave weirdly.

If I step into the SetValue() method, the countdown isn’t consinsistent

    void setValue (FloatType newValue, bool force = false) noexcept
{
    if (force)
    {
        target = currentValue = newValue;
        countdown = 0;
        return;
    }

    if (target != newValue)
    {
        target = newValue;
        countdown = stepsToTarget; // stepsToTarget is always right, but countdown, after assignment, is sometimes right, sometime
        // and then...

        if (countdown <= 0)
            currentValue = target;
        else
            step = (target - currentValue) / (FloatType) countdown; // countdown is always wrong here
    }
}

In my current example that I’ve stepped into, stepsToTarget = 684, countdown = 642 ?

I’m I mis-understanding something here?