dualvcf3

4-pole (instead of 2-pole) resonant low-pass filter (biquad), filter updated at k-rate added a softdrive between the two filters two prevent too loud/wrapping signals
Author: Johannes Taelman edit by Remco van der Most
License: BSD
Github: sss/filter/dualvcf3.axo

Inlets

frac32 pitch

frac32 filter resonance

frac32buffer filter input

Outlets

frac32buffer filter output

Parameters

frac32.s.map pitch

frac32.u.map.filterq reso

Declaration
data_filter_biquad_A fd[2];
Init
init_filter_biquad_A(&fd[0]);
init_filter_biquad_A(&fd[1]);
Control Rate
{
  int32_t freq;
  MTOF(param_pitch + inlet_pitch, freq);
  f_filter_biquad_A(&fd[0], inlet_in, outlet_out, freq,
                    INT_MAX - (__USAT(inlet_reso + param_reso, 27) << 4));
  for (int i = 0; i < BUFSIZE; i++) {
    int32_t ts = __SSAT(outlet_out[i], 28);
    int32_t tsq31 = ts << 3;
    int32_t tsq31p3 = ___SMMUL(tsq31, ___SMMUL(tsq31, tsq31));
    outlet_out[i] = ts + (ts >> 1) - (tsq31p3) >> 1;
  }
  f_filter_biquad_A(&fd[1], outlet_out, outlet_out, freq,
                    INT_MAX - (__USAT(inlet_reso + param_reso, 27) << 4));
}

Privacy

© 2024 Zrna Research