shithub: aubio

Download patch

ref: ac67de78638ac96266ad7c5bffc44f1ef4fa1c46
parent: 54dd9454752719f577b8dda79aa6278e81d9c63c
author: Paul Brossier <piem@piem.org>
date: Sat Apr 13 18:23:04 EDT 2013

src/tempo/tempo.c: always set last_beat

--- a/src/tempo/tempo.c
+++ b/src/tempo/tempo.c
@@ -88,11 +88,12 @@
     if (o->blockpos == FLOOR(o->out->data[i])) {
       tempo->data[0] = o->out->data[i] - FLOOR(o->out->data[i]); /* set tactus */
       /* test for silence */
+      /*
       if (aubio_silence_detection(input, o->silence)==1) {
-        //tempo->data[0] = 0; /* unset onset */
-      } else {
-        o->last_beat = o->total_frames + (uint_t)ROUND(tempo->data[0] * o->hop_size);
+        tempo->data[0] = 0; // unset beat if silent
       }
+      */
+      o->last_beat = o->total_frames + (uint_t)ROUND(tempo->data[0] * o->hop_size);
     }
   }
   o->total_frames += o->hop_size;