frac32 pitch
frac32 gain
frac32 damp
frac32 mix1
frac32 mix2
frac32 mix3
frac32buffer phase increment
frac32buffer.positive phasor wave
frac32buffer phase
bool32.tgl dir
frac32.s.map.pitch pitch
frac32.s.map.pitch damp
frac32.s.map FM
frac32.u.map gain
frac32.u.map mix1
frac32.u.map mix2
frac32.u.map mix3
uint32_t Phase;
int32_t val;
int i;
int j;
Phase = 0;
uint32_t freq;
MTOFEXTENDED(param_pitch + inlet_pitch, freq);
freq = freq >> 1;
int32_t FM = ___SMMUL(freq, param_FM << 3) << 2;
int32_t f;
MTOF(param_damp + inlet_damp, f)
f = f >> 1;
int32_t gain = inlet_gain + param_gain;
int32_t mix1 = __USAT(inlet_mix1 + param_mix1, 27);
int32_t mix3 = __USAT(inlet_mix2 + param_mix2, 27);
int32_t mix2 = __USAT(inlet_mix3 + param_mix3, 27);
int32_t phase;
uint32_t phose;
for (i = 0; i < 2; i++) {
Phase += (freq >> 0) + (___SMMUL(inlet_freq << 4, FM) << 3);
int32_t sine;
uint32_t PHASE = Phase >> 5;
if (param_dir > 0) {
PHASE = (1 << 27) - PHASE;
}
PHASE = ___SMMUL(PHASE << 3, PHASE << 2);
uint32_t PHase = ___SMMUL(PHASE << 3, PHASE << 2);
// PHase=___SMMUL(PHase<<3,PHase<<2);
PHase = ___SMMUL((1 << 27) - mix3 << 3, PHase << 2) +
___SMMUL(mix3 << 3, ___SMMUL(PHase << 3, PHase << 2) << 2);
PHase = ___SMMUL((1 << 27) - mix1 << 3, PHASE << 2) +
___SMMUL(mix1 << 3, PHase << 2);
SINE2TINTERP((Phase << 0) + (___SMMUL(gain << 3, PHase) << 10), sine)
phose = (1 << 32) - Phase >> 5;
SINE2TINTERP(Phase - (1 << 30), phase)
phase = (phase >> 5) + (1 << 26);
phase = ___SMMUL((1 << 27) - mix2 << 3, phose << 2) +
___SMMUL(mix2 << 3, phase << 2);
val = ___SMMLA((___SMMUL(phase, sine) - val) << 1, f, val);
}
outlet_phasor = val;
outlet_phase = phase - (1 << 26);