frac32buffer wave input
frac32 pitch
frac32buffer out
frac32.s.map.pitch length of inversed reading buffer (window)
frac32.s.map offset from writeposition (delay)
bool32.tgl ringmodulation or addition of audio input with inversed reading buffer
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);
int16_t *array;
uint32_t writepos;
uint32_t readpos;
static int16_t _array[attr_poly][1 << attr_size]
__attribute__((section(".sdram")));
array = &_array[parent->polyIndex][0];
int i;
writepos = 0;
readpos = 0;
for (i = 0; i < LENGTH; i++)
array[i] = 0;
int32_t length; //=___SMMUL(LENGTH<<1,param_length);
MTOF(-param_pitch - inlet_pitch, length)
length = length >> 27 - LENGTHPOW;
int32_t ofs;
MTOF(-param_ofs - inlet_pitch, ofs)
ofs = ofs >> 27 - LENGTHPOW;
writepos = (writepos + 1) & LENGTHMASK;
readpos = (readpos + 2);
// writepos-=writepos>=length?length:0;
readpos -= readpos >= length ? length : 0;
array[writepos & LENGTHMASK] = __SSAT(inlet_in >> 14, 16);
switch (param_mode) {
case 0:
outlet_out = ___SMMUL(array[(writepos - readpos - ofs) & LENGTHMASK] << 17,
inlet_in << 3);
break;
case 1:
outlet_out =
(array[(writepos - readpos - ofs) & LENGTHMASK] << 14) + inlet_in >> 1;
break;
}