frac32buffer wave input
frac32buffer in2
frac32 timeRead
frac32 timeWrite
int32 repeatRead
int32 repeatWrite
int32 startNom
int32 startDiv
bool32 freeze
int32 pow
frac32buffer out
frac32.u.map timeWrite
frac32.u.map timeRead
int32 repeatWrite
int32 repeatRead
int32 startNom
int32 startDiv
frac32.s.map wet
bool32.tgl freeze
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;
int i;
uint32_t Timeread;
uint32_t Timewrite;
int64_t TIME;
static int32_t _array[1 << attr_size] __attribute__((section(".sdram")));
array = &_array[0];
writepos = 0;
for (i = 0; i < LENGTH; i++)
array[i] = 0;
int freeze = param_freeze + inlet_freeze;
int repeatread = param_repeatRead + inlet_repeatRead;
int repeatwrite = param_repeatWrite + inlet_repeatWrite;
int startNom = param_startNom + inlet_startNom;
int startDiv = param_startDiv + inlet_startDiv;
if (freeze == 0) {
TIME = inlet_timeWrite + param_timeWrite;
TIME = (TIME * startNom / startDiv) >> (27 - LENGTHPOW);
Timeread = (param_timeRead + inlet_timeRead) >> (27 - LENGTHPOW);
Timewrite = (param_timeWrite + inlet_timeWrite) >> (27 - LENGTHPOW);
}
outlet_pow = attr_size;
uint32_t delayread = writepos - Timeread;
uint32_t delaywrite = writepos - Timewrite;
int32_t sum = 0;
writepos = (writepos + 1) & LENGTHMASK;
if (freeze == 0) {
array[writepos] = inlet_in1 + inlet_in2;
}
for (i = 1; i < repeatread + 1; i++) {
sum += array[(writepos - Timeread / repeatread * i) & LENGTHMASK];
}
if (freeze == 0) {
for (i = 1; i < repeatwrite; i++) {
array[(writepos - Timeread / repeatwrite * i - TIME) & LENGTHMASK] +=
inlet_in1;
}
}
// for(i=1;i<repeatread;i++){
// sum=array[(writepos-Timeread)& LENGTHMASK];}
outlet_out = ___SMMUL(sum << 3, param_wet << 2) + inlet_in1 + inlet_in2;