BiQmd

2-pole resonant filter (biquad) 4 modes and two different outputs: 0=off 1=LP/lowshelf 2=HP/highshelf 3=BP/parametric
Author: Johannes Taelman (edit by Remco van der Most)
License: BSD
Github: sss/filter/BiQmd.axo

Inlets

frac32 pitch

frac32 filter resonance

int32 m

frac32buffer filter input

Outlets

frac32buffer m

frac32buffer filter output

Parameters

frac32.s.map.pitch p

frac32.u.map.filterq r

frac32.s.map g

int32.hradio m

Declaration
biquad_state bs;
biquad_coefficients bc;
int32_t out;
Init
biquad_clearstate(&bs);
Control Rate
int a = (param_m + inlet_m) & 3;
if (a > 0) {
  int32_t freq;
  MTOF(param_p + inlet_p, freq);
  if (a == 1)
    biquad_bp_coefs(&bc, freq, INT_MAX - (__USAT(inlet_r + param_r, 27) << 4));
  if (a == 2)
    biquad_lp_coefs(&bc, freq, INT_MAX - (__USAT(inlet_r + param_r, 27) << 4));
  if (a == 3)
    biquad_hp_coefs(&bc, freq, INT_MAX - (__USAT(inlet_r + param_r, 27) << 4));
  biquad_dsp(&bs, &bc, inlet_i, outlet_m);
}
Audio Rate
if (a > 0) {
  outlet_s = ___SMMUL(param_g << 4, outlet_m << 3) + inlet_i;
} else {
  outlet_s = inlet_i;
  outlet_m = inlet_i;
}

Privacy

© 2024 Zrna Research