frac32buffer input
frac32buffer output
frac32.s.map.pitch cut
frac32.s.map.pitch smooth
frac32.u.map.gain gain
int32.hradio mode
int32_t val;
int32_t prev1;
int32_t prev2;
int32_t prev3;
int32_t diff1;
int32_t diff2;
int32_t diff3;
int32_t rate;
int32_t LP;
int32_t smooth;
int32_t HP;
val = 0;
LP = 0;
HP = 0;
int32_t in = inlet_in;
diff1 = in - prev1;
diff2 = diff1 - prev2;
diff3 = diff2 - prev3;
rate = ___SMMUL(
__SSAT(param_mode > 0 ? (param_mode > 1 ? diff3 << 3 : diff2) : diff1 >> 3,
24)
<< 8,
param_gain);
rate = rate > 0 ? -rate : rate;
int32_t g;
MTOF(param_smooth - rate, g)
smooth = __SMMLA((rate - smooth) << 1, g, smooth);
int32_t freq;
MTOF(param_cut + smooth, freq)
LP = __SMMLA((in - LP) << 1, freq, LP);
HP = HP + ((LP - HP) >> 12);
outlet_out = LP - HP;
prev1 = in;
prev2 = diff1;
prev3 = diff2;