shithub: aubio

Download patch

ref: 0482e7675f5580c340a188f29fc6ae7485809066
parent: f69899722cb311a2f5f50ad1ab21cb9a87895346
author: Paul Brossier <[email protected]>
date: Sat Sep 12 09:13:10 EDT 2009

src/tempo/tempo.c: always output tempo, pass along interpolated position

--- a/src/tempo/tempo.c
+++ b/src/tempo/tempo.c
@@ -75,13 +75,11 @@
   i=0;
   for (i = 1; i < o->out->data[0][0]; i++ ) {
     /* if current frame is a predicted tactus */
-    if (o->blockpos == o->out->data[0][i]) {
+    if (o->blockpos == FLOOR(o->out->data[0][i])) {
+      tempo->data[0][0] = 1. + o->out->data[0][i] - FLOOR(o->out->data[0][i]); /* set tactus */
       /* test for silence */
       if (aubio_silence_detection(input, o->silence)==1) {
         tempo->data[0][1] = 0; /* unset onset */
-        tempo->data[0][0] = 0; /* unset tactus */
-      } else {
-        tempo->data[0][0] = 1; /* set tactus */
       }
     }
   }