frac32buffer in
frac32 freq
frac32 scaling
frac32buffer.bipolar output
frac32.s.map scaling
frac32.u.map freq
int32_t phase;
int32_t phase_prev;
int32_t scaling;
uint32_t additional;
int32_t hold;
phase = 0;
phase_prev = 0;
scaling = 0;
additional = 0;
hold = 0;
scaling = param_scaling + inlet_scaling << 4;
phase += (param_freq + inlet_freq + additional) << 1;
if ((phase < 0) && (phase_prev > 0)) {
hold = inlet_in >> 1;
phase = 0;
additional = ___SMMUL(hold > 0 ? hold : -hold, scaling);
}
outlet_out = hold;
phase_prev = phase;