frac32.bipolar pitch
frac32buffer.bipolar square wave
frac32.s.map.pitch pitch
int32_t osc_p;
osc_p = 0;
uint32_t freq;
MTOFEXTENDED(param_pitch + inlet_pitch, freq);
int j;
int32_t f0i = 0x7fffffff / (1 + (freq) >> 11);
for (j = 0; j < BUFSIZE; j++) {
int32_t p1 = osc_p;
int32_t p2 = p1 + freq;
osc_p = p2;
if ((p2 < 0) && (p1 > 0))
outlet_wave[j] = ___SMMLS(f0i, (-p1) << 1, 0x400) << 16;
else if ((p1 < 0) && (p2 > 0))
outlet_wave[j] = ___SMMLS(f0i, (p1) << 1, -0x400) << 16;
else
outlet_wave[j] = (p2 > 0) ? -(1 << 26) : ((1 << 26));
}