diff options
author | deva <deva> | 2008-07-25 12:32:48 +0000 |
---|---|---|
committer | deva <deva> | 2008-07-25 12:32:48 +0000 |
commit | ad7231a34c2dfaf1ecbe596daa5669a0d2e51f55 (patch) | |
tree | 705a6a12a8d1918e01683440e78bbabc3156b8b4 /src | |
parent | 3c4bfdf7ee8b6694d9c60e95ee1010228b1c0370 (diff) |
Make sure initial noise doesn't trigger a lot of samples during the first second - AGAIN.
Diffstat (limited to 'src')
-rw-r--r-- | src/beatmapper.cc | 1 |
1 files changed, 1 insertions, 0 deletions
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); |