frac32.bipolar pitch
frac32 detune
frac32 pw
frac32buffer.bipolar supersaw wave
frac32.s.map pw
int32 saw
bool32.tgl base
frac32.s.map.pitch pitch
frac32.u.map detune
frac32.u.map power
int32_t osc_p[7];
int32_t v26 = 1 << 25;
int i;
for (i = 0; i < 7; i++)
osc_p[i] = 0;
uint32_t f0;
uint32_t f[6];
MTOFEXTENDED(param_pitch + inlet_pitch, f0);
uint32_t det1 = __USAT(param_detune + inlet_detune, 27);
uint32_t det = ___SMMUL(det1, det1) << 2;
uint32_t f0d = ___SMMUL(det << 8, f0);
int i, j;
f[0] = f0 + ___SMMUL(f0d, -0x05432123);
f[1] = f0 + ___SMMUL(f0d, -0x03111111);
f[2] = f0 + ___SMMUL(f0d, -0x01020304);
f[3] = f0 + ___SMMUL(f0d, 0x01030450);
f[4] = f0 + ___SMMUL(f0d, 0x03212121);
f[5] = f0 + ___SMMUL(f0d, 0x05542211);
int32_t pw = inlet_pw + param_pw << 4;
osc_p[0] += f0;
for (i = 0; i < 6; i++) {
osc_p[i + 1] += f[i];
}
if (param_base > 0) {
outlet_wave = osc_p[0] >> 6;
} else {
outlet_wave = osc_p[0] > (pw) ? v26 : -v26;
}
int32_t tmp = v26;
for (i = 0; i < 6; i++) {
tmp -= ___SMMUL(tmp << 2, param_power << 3);
if (i > param_saw) {
outlet_wave += osc_p[i + 1] > (pw * i) ? tmp : -tmp;
} else {
outlet_wave += ___SMMUL(osc_p[i + 1], tmp);
}
}
outlet_wave = __SSAT(outlet_wave, 28);