[FR] make dsp::Oscillator's linearSmoothedValue public

#1

so we can modify the duration when we change frequencies. I’m currently implementing my own value smoother and calling osc.setFrequency(freq, true) to do the smoothing. It would be so much easier if we could access the LinearSmoothedValue<> instance in the dsp::Oscillator class instead of having to roll our own.

0 Likes

#2

If making this public is a bad idea, how about changing setFrequency to be:

void setFrequency (NumericType newFrequency, NumericType changeDurationMS) noexcept    { 
    if( changeDurationMS == 0 )
        frequency.setValue (newFrequency, true); 
    else
    {
        frequency.reset(sampleRate, changeDurationMS / static_cast<NumericType>(1000) );
        frequency.setValue( newFrequency, false );
    }
}
0 Likes