frac32buffer wave input
frac32buffer R
frac32buffer outL
frac32buffer outR
frac32.u.map predelay
frac32.s.map feed
frac32.s.map wet
frac32.s.map.pitch damp
int32 stackwrite
int32 stackread
combo size
objref writesize
objref readsize
objref writevolume
objref readvolume
objref panning
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;
int i;
uint32_t rnd[32];
int32_t sum1;
int32_t sum2;
int32_t damp;
int rtrig;
int32_t HP;
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;
int32_t D;
MTOF(param_damp, D)
int32_t in =
__SSAT((inlet_L + inlet_R >> 1) +
___SMMUL((param_feed * 3 /
(((param_stackread + param_stackwrite >> 1) - 1) + 1))
<< 1,
(sum1 + sum2) << 4),
27);
damp = ___SMMLA((in - damp) << 1, D, damp);
HP = HP + ((damp - HP) >> 13);
writepos = (writepos + 1) & LENGTHMASK;
array[writepos] = __SSAT(damp - HP >> 14, 28);
sum1 = 0;
sum2 = 0;
for (i = 0; i < param_stackwrite; i++) {
array[(writepos - (attr_writesize.array[i] >> 27 - LENGTHPOW - 1)) &
LENGTHMASK] +=
___SMMUL(damp - HP >> 11, attr_writevolume.array[i] << 2);
}
for (i = 0; i < param_stackread; i++) {
int32_t H = ___SMMUL(
((array[(writepos - (attr_readsize.array[i] >> 27 - LENGTHPOW - 1) -
___SMMUL(param_predelay << 3, LENGTHMASK << 2)) &
LENGTHMASK]
<< 14))
<< 3,
attr_readvolume.array[i] << 2);
sum1 += ___SMMUL(attr_panning.array[i] << 3, H << 2);
sum2 += ___SMMUL(((1 << 27) - (attr_panning.array[i])) << 3, H << 2);
}
outlet_outL = inlet_L + ___SMMUL(sum1 << 3, param_wet << 3);
outlet_outR = inlet_R + ___SMMUL(sum2 << 3, param_wet << 3);