chamSVF

multimode chamberlin based svf filter 2 extra parameters: drop&spread -drop can remove the volume drop in the passband when resonance is high -spread spreads the upper and lower cutoff bands -for notch, use a low resonance value to have a noticable dip in the audio spectrum
Author: Remco van der Most
License: BSD
Github: sss/filter/chamSVF.axo

Inlets

frac32buffer filter input

frac32 pitch

frac32 resonance

frac32 drop

frac32 spread

Outlets

frac32buffer filter output

frac32buffer hp

frac32buffer bp1

frac32buffer bp2

frac32buffer no1

frac32buffer no2

Parameters

frac32.u.map.filterq reso

frac32.u.map drop

frac32.s.map spread

frac32.s.map.pitch pitch

Declaration
int32_t low;
int32_t band;
int32_t prv;
Init
low = 0;
band = 0;
Control Rate
int32_t drop = __USAT(inlet_drop + param_drop, 27) << 4;
int32_t res = (__USAT(inlet_reso + param_reso, 27) << 4);
int32_t spread = __SSAT(inlet_spread + param_spread, 28);
int32_t damp = (0x80 << 24) - res;
damp = ___SMMUL(damp, damp);
res = ___SMMUL(res, res) << 1;
int32_t alpha;
int32_t freq1, freq2;
MTOFEXTENDED(__SSAT(param_pitch + inlet_pitch + spread, 28), alpha);
SINE2TINTERP(alpha, freq1);
MTOFEXTENDED(__SSAT(param_pitch + inlet_pitch - spread, 28), alpha);
SINE2TINTERP(alpha, freq2);
drop = ___SMMUL(drop, res) << 1;
Audio Rate
int32_t in = inlet_in + ___SMMUL(drop, inlet_in << 1);
int32_t dif = in - prv >> 1;
prv += dif;
int32_t high;
for (int i = 0; i < 2; i++) {
  prv += i * dif;
  low = low + (___SMMUL(freq1, band) << 1);
  high = (___SMMUL(damp, prv - band) << 1) - low + ___SMMUL(drop, prv);
  band = (___SMMUL(freq2, high) << 1) + band -
         (___SMMUL(band, ___SMMUL(band, band) << 5) << 2);
}

outlet_lp = low;
outlet_bp1 = band;
outlet_bp2 = inlet_in + band;
outlet_hp = high;
outlet_no1 = inlet_in - band >> 1;
outlet_no2 = low + high;

prv = in;

Privacy

© 2024 Zrna Research