src/tempo/tempo.{c,h}: add _get_period and _get_period_s
authorPaul Brossier <piem@piem.org>
Mon, 2 Nov 2015 22:06:55 +0000 (23:06 +0100)
committerPaul Brossier <piem@piem.org>
Mon, 2 Nov 2015 22:06:55 +0000 (23:06 +0100)
src/tempo/tempo.c
src/tempo/tempo.h

index 3d69989..868f5fd 100644 (file)
@@ -225,6 +225,16 @@ smpl_t aubio_tempo_get_bpm(aubio_tempo_t *o) {
   return aubio_beattracking_get_bpm(o->bt);
 }
 
+smpl_t aubio_tempo_get_period (aubio_tempo_t *o)
+{
+  return aubio_beattracking_get_period (o->bt);
+}
+
+smpl_t aubio_tempo_get_period_s (aubio_tempo_t *o)
+{
+  return aubio_beattracking_get_period_s (o->bt);
+}
+
 smpl_t aubio_tempo_get_confidence(aubio_tempo_t *o) {
   return aubio_beattracking_get_confidence(o->bt);
 }
index eca68b5..399d22e 100644 (file)
@@ -121,6 +121,26 @@ uint_t aubio_tempo_set_threshold(aubio_tempo_t * o, smpl_t threshold);
 */
 smpl_t aubio_tempo_get_threshold(aubio_tempo_t * o);
 
+/** get current beat period in samples
+
+  \param bt beat tracking object
+
+  Returns the currently observed period, in samples, or 0 if no consistent
+  value is found.
+
+*/
+smpl_t aubio_tempo_get_period (aubio_tempo_t * bt);
+
+/** get current beat period in seconds
+
+  \param bt beat tracking object
+
+  Returns the currently observed period, in seconds, or 0 if no consistent
+  value is found.
+
+*/
+smpl_t aubio_tempo_get_period_s (aubio_tempo_t * bt);
+
 /** get current tempo
 
   \param o beat tracking object