frac32buffer wave input
frac32 crossover
frac32buffer out
frac32.u.map.gain feed
frac32.u.map.gain dry
frac32.u.map.gain wet
frac32.s.map.pitch sets "mid" crossover frequency. The pitchshifter/delay will mostly focus around this point
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 *arrayL;
int16_t *arrayH;
uint32_t writepos;
uint32_t readL;
uint32_t readH;
int32_t low;
int32_t high;
int32_t feed;
static int16_t _arrayL[1 << attr_size] __attribute__((section(".sdram")));
arrayL = &_arrayL[0];
static int16_t _arrayH[1 << attr_size] __attribute__((section(".sdram")));
arrayH = &_arrayH[0];
int i;
writepos = 0;
for (i = 0; i < LENGTH; i++) {
arrayL[i] = 0;
arrayH[i] = 0;
}
int32_t frq;
MTOF(param_crossover + inlet_crossover, frq)
int32_t in = __SSAT(inlet_in + ___SMMUL(-feed << 1, param_feed), 28);
low = ___SMMLA((in - low) << 1, frq, low);
high = in - low;
writepos = (writepos + 1) & LENGTHMASK;
arrayL[writepos] = __SSAT(low >> 14, 16);
arrayH[writepos] = __SSAT(high >> 14, 16);
readL = (readL + 2) & LENGTHMASK;
readH = (readH + 1) & LENGTHMASK;
int32_t outLA = arrayL[(writepos + readL) & LENGTHMASK] << 14;
int32_t outLB =
arrayL[(writepos + ((readL + (LENGTH >> 1) & LENGTHMASK))) & LENGTHMASK]
<< 14;
int32_t outHA = arrayH[(writepos - (readH >> 1)) & LENGTHMASK] << 14;
int32_t outHB =
arrayH[(writepos - ((readH + (LENGTH >> 1) & LENGTHMASK) >> 1)) &
LENGTHMASK]
<< 14;
int32_t mixL = readL > (LENGTH >> 1) ? LENGTH - readL : readL;
mixL = mixL << 31 - LENGTHPOW;
int32_t mixH = readH > (LENGTH >> 1) ? LENGTH - readH : readH;
// mixH=mixH>>1;
mixH = mixH << 31 - LENGTHPOW;
int32_t OUT = (outLB + ___SMMUL(outLA - outLB << 2, mixL)) +
(outHB + ___SMMUL(outHA - outHB << 2, mixH));
outlet_out = __SSAT(__SSAT(___SMMUL(inlet_in << 1, param_dry), 28) +
__SSAT(___SMMUL(OUT << 1, param_wet), 28),
28);
feed = __SSAT(OUT, 29) << 1;