frac32.bipolar pitch
frac32buffer frequency
frac32buffer phase
bool32 gate
frac32buffer.bipolar sine wave
frac32.s.map.pitch pitch
frac32.u.map Penv
frac32.u.map Pdec
frac32.u.map Vdec
uint32_t Phase;
int32_t ad1;
int32_t ad2;
int32_t freq;
int32_t decay1;
int32_t decay2;
int ttrig;
Phase = 0;
decay1 = (1 << 27) - param_Pdec;
decay1 = ___SMMUL(decay1 << 3, decay1 << 2);
decay1 = ___SMMUL(decay1 << 3, decay1 << 2);
decay1 = (1 << 27) - decay1;
decay2 = (1 << 27) - param_Vdec;
decay2 = ___SMMUL(decay2 << 3, decay2 << 2);
decay2 = ___SMMUL(decay2 << 3, decay2 << 2);
decay2 = (1 << 27) - decay2;
if ((inlet_gate > 0) && (!(ttrig))) {
Phase = 0;
ttrig = 1;
ad1 = (1 << 27);
ad2 = (1 << 27);
} else if (inlet_gate == 0) {
ttrig = 0;
}
ad1 = ___SMMUL(ad1 << 3, decay1 << 2);
ad2 = ___SMMUL(ad2 << 3, decay2 << 2);
MTOFEXTENDED(param_pitch + inlet_pitch + ___SMMUL(ad1 << 3, param_Penv << 2),
freq);
Phase += freq + inlet_freq;
int32_t r;
int32_t p2 = Phase + (inlet_phase << 4);
SINE2TINTERP(p2, r)
outlet_wave = ___SMMUL(ad2 << 3, (r >> 3));