filtortion

Filter that has it's origin in a modification of the envelope follower in the "compressor" module.. -Independent rise/fall (cutoff) offset slopes -Input "Greater/smaller then" filter adjustment of rise/fall switching -Switching between greater/smaller adjustment is smoothed by "smooth" parameter resonance... ghehehehe... let it snow, let it snow, let it snoooooooow XD
Author: Remco van der Most
License: BSD
Github: sss/filter/filtortion.axo

Inlets

frac32buffer input

frac32 pitch

frac32 up

frac32 down

frac32 P

frac32 N

Outlets

frac32buffer output

Parameters

frac32.s.map.pitch pitch

frac32.s.map up

frac32.s.map down

frac32.s.map P

frac32.s.map N

frac32.u.map.squaregain res

frac32.u.map.kdecaytime.reverse smooth

Declaration
int32_t val;
int32_t vbl;
bool trg;
int32_t P;
int32_t N;
int32_t ofs;
int32_t hp;
int32_t tmp;
int32_t OFS;
int32_t Ofs;
Init
val = 0;
Control Rate
int32_t pitch = __SSAT(param_pitch + inlet_pitch, 28);
Audio Rate
OFS += ___SMMUL(param_smooth, ofs - OFS) << 1;
if ((inlet_in > val) && !trg) {
  trg = 1;
  ofs = param_P + inlet_P;
  Ofs = OFS;
} else if ((inlet_in < val) && trg) {
  trg = 0;
  ofs = param_N + inlet_N;
  Ofs = OFS;
}
Ofs -= ___SMMUL(Ofs, param_smooth) << 1;
int32_t f1;
int32_t f2;
MTOF(__SSAT(pitch + param_up + inlet_up + Ofs, 29), f1);
MTOF(__SSAT(pitch + param_down + inlet_down + Ofs, 29), f2);
if (inlet_in > val) {
  val = ___SMMLA((__SSAT(inlet_in + ___SMMUL(param_res, -tmp << 1), 28) - val)
                     << 1,
                 f1, val);
} else {
  val = ___SMMLA((__SSAT(inlet_in + ___SMMUL(param_res, -tmp << 1), 28) - val)
                     << 1,
                 f2, val);
}

hp += (val - hp) >> 9;
tmp = outlet_out = val - hp;
if (tmp > vbl) {
  vbl = ___SMMLA((tmp - vbl) << 1, f1, vbl);
} else {
  vbl = ___SMMLA((tmp - vbl) << 1, f2, vbl);
}
tmp = -__SSAT(tmp - vbl, 26) << 3;

Privacy

© 2024 Zrna Research