frac32buffer wave input
frac32buffer out
frac32.u.map time
frac32.s.map feedback
frac32.s.map wet
frac32.s.map dry
frac32.s.map.pitch damp
int32 rate
int32 bits
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);
int32_t *array;
uint32_t writepos;
int32_t feedback;
int32_t HP;
int32_t count;
int32_t out;
static int32_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;
int32_t f;
MTOF(param_damp, f)
int32_t h;
MTOF(-10 << 21, h)
count += 1;
count = count - (count / param_rate) * param_rate;
if (count == 0) {
writepos = (writepos + 1) & LENGTHMASK;
array[writepos] =
((inlet_in + ___SMMUL(param_feedback << 3, feedback) + 1) << 2) >>
32 - (param_bits);
if (param_bits < 31) {
out = array[writepos - (param_time >> 27 - LENGTHPOW) & LENGTHMASK]
<< 32 - param_bits;
}
if (param_bits > 30) {
out = array[writepos - (param_time >> 27 - LENGTHPOW) & LENGTHMASK] >>
-32 + param_bits;
}
}
out = __SSAT(out, 27);
HP = ___SMMLA((out - HP) << 1, h, HP);
feedback = ___SMMLA((out - HP - feedback) << 1, f, feedback);
outlet_out = ___SMMUL(out << 3, param_wet << 2) +
___SMMUL(inlet_in << 3, param_dry << 2);