frac32 time
frac32buffer wave input
frac32buffer out
frac32.u.map mult
frac32.u.map div
frac32.u.map feed
frac32.u.map wet
frac32.s.map hrm
frac32.s.map.pitch damp
combo size
static const uint32_t LENGTHPOW = (attr_size);
static const uint32_t LENGTH = (1 << attr_size);
static const uint32_t LENGTHMASK = ((1 << attr_size) - 1);
int16_t *array;
uint32_t writepos;
int32_t out;
int32_t val;
int32_t feed;
static int16_t _array[attr_poly][1 << attr_size]
__attribute__((section(".sdram")));
array = &_array[parent->polyIndex][0];
int i;
writepos = 0;
for (i = 0; i < LENGTH; i++)
array[i] = 0;
// uint32_t tim=param_time>>27-LENGTHPOW;
int mult = (param_mult >> 21) >= 1 ? (param_mult >> 21) : 1;
int Div = (param_div >> 21) >= 1 ? (param_div >> 21) : 1;
int32_t tim = (int64_t)inlet_time * mult / Div;
int hrm = param_hrm >> 25;
int32_t f;
MTOF(param_damp, f)
writepos = (writepos + 1) & LENGTHMASK;
array[writepos] = __SSAT(inlet_in + feed >> 14, 16);
out = 0;
uint32_t p1;
uint32_t p2;
uint32_t m1;
if (hrm >= 0) {
p1 = (writepos * hrm) & 2047;
p2 = (writepos * hrm + 1024) & 2047;
} else {
p1 = (int32_t)(writepos * (-(float32_t)(-hrm - 1) / -hrm)) & 2047;
p2 = (int32_t)(writepos * (-(float32_t)(-hrm - 1) / -hrm) + 1024) & 2047;
}
m1 = (p1 > 1024 ? 2048 - p1 : p1) << 1;
out = ___SMMUL(array[(writepos - tim + (p1)) & LENGTHMASK] << 16, m1 << 19);
out += ___SMMUL(array[(writepos - tim + (p2)) & LENGTHMASK] << 16,
2047 - m1 << 19);
val = ___SMMLA((out - val) << 1, f, val);
if (param_hrm >= 0) {
feed = val;
} else {
feed = out - val;
}
outlet_out = ___SMMUL(feed << 3, param_wet << 3) + inlet_in;
feed = ___SMMUL(feed << 2, param_feed << 3);