Changeset 5f5edc1 for src


Ignore:
Timestamp:
Nov 2, 2015, 11:02:58 PM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
42c3dc0
Parents:
43b7c6d
Message:

src/tempo/beattracking.{c,h}: add _get_period and _get_period_s

Location:
src/tempo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/tempo/beattracking.c

    r43b7c6d r5f5edc1  
    410410
    411411smpl_t
     412aubio_beattracking_get_period (aubio_beattracking_t * bt)
     413{
     414  return bt->hop_size * bt->bp;
     415}
     416
     417smpl_t
     418aubio_beattracking_get_period_s (aubio_beattracking_t * bt)
     419{
     420  return aubio_beattracking_get_period(bt) / (smpl_t) bt->samplerate;
     421}
     422
     423smpl_t
    412424aubio_beattracking_get_bpm (aubio_beattracking_t * bt)
    413425{
    414426  if (bt->bp != 0) {
    415     return 60. * bt->samplerate/ bt->bp / bt->hop_size;
     427    return 60. / aubio_beattracking_get_period_s(bt);
    416428  } else {
    417429    return 0.;
  • src/tempo/beattracking.h

    r43b7c6d r5f5edc1  
    6868    fvec_t * out);
    6969
     70/** get current beat period in samples
     71
     72  \param bt beat tracking object
     73
     74  Returns the currently observed period, in samples, or 0 if no consistent
     75  value is found.
     76
     77*/
     78smpl_t aubio_beattracking_get_period (aubio_beattracking_t * bt);
     79
     80/** get current beat period in seconds
     81
     82  \param bt beat tracking object
     83
     84  Returns the currently observed period, in seconds, or 0 if no consistent
     85  value is found.
     86
     87*/
     88smpl_t aubio_beattracking_get_period_s (aubio_beattracking_t * bt);
     89
    7090/** get current tempo in bpm
    7191
Note: See TracChangeset for help on using the changeset viewer.