shithub: aubio

Download patch

ref: ce6f652fdaa4e0aacb39cba4193020eea7a4cf14
parent: 053495bddae15831da28ee865378ec5c62ea7408
author: Paul Brossier <piem@piem.org>
date: Fri Jul 31 18:25:30 EDT 2015

src/tempo/tempo.c: add silence detection (closes #23), add old behavior in examples/aubiotrack.c

--- a/examples/aubiotrack.c
+++ b/examples/aubiotrack.c
@@ -70,6 +70,8 @@
 
   tempo_out = new_fvec(2);
   tempo = new_aubio_tempo(tempo_method, buffer_size, hop_size, samplerate);
+  // set silence threshold very low to output beats even during silence
+  // aubio_tempo_set_silence(tempo, -1000.);
   if (onset_threshold != 0.) aubio_tempo_set_threshold (tempo, onset_threshold);
 
   wavetable = new_aubio_wavetable (samplerate, hop_size);
--- a/src/tempo/tempo.c
+++ b/src/tempo/tempo.c
@@ -109,11 +109,9 @@
     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 beat if silent
       }
-      */
       o->last_beat = o->total_frames + (uint_t)ROUND(tempo->data[0] * o->hop_size);
     }
   }