frac32buffer lp
frac32buffer hp
frac32 cut
frac32buffer out
frac32.s.map sets modulation width of the cut-input
frac32.s.map controls character of resonance
frac32.u.map sets maximum changerate: linear filter
frac32.s.map.pitch sets cutoff frequency
int32_t prev;
int32_t get;
int32_t cnt;
int32_t val1;
int32_t val2;
int32_t filter;
int32_t increase;
int32_t Increase;
int32_t max;
int32_t f;
MTOF(param_cut + ___SMMUL(param_extCut << 4, inlet_cut << 2), f)
max = (param_max >> 4) + (1 << 17);
int32_t in = inlet_lp + inlet_hp +
___SMMUL(param_darkness << 2, (filter - inlet_hp) << 2);
cnt += 1;
if (!(prev == in)) {
val2 = val1;
val1 = in;
get = cnt;
cnt = 0;
}
increase = (val1 - val2) / get;
increase = increase > 0 ? increase : -increase;
increase = increase > max ? max : increase;
int32_t Filter = in > filter ? increase : -increase;
Increase = ___SMMLA((Filter - Increase) << 1, f, Increase);
filter = filter + Increase;
outlet_out = filter - inlet_hp;
prev = in;