This means that a "slew time" less than half of the samplerate period (1 / samplerate) will output a coeff that is greater than 1.
At coeff=1, the filter is essentially bypassed. Beyond that, it will not function properly as a filter, and will balloon toward infinity.
I see two possible solutions, and it may be worth employing both:
add a clamp so that it will cap out at 1.0 regardless of settings (bonus: could add retvals to alert users if there target slew is out of range, among other errors).
add a "SetCoeff" that bypasses that calculation.
The second option would also require revisiting the SetSampleRate function as that recalculates the coeff based on samplerate and slew_seconds. (Weirdly, it looks like bipolar CVs have their slew locked at 0.002, that should probably be able to change..)
The coeff is calculated as:
1.0 / (slew_seconds * samplerate_ * 0.5f)
This means that a "slew time" less than half of the samplerate period (1 / samplerate) will output a coeff that is greater than 1.
At coeff=1, the filter is essentially bypassed. Beyond that, it will not function properly as a filter, and will balloon toward infinity.
I see two possible solutions, and it may be worth employing both:
The second option would also require revisiting the
SetSampleRate
function as that recalculates the coeff based on samplerate and slew_seconds. (Weirdly, it looks like bipolar CVs have their slew locked at 0.002, that should probably be able to change..)