frac32buffer delay time (fraction of total delayline size)
frac32 mix
int32 step
frac32buffer wave
int32 div
int32 harmonic
int32 quant
int32 start
int32 step
frac32.u.map mix
objref table
int32_t mix;
int32_t tablemix(int32_t WaveA, int32_t WaveB, int32_t Mix) {
mix = ___SMMUL(((1 << 27) - Mix) << 3, WaveA << 2) +
___SMMUL(Mix << 3, WaveB << 2);
}
int32_t F;
int32_t MX(int32_t T) {
T = T > 0 ? T : -T;
T = T & ((1 << 28) - 1);
F = T > (1 << 27) ? (1 << 28) - T : T;
}
int32_t MIX1a;
int32_t MIX1;
int32_t W[2];
int32_t out1;
int32_t out2;
int32_t smooth1;
int32_t M1step;
int32_t M1prv;
int i;
int32_t MiX1 = inlet_mix + param_mix;
// MX(MiX1);
// MiX1=F;
MiX1 = MiX1 & ((1 << 27) - 1);
int32_t quant = param_quant + 1;
float32_t step =
((float32_t)(attr_table.Waveforms)) / (quant) * (inlet_step + param_step);
outlet_div = quant;
MIX1a = MiX1;
W[0] = ((MIX1a >> 4) * quant) >> 23;
MIX1a = (MIX1a - (W[0] << 27) / quant) * quant;
W[1] = W[0] * step + step + param_start;
W[0] = W[0] * step + param_start;
for (i = 0; i < 2; i++) {
W[i] = (W[i] - (W[i] / attr_table.Waveforms) * attr_table.Waveforms);
W[i] = W[i] < 0 ? W[i] + attr_table.Waveforms : W[i];
W[i] = W[i] * attr_table.LENGTH;
}
uint32_t phase = inlet_phase * param_harmonic << 5;
uint32_t p1 = (phase >> 32 - attr_table.LENGTHPOW);
uint32_t Mit = ((phase << attr_table.LENGTHPOW) >> 2) & 0x3FFFFFFF;
int32_t out1;
int32_t out2;
out1 = ___SMMUL(attr_table.array[p1 + W[0]] << 2, (1 << 30) - Mit);
out1 += ___SMMUL(
attr_table.array[((p1 + 1) & attr_table.LENGTHMASK) + W[0]] << 2, Mit);
out2 = ___SMMUL(attr_table.array[p1 + W[1]] << 2, (1 << 30) - Mit);
out2 += ___SMMUL(
attr_table.array[((p1 + 1) & attr_table.LENGTHMASK) + W[1]] << 2, Mit);
tablemix(out1, out2, MIX1a);
outlet_out = mix;