notchDuck

2-pole resonant band-pass filter (biquad)
Author: Johannes Taelman
License: BSD
Github: sss/filter/notchDuck.axo

Inlets

frac32buffer filter input

frac32buffer add

frac32 pitch

frac32 filter resonance

frac32 duck

Outlets

frac32buffer filter output

Parameters

frac32.s.map.pitch pitch

frac32.u.map.filterq reso

Declaration
biquad_state bs;
biquad_coefficients bc;
int32_t prev;
int32_t step;
int32_t out[BUFSIZE];
int i;
Init
biquad_clearstate(&bs);
Control Rate
int32_t freq;
MTOF(param_pitch + inlet_pitch, freq);
biquad_bp_coefs(&bc, freq,
                INT_MAX - (__USAT(inlet_reso + param_reso, 27) << 4));
biquad_dsp(&bs, &bc, inlet_in, out);
step = (inlet_duck - prev) >> 4;
int32_t j = prev;
prev = inlet_duck;

for (i = 0; i < BUFSIZE; i++) {
  j += step;
  outlet_out[i] = inlet_add[i] + inlet_in[i] - ___SMMUL(out[i] << 2, j << 3);
}

Privacy

© 2024 Zrna Research