36dbLP

36dB filter with resonance
Author: Remco van der Most
License: BSD
Github: sss/filter/36dbLP.axo

Inlets

frac32buffer in2

frac32 cut

frac32 res

Outlets

frac32buffer out

Parameters

frac32.u.map cut

frac32.u.map res

Declaration
int32_t val1;
int32_t val2;
int32_t val3;
int32_t val4;
int32_t val5;
int32_t val6;
int32_t valres;
int32_t valsat;
Init
val1 = 0;
val2 = 0;
val3 = 0;
val4 = 0;
val5 = 0;
val6 = 0;
Control Rate
int32_t f;
MTOF((param_cut + inlet_cut), f);
Audio Rate
valsat = ___SMMUL((inlet_in - val6) << 3, (param_res + inlet_res) << 3);

int32_t ts = __SSAT(valsat, 28);
int32_t tsq31 = ts << 3;
int32_t tsq31p3 = ___SMMUL(tsq31, ___SMMUL(tsq31, tsq31));
valres = ts + (ts >> 1) - (tsq31p3);

val1 = ___SMMLA(((inlet_in + valres) - val1) << 1, f, val1);
val2 = ___SMMLA((val1 - val2) << 1, f * 1.3, val2);
val3 = ___SMMLA((val2 - val3) << 1, f * 1.45, val3);
val4 = ___SMMLA((val3 - val4) << 1, f * 1.65, val4);
val5 = ___SMMLA((val4 - val5) << 1, f * 1.8, val5);
val6 = ___SMMLA((val5 - val6) << 1, f * 1.9, val6);
outlet_out = val6;

Privacy

© 2024 Zrna Research