diff options
-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); |