frac32buffer i1
frac32buffer o1
frac32.u.map saturate
frac32.u.map volume
frac32.s.map.pitch rate
int32_t out;
int32_t val1;
int32_t val2;
int32_t val3;
int32_t val4;
int32_t in[4];
int32_t prev;
int32_t diff;
int32_t freq;
MTOFEXTENDED(param_rate, freq)
// diff=(inlet_i1-prev)>>2;
in[0] = prev + ((inlet_i1 - prev) >> 2);
in[1] = prev + ((inlet_i1 - prev) >> 1);
in[2] = prev + (inlet_i1 - prev) * 3 / 4;
in[3] = inlet_i1;
out = (in[0] >> 2) > ___SMMUL(val1 << 3, (1 << 27) - param_saturate << 2)
? (param_volume)
: -(param_volume);
val1 = ___SMMLA((out - val1) << 1, freq, val1);
out = (in[1] >> 2) > ___SMMUL(val1 << 3, (1 << 27) - param_saturate << 2)
? (param_volume)
: -(param_volume);
val1 = ___SMMLA((out - val1) << 1, freq, val1);
out = (in[2] >> 2) > ___SMMUL(val1 << 3, (1 << 27) - param_saturate << 2)
? (param_volume)
: -(param_volume);
val1 = ___SMMLA((out - val1) << 1, freq, val1);
out = (in[3] >> 2) > ___SMMUL(val1 << 3, (1 << 27) - param_saturate << 2)
? (param_volume)
: -(param_volume);
val1 = ___SMMLA((out - val1) << 1, freq, val1);
val2 = ___SMMLA((val1 - val2) << 1, freq, val2);
outlet_o1 = val2;
prev = inlet_i1;