saturator

inverse exponential saturator/hard limiter non-linear response
Author: Remco van der Most
License: BSD
Github: sss/dist/saturator.axo

Inlets

frac32buffer in

Outlets

frac32buffer out

Parameters

frac32.u.map strength

frac32.u.map max

frac32.u.map.gain16 amp

Audio Rate
int32_t In = ___SMMUL(param_amp, inlet_in << 4) << 1;
int32_t in = __SSAT(In << 1, 28);
int32_t pos = in > 0 ? in : -in;
int32_t dir = in > 0 ? 1 : -1;
int32_t ccomp = (1 << 27) - pos;
int32_t temp = param_strength;
int32_t itemp = (1 << 27) - temp;
temp = ___SMMUL(temp << 3, ccomp << 2);
itemp = itemp + temp;
ccomp = ___SMMUL(ccomp << 3, itemp << 2);
ccomp = ___SMMUL(ccomp << 3, itemp << 2);
ccomp = ___SMMUL(ccomp << 3, itemp << 2);
pos = (1 << 27) - ccomp;
outlet_out = ___SMMUL(
    param_max << 3,
    ___SMMUL(ccomp << 3, In << 2) + ___SMMUL(pos << 2, (dir << 27) << 2) << 3);

Privacy

© 2024 Zrna Research