frac32buffer delay time (fraction of total delayline size)
frac32 pitch
frac32 position
frac32 tailtime
frac32 color
frac32 mode
frac32 strength
frac32 influence
frac32buffer wave
frac32.s.map influence
frac32.s.map.pitch pitch
frac32.s.map.pitch color
frac32.u.map position
frac32.u.map tailtime
frac32.u.map mode
frac32.u.map strength
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;
int32_t lp;
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_color +
___SMMUL(pitch << 3, (__USAT(param_influence + inlet_influence, 27))
<< 2) +
inlet_color,
damp)
int32_t mode = __USAT(param_mode + inlet_mode, 27);
int32_t strength = __USAT(param_strength + inlet_strength, 27);
strength = ___SMMUL(strength << 3, strength << 2);
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 + inlet_tailtime) >> 5;
float32_t ratio = (float32_t)(Time) / (float32_t)(tailtime);
float32_t dB = (float32_t)(-10) * ratio;
dB = powf(2, dB);
int32_t DB = (1 << 31) * dB;
DB = 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;
int32_t position = __USAT(param_position + inlet_position, 27);
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);
lp = ___SMMUL(tmp_r << 3, DB);
val1 = ___SMMLA((((int32_t)(lp)) - val1) << 1, damp, val1);
feed = ___SMMUL(((1 << 27) - (strength >> 3)) << 3, lp << 2) +
___SMMUL(strength, (val1 + ___SMMUL(mode << 3, (lp - (val1 << 1)) << 2))
<< 2);
array[writepos] = -feed;
array[(writepos - ___SMMUL(Time << 3, position << 2)) & LENGTHMASK] +=
inlet_in >> 1;
array[(writepos - Time + ___SMMUL(Time << 3, position << 2)) & LENGTHMASK] +=
inlet_in >> 1;
outlet_out = -feed + inlet_in;