frac32.bipolar pitch
frac32 shape
frac32buffer.bipolar sine wave
frac32.s.map.pitch pitch
frac32.u.map shape
uint32_t Phase;
int32_t prev1;
int32_t step1;
int32_t prev2;
int32_t step2;
int rtrig;
int32_t SQ;
int32_t sq;
Phase = 0;
SQ = 0;
int32_t freq;
MTOFEXTENDED(param_pitch + inlet_pitch, freq);
int32_t shape = inlet_shape + param_shape;
shape = shape & ((1 << 28) - 1);
shape = shape > (1 << 27) ? (1 << 28) - shape : shape;
step1 = (shape - prev1) >> 4;
int32_t i1 = prev1;
prev1 = shape;
step2 = (freq - prev2) >> 4;
int32_t i2 = prev2;
prev2 = freq;
i1 += step1;
i2 += step2;
Phase += i2;
int32_t r1;
int32_t r2;
int32_t p2 = Phase;
SINE2TINTERP(p2, r1)
r2 = Phase + (1 << 30);
r2 = r2 > 0 ? r2 : -r2;
r2 = (r2) - (1 << 30);
outlet_wave =
(___SMMUL((r1 >> 1), ((1 << 27) - i1) << 2) + ___SMMUL(r2, i1 << 2)) >> 2;