LPos

oversampled 2nd order LP filter. 2 modes for resonance: off=normal on=resonance is ringmodulated with itself (kind of resonance octaver)
Author: Remco van der Most
License: BSD
Github: sss/filter/LPos.axo

Inlets

frac32buffer input

frac32 cutoff frequency

frac32 res

bool32 mode

Outlets

frac32buffer output

Parameters

frac32.s.map res

bool32.tgl mode

frac32.s.map.pitch cut

Declaration
int32_t val;
int32_t vol;
int32_t prev;
int32_t prav;
int32_t priv;
int i;
int32_t res;
int32_t HP;
int32_t sat;
Init
val = 0;
Control Rate
int32_t f;
MTOF(param_cut + (inlet_cut << 1), f);
int mode = (param_mode + inlet_mode) & 1;
Audio Rate
int32_t in = inlet_in + sat;
val = ___SMMLA(((in + prev >> 1) - val) << 1, f >> 1, val);
val = ___SMMLA((in - val) << 1, f >> 1, val);
vol = ___SMMLA(((val + prev >> 1) - vol) << 1, f >> 1, vol);
vol = ___SMMLA((val - vol) << 1, f >> 1, vol);

outlet_out = val;
int32_t temp;
if (mode == 0) {
  temp = vol;
}
if (mode == 1) {
  temp = ___SMMUL(vol << 3, vol << 3);
}
res = ___SMMLA(((temp + priv >> 1) - res) << 1, f >> 1, res);
res = ___SMMLA(((temp)-res) << 1, f >> 1, res);
sat = __SSAT(___SMMUL(temp - res << 4, (param_res + inlet_res) << 4), 27);
prev = inlet_in;
prav = val;
priv = temp;

Privacy

© 2024 Zrna Research