0x s

Detects the number of samples between zero crossings.
Author: Sputnki
License: BSD
Github: sptnk/detect/0x s.axo

Inlets

frac32buffer.bipolar in

Outlets

int32 number of samples at s-rate sample rate

frac32buffer.positive trig

Declaration
uint32_t count = 0;
uint32_t output = 0;

bool sign_old = 0;
bool sign = 0;
Control Rate
outlet_smp = output;
Audio Rate
count++;
sign = inlet_in > 0 ? 1 : 0;
outlet_trig = 0;

if (sign != sign_old) {
  output = count;
  count = 0;
  outlet_trig = 1 << 27;
}

sign_old = sign;

Privacy

© 2024 Zrna Research