saturatorSt

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

Inlets

frac32buffer inL

frac32buffer inR

Outlets

frac32buffer outL

frac32buffer outR

Parameters

frac32.u.map.gain16 amp

frac32.u.map strength

frac32.u.map max

Declaration
int i;
Audio Rate
int32_t In = ___SMMUL(param_amp, inlet_inL << 4) << 1;
int32_t in = __SSAT(In, 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);
pos = (1 << 27) - ccomp;
outlet_outL = ___SMMUL(
    param_max << 3,
    ___SMMUL(ccomp << 3, In << 1) + ___SMMUL(pos << 2, (dir << 27) << 2) << 3);

In = ___SMMUL(param_amp, inlet_inR << 4) << 1;
in = __SSAT(In, 28);
pos = in > 0 ? in : -in;
dir = in > 0 ? 1 : -1;
ccomp = (1 << 27) - pos;
temp = param_strength;
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);
pos = (1 << 27) - ccomp;
outlet_outR = ___SMMUL(
    param_max << 3,
    ___SMMUL(ccomp << 3, In << 1) + ___SMMUL(pos << 2, (dir << 27) << 2) << 3);

Privacy

© 2024 Zrna Research