frac32buffer in
frac32buffer out
bool32.tgl halfout
frac32.u.map gain
frac32.u.map clipH
frac32.u.map clipL
frac32.u.map strength
int32_t pv1;
int32_t pv2;
float32_t STR = param_strength >> 5;
STR = 3 + STR / (1 << 16);
int32_t in = inlet_in;
in += ___SMMUL(in << 3, param_gain << 4);
int32_t A = in;
int32_t clipH = param_clipH - (param_gain >> 2);
clipH = ___SMMUL(clipH << 3, clipH << 2);
int32_t clipL = param_clipL - (param_gain >> 2);
clipL = ___SMMUL(clipL << 3, clipL << 2);
A = A > clipH ? clipH : A;
A = A < -clipL ? -clipL : A;
int32_t B = in - A;
int32_t r1;
if (B > 0) {
SINE2TINTERP(((int32_t)((B >> 5) * STR) << 5) + (1 << 31), r1)
} else {
SINE2TINTERP(((int32_t)((B >> 5) * STR) << 5) - (1 << 31), r1)
}
r1 = (r1 >> 2) / STR;
// r1=___SMMUL(r1>>1,(1<<27)-(param_gain>>2)<<2);
outlet_out = A - r1 >> param_halfout;