adc => LPF lp => LPF lp2 => ZeroX z => FullRect f => OnePole p => blackhole; // basic patch 0.0 => float myZeroes; // This holds the last zero crossing count 400.0 => lp.freq => lp2.freq; // this helps us to ignore harmonics 2.0 => lp.Q => lp2.Q; // and noise, and higher fundamentals spork ~ ZC(0.500); while (1) { 100.0 :: second => now; // do other stuff here } fun void ZC(float howoften) { howoften*44100 - 1 => float wait; while (1) { wait :: samp => now; p.last() => myZeroes; <<< "Zero Crossings = ", myZeroes >>>; 0.0 => p.a1; 0.0 => p.b0; 1 :: samp => now; -1.0 => p.a1; // this is dangerous, but we 1.0 => p.b0; // know what we're doing } }