frac32 pitch
frac32 damp
frac32 strength
frac32 influence
frac32buffer delay time (fraction of total delayline size)
frac32buffer wave
frac32.s.map.pitch pitch
frac32.s.map.pitch damp
frac32.u.map tailtime
frac32.u.map strength
frac32.s.map influence
static const uint32_t LENGTHPOW = (13);
static const uint32_t LENGTH = (1 << 13);
static const uint32_t LENGTHMASK = ((1 << 13) - 1);
int32_t *array;
uint32_t writepos;
int32_t feed;
int32_t Time;
int32_t val1;
int32_t val2;
int32_t T1ime;
static int32_t _array[attr_poly][1 << 13] __attribute__((section(".sdram")));
array = &_array[parent->polyIndex][0];
int i;
writepos = 0;
for (i = 0; i < LENGTH; i++)
array[i] = 0;
int32_t pitch = inlet_pitch + 95860818 + param_pitch;
int32_t damp;
MTOF(param_damp +
___SMMUL(pitch << 3, (__USAT(param_influence + inlet_influence, 27))
<< 2) +
inlet_damp,
damp)
int32_t strength = __USAT(param_strength + inlet_strength, 27);
float32_t fratio = -pitch;
fratio = powf(2, (fratio / ((float32_t)(12 << 21))));
Time = (((int32_t)((1 << 25) * fratio)) >> 27 - LENGTHPOW);
int32_t tailtime = param_tailtime >> 5;
float32_t ratio = (float32_t)(Time) / (float32_t)(tailtime);
float32_t dB = (float32_t)(-10) * ratio;
dB = powf(2, dB);
int32_t TIME = (int32_t)((1 << 25) * fratio);
uint32_t tmp_w1 = (TIME << (LENGTHPOW + 3)) & 0x3FFFFFFF;
uint32_t tmp_w2 = (1 << 30) - tmp_w1;
writepos = (writepos + 1) & LENGTHMASK;
uint32_t tmp_di1 = writepos - (Time)-1;
int32_t tmp_a1 = array[tmp_di1 & LENGTHMASK];
int32_t tmp_a2 = array[(tmp_di1 + 1) & LENGTHMASK];
int32_t tmp_r = ___SMMUL(tmp_a1, tmp_w1);
tmp_r = ___SMMLA(tmp_a2, tmp_w2, tmp_r);
int32_t lp = tmp_r * dB * 4;
val1 = ___SMMLA((((int32_t)(lp)) - val1) << 1, damp, val1);
feed = ___SMMUL(((1 << 27) - strength) << 3, lp << 2) +
___SMMUL(strength << 3, val1 << 2);
array[writepos] = -feed + inlet_in;
//+___SMMUL(-feed>>4,(feed>0?feed:-feed)>>4);
outlet_out = -feed + inlet_in >> 1;