AP2

2nd order ALLPASS biquad filter with resonance at 0 (=equal slope). LP-HP
Author: Johannes Taelman
License: BSD
Github: sss/filter/AP2.axo

Inlets

frac32buffer input

frac32 cutoff frequency

Outlets

frac32buffer output

Parameters

frac32.s.map.pitch freq

Declaration
biquad_state bsl;
biquad_coefficients bcl;
biquad_state bsh;
biquad_coefficients bch;
int32_t tmp[BUFSIZE];
Init
biquad_clearstate(&bsl);
biquad_clearstate(&bsh);
Control Rate
int32_t f;
MTOF(param_freq + inlet_freq, f);
biquad_hp_coefs(&bch, f, INT_MAX);
biquad_lp_coefs(&bcl, f, INT_MAX);
biquad_dsp(&bsh, &bch, inlet_in, tmp);
biquad_dsp(&bsl, &bcl, inlet_in, outlet_out);
for (int i = 0; i < BUFSIZE; i++) {
  outlet_out[i] -= tmp[i];
}

Privacy

© 2024 Zrna Research