frac32buffer.bipolar in
int32.positive number of samples between zero crossings
frac32.positive frequency in axoloti format
frac32buffer.positive trig
float count = 0;
float output = 0;
bool sign_old = 0;
bool sign = 0;
int32_t in_prev = 0;
outlet_smp = output;
outlet_f = 134217728.0f / output;
count += 1.0f;
sign = inlet_in > 0 ? 1 : 0;
outlet_trig = 0;
float intercept = ((float)inlet_in) / ((float)(in_prev - inlet_in));
if (sign != sign_old) {
output = count + intercept;
count = -intercept;
outlet_trig = 1 << 27;
}
sign_old = sign;
in_prev = inlet_in;