frac32 pitch
frac32 freq
frac32buffer phase increment
frac32buffer.positive phasor wave
frac32buffer p
frac32.u.map.squaregain morph
frac32.u.map pw
frac32.s.map octave
uint32_t Phase;
int32_t SQR;
int32_t val;
uint32_t prv;
Phase = 0;
uint32_t freq;
MTOFEXTENDED(((param_octave >> 24) * 12 << 21) + inlet_pitch, freq);
uint32_t F;
F = ___SMMUL(param_morph, param_morph) >> 9;
freq += inlet_freq + F;
float32_t ratio;
int32_t pw = param_pw;
ratio = (float32_t)(1 << 27) / ((1 << 27) - pw) * 32;
Phase += freq;
uint32_t p2 = Phase >> 5;
p2 = p2 > pw ? p2 - pw : 0;
p2 = p2 * ratio;
if (Phase < prv) {
SQR = inlet_in;
}
int32_t phasor = SQR + ___SMMUL(inlet_in - SQR << 1, p2 >> 1);
val += (phasor - val) >> 9;
outlet_wave = phasor - val;
prv = Phase;
outlet_p = p2 >> 4;