Changes in / [8708556:21bd43c]


Ignore:
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • examples/tests/test-beattracking.c

    r8708556 r21bd43c  
    1313        uint_t i = 0;
    1414
     15        smpl_t curtempo;
     16
    1517        while (i < 10) {
    1618          aubio_beattracking_do(tempo,in,out);
     19          curtempo = aubio_beattracking_get_bpm(tempo);
     20          if (curtempo != 0.) {
     21            fprintf(stdout,"%f\n",curtempo);
     22            return 1;
     23          }
    1724          i++;
    1825        };
  • examples/tests/test-tempo.c

    r8708556 r21bd43c  
    1010        uint_t i = 0;
    1111
     12        smpl_t curtempo;
     13
    1214        while (i < 1000) {
    1315          aubio_tempo(o,in,out);
     16          curtempo = aubio_tempo_get_bpm(o);
     17          if (curtempo != 0.) {
     18            fprintf(stdout,"%f\n",curtempo);
     19          }
    1420          i++;
    1521        };
  • src/beattracking.c

    r8708556 r21bd43c  
    453453
    454454}
     455
     456smpl_t aubio_beattracking_get_bpm(aubio_beattracking_t * bt) {
     457        if (bt->timesig != 0 && bt->counter == 0 && bt->flagstep == 0) {
     458          return 5168. / (smpl_t)bt->gp;
     459        } else {
     460          return 0.;
     461        }
     462}
  • src/beattracking.h

    r8708556 r21bd43c  
    6060*/
    6161void aubio_beattracking_do(aubio_beattracking_t * bt, fvec_t * dfframes, fvec_t * out);
     62/** get current tempo in bpm
     63
     64  \param bt beat tracking object
     65
     66  Returns the currently observed tempo, in beats per minutes, or 0 if no
     67  consistent value is found.
     68
     69*/
     70smpl_t aubio_beattracking_get_bpm(aubio_beattracking_t * bt);
    6271/** delete beat tracking object
    6372
  • src/tempo.c

    r8708556 r21bd43c  
    124124}
    125125
     126smpl_t aubio_tempo_get_bpm(aubio_tempo_t *o) {
     127  return aubio_beattracking_get_bpm(o->bt);
     128}
     129
    126130void del_aubio_tempo (aubio_tempo_t *o)
    127131{
  • src/tempo.h

    r8708556 r21bd43c  
    5050void aubio_tempo_set_threshold(aubio_tempo_t * o, smpl_t threshold);
    5151
     52/** get current tempo
     53
     54  \param bt beat tracking object
     55
     56  Returns the currently observed tempo, or 0 if no consistent value is found
     57
     58*/
     59smpl_t aubio_tempo_get_bpm(aubio_tempo_t * bt);
     60
    5261/** delete tempo detection object */
    5362void del_aubio_tempo(aubio_tempo_t * o);
Note: See TracChangeset for help on using the changeset viewer.