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

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

File:
1 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.;
Note: See TracChangeset for help on using the changeset viewer.