From: Paul Brossier Date: Mon, 2 Nov 2015 22:06:55 +0000 (+0100) Subject: src/tempo/tempo.{c,h}: add _get_period and _get_period_s X-Git-Tag: 0.4.4~300^2~357 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=42c3dc03b1c1ab1013f95e181f71b639b4966d28;p=aubio.git src/tempo/tempo.{c,h}: add _get_period and _get_period_s --- diff --git a/src/tempo/tempo.c b/src/tempo/tempo.c index 3d699897..868f5fdd 100644 --- a/src/tempo/tempo.c +++ b/src/tempo/tempo.c @@ -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); } diff --git a/src/tempo/tempo.h b/src/tempo/tempo.h index eca68b5c..399d22e7 100644 --- a/src/tempo/tempo.h +++ b/src/tempo/tempo.h @@ -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