From ad7231a34c2dfaf1ecbe596daa5669a0d2e51f55 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 25 Jul 2008 12:32:48 +0000 Subject: Make sure initial noise doesn't trigger a lot of samples during the first second - AGAIN. --- src/beatmapper.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'src/beatmapper.cc') diff --git a/src/beatmapper.cc b/src/beatmapper.cc index 746f63f..99432ce 100644 --- a/src/beatmapper.cc +++ b/src/beatmapper.cc @@ -50,6 +50,7 @@ Sample *BeatMapper::map(jack_nframes_t nframes) float E = 0.0; for(size_t i = 0; i < HISTORY_SIZE; i++) E += hist[i] / (float)HISTORY_SIZE; + if(E == 0) E = 1.0; // We do not have a connection // printf("last: %d, E: %f, e: %f - threshold: %f\n", last, E, e, 1.3 * E); -- cgit v1.2.3