in upcoming version (current master branch), there are now two controllable filter stages: one before the write head, one after the playback head.
both have identical topologies: 2nd-order state variable. each filtering stage puts out an arbitrary blend of lowpass, highpass, bandpass, band-reject and dry signal.
the “mod” parameter is a little weird and deserves a special explanation. it applies only to the pre-filter. the preFcMod parameter (normally in [0, 1]) allows the cutoff frequency to be affected by the rate parameter. this “modulation” can only decrease the filter FC, not increase it.
psuedo-code:
fcModValue = min(fcBase, fcBase * abs(rate))
fcValue = (fcModValue * fcModAmount) + (fcBase * (1 - fcModAmount))
there is a specific reason to have this: if you set the rate below 1.0 when writing to the buffer, you are effectively decreasing the sample rate of the material in the buffer.
at the extreme, when (say) sweeping the rate from positive to negative, rate ~=0 means effectively
sr ~=0, and any values written there will cause a nasty click when played back at higher speeds.
so, if you set up the pre-filter as follows:
- dry mix = 0
- lowpass mode = 1
- all other modes = 0
- base frequency at, say, 12k or 16k or something (well below nyquist, to accommodate shallow rolloff of 2nd-order SVF)
- rq = 1
- fcMod = 1
then the pre-filter acts as a fairly effective antialiasing device when changing the rate.
this isn’t “needed” in the post-filter.
also i should note that there’s no smoothing of filter parameters at the moment. this could be added… problem is the coefficient update method is rather heavy. so will take some work, like (a) profiling individual ops in coeff update on ARM (tan function) and making approximations / refactors as appropriate, and/or (b) downsampling the filter parameter signals (except when modulated, so… kinda tricky)… or maybe weirder things like smoothing the coefficients directly after calculation… i intend to try some of this stuff on the postfilter (no mod) and profile.