frac32.bipolar in
int32 number of samples at k-rate sample rate
bool32.pulse a pulse is fired when the zero crossing occurs
uint32_t count = 0;
uint32_t output = 0;
bool sign_old = 0;
bool sign = 0;
count++;
sign = inlet_in > 0 ? 1 : 0;
bool trig = 0;
if (sign != sign_old) {
output = count;
count = 0;
trig = 1;
}
outlet_smp = output;
outlet_trig = trig;
sign_old = sign;