mostFilter2

Custom designed 2-stage filter with crossfade between LP, BP and HP using the "mode" control. 2nd input is an inversed input with inversed filter effects: HP, NOTCH and LP respectively. The "mod" control is an extra filter control, softening the sound, though distorting at higher mod and resonance settings with higher frequencies. It came as a possible extra control within the design..
Author: Remco van der Most
License: BSD
Github: sss/filter/mostFilter2.axo

Inlets

frac32buffer in

frac32buffer iv

frac32buffer freq

frac32 pitch

frac32 env

frac32 resonance

frac32 mode

frac32 Mod

Outlets

frac32buffer output

Parameters

frac32.s.map freq

frac32.s.map env

frac32.u.map resonance

frac32.u.map mode

frac32.u.map Mod

Declaration
int32_t val;
int32_t rate;
int32_t diff;
int32_t Res;
Init
val = 0;
rate = 0;
Control Rate
int32_t resonance = (1 << 27) - __USAT(param_resonance + inlet_resonance, 28);
resonance = ___SMMUL(resonance << 2, resonance << 2);
int32_t mode = param_mode + inlet_mode & ((1 << 28) - 1);
mode = mode > (1 << 27) ? (1 << 28) - mode : mode;
int32_t Mod = param_Mod + inlet_Mod & ((1 << 28) - 1);
Mod = Mod > (1 << 27) ? (1 << 28) - Mod : Mod;
Audio Rate
int32_t in;
in = (inlet_in - inlet_iv);
diff = in - val;
int32_t f;
MTOF(param_freq + inlet_pitch + ___SMMUL(inlet_env << 4, param_env << 2) +
         inlet_freq - ___SMMUL(((diff > 0 ? diff : -diff)) << 3, Mod << 1),
     f);

rate = ___SMMLA((diff) << 1, f, rate);
int32_t temp = ___SMMUL(rate << 3, ((1 << 20) + resonance) << 2);
Res = ___SMMLA((temp - Res) << 1, f >> 2, Res);
rate = rate - (temp - Res);
val += rate;
outlet_out = (val - ___SMMUL(in << 3, mode << 2) + (inlet_iv)) >> 1;

Privacy

© 2024 Zrna Research