bool32 when high, repeater is on
bool32 triangle/saw shape for panning wrap
int32 Sets the base delay-time in samples. Connects to "Ksamples" on my clock2timing module. Use ratioVCAI to set ratio to host tempo
int32 Sets swing-time in samples for every even numbered repetition. Connects to "Ksamples" on my clock2timing module. Use ratioVCAI to set ratio to host tempo
int32 sets the amount of repetitions
frac32 sets the base repeat-time in fractional value. Use BPMext "delaybase" ouput to host sync to the lfo. Use my ratio modules for integer divisions of host tempo.
frac32 sets the swing-time in fractional valueof every even numbered repetition. Use BPMext "delaybase" ouput to host sync to the lfo. Use my ratio modules for integer divisions of host tempo.
frac32 sets the volume of the repeats
frac32 feeds back the repeater (hard clipped with input)
frac32 sets the start panning of the repeat
frac32 offsets the panning of each next repeat
frac32 negative value will make the pan go from outwards from the first repeat to center at the last repeat, zero is no swell, positive values will make the pan move from center from the first repeat to outwards at the last repeat
frac32 damp
frac32 dampSwell
frac32buffer audio input
frac32buffer outL
frac32buffer outR
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;
int32_t size;
int32_t times;
int32_t rec;
int32_t out;
int32_t Ol;
int32_t Or;
int32_t repeat;
int32_t swing;
int32_t pan[16];
int32_t lp[16];
int32_t rate[16];
int32_t v27 = 1 << 27;
int32_t v28 = 1 << 28;
int32_t vi29 = (1 << 29) - 1;
int i;
static int32_t _array[attr_poly][1 << attr_size]
__attribute__((section(".sdram")));
array = &_array[parent->polyIndex][0];
writepos = 0;
for (i = 0; i < LENGTH; i++)
array[i] = 0;
size = ___SMMUL(__USAT(inlet_Ksize, 27) << 3, LENGTH << 2) + inlet_size;
size = size > 0 ? size : -size;
size = size > 0 ? size : 1;
swing = ___SMMUL(__USAT(inlet_Kswing, 27) << 3, LENGTH << 2) + inlet_swing;
repeat = inlet_repeat;
repeat = repeat > 0 ? repeat : 1;
repeat = repeat > 16 ? 16 : repeat;
for (i = 0; i < repeat; i++) {
int32_t tmp = (inlet_panStart << 4) + (inlet_panSpread / repeat << 6) * i;
if (inlet_panMode < 1) {
int32_t tp = __SSAT(tmp, 30);
pan[i] = tp - (tp - tmp) << 1;
} else {
pan[i] = tmp;
}
pan[i] += ___SMMUL(inlet_panSwell * (i - (repeat >> 1)), pan[i]) << 5;
MTOF(inlet_damp + (inlet_dampSwell >> 1) * i, rate[i])
}
writepos = (writepos + 1) & LENGTHMASK;
array[writepos] = inlet_on > 0
? __SSAT(inlet_in + ___SMMUL(inlet_feed << 3, out << 2),
28)
: 0;
out = 0;
Ol = 0;
Or = 0;
if (inlet_on > 0) {
for (i = 1; i <= repeat; i++) {
int k = i - 1;
out = ___SMMUL(
array[(writepos - i * size + ((i - 1) & 1) * swing) & LENGTHMASK] << 2,
inlet_wet << 2);
lp[k] = ___SMMLA(out - lp[k] << 1, rate[k], lp[k]);
out = lp[k];
Ol = __SSAT(out + ___SMMUL(out << 1, pan[k]) + Ol, 28);
Or = __SSAT(out - ___SMMUL(out << 1, pan[k]) + Or, 28);
out = __SSAT((Ol + Or) / repeat, 28);
}
}
outlet_outL = __SSAT(inlet_in + Ol, 28);
outlet_outR = __SSAT(inlet_in + Or, 28);