dirtSVF

multimode filter, state-variable type. "mode" morphs through the filter types circularly, while "width" controls the distance from center mix. "x" and "y" inputs can offset the circular motion. bandpass gain can be increased, forcing it to clip the signal. "Spread" creates a difference between cutoff frequencies when incoming signal is higher or lower then the output signal.
Author: Remco van der Most
License: BSD
Github: sss/filter/dirtSVF.axo

Inlets

frac32buffer filter input

frac32 cut

frac32 reso

frac32 mode

frac32 width

frac32 x

frac32 y

frac32 gain

Outlets

frac32buffer filter output

Parameters

frac32.u.map gain

frac32.u.map mode

frac32.s.map.pitch cut

frac32.s.map spread

frac32.s.map width

frac32.u.map.filterq reso

Declaration
int32_t low;
int32_t band;
int32_t ratio;
float32_t R;
int32_t out1;
Init
low = 0;
band = 0;

SINE2TINTERP(1 << 29, ratio)
R = (float32_t)(1 << 27) / (ratio >> 4);
Control Rate
int32_t damp = (0x80 << 24) - (param_reso + inlet_reso << 4);
damp = ___SMMUL(damp, damp);
int32_t alpha;
int32_t freq;
MTOFEXTENDED(param_cut + inlet_cut - (param_spread >> 3), alpha);
SINE2TINTERP(alpha, freq);
int32_t Alpha;
int32_t Freq;
MTOFEXTENDED(param_cut + inlet_cut + (param_spread >> 5), Alpha);
SINE2TINTERP(Alpha, Freq);

int32_t x;
int32_t y;
SINE2TINTERP(param_mode + inlet_mode - (1 << 25) << 5, x)
SINE2TINTERP(param_mode + inlet_mode << 5, y)
int32_t width = param_width + inlet_width;
x = __SSAT((inlet_x << 3) + ___SMMUL(x, R *(width << 4)), 31) + (1 << 30) >> 1;
y = __SSAT((inlet_y << 3) + ___SMMUL(y, R *(width << 4)), 31) + (1 << 30) >> 1;
int32_t X = (1 << 30) - x;
int32_t Y = (1 << 30) - y;
int32_t gain = inlet_gain + param_gain;
Audio Rate
int32_t in1 = inlet_in;
int32_t FREQ = inlet_in > out1 ? freq : Freq;
band = band + ___SMMUL(band << 2, ___SMMUL(gain << 4, alpha) << 2);
int32_t notch = __SSAT(inlet_in - (___SMMUL(damp, band) << 1), 28);
low = __SSAT(low + (___SMMUL(FREQ, band) << 1), 28);
int32_t high = __SSAT(notch - low, 28);
band = __SSAT((___SMMUL(FREQ, high) << 1) + band, 28);
out1 = ___SMMUL(___SMMUL(high, x) + ___SMMUL(band, X) << 2, y);
out1 += ___SMMUL(___SMMUL(notch, x) + ___SMMUL(low, X) << 2, Y);
outlet_out = out1 << 2;

Privacy

© 2024 Zrna Research