uint_t i = 0;
- smpl_t curtempo;
+ smpl_t curtempo, curtempoconf;
while (i < 10) {
aubio_beattracking_do(tempo,in,out);
fprintf(stdout,"%f\n",curtempo);
return 1;
}
+ curtempoconf = aubio_beattracking_get_confidence(tempo);
+ if (curtempoconf != 0.) {
+ fprintf(stdout,"%f\n",curtempo);
+ return 1;
+ }
i++;
};
aubio_tempo_t * o = new_aubio_tempo(aubio_onset_complex, win_s, win_s/4, channels);
uint_t i = 0;
- smpl_t curtempo;
+ smpl_t curtempo, curtempoconf;
while (i < 1000) {
aubio_tempo(o,in,out);
curtempo = aubio_tempo_get_bpm(o);
if (curtempo != 0.) {
fprintf(stdout,"%f\n",curtempo);
+ return 1;
+ }
+ curtempoconf = aubio_beattracking_get_confidence(o);
+ if (curtempoconf != 0.) {
+ fprintf(stdout,"%f\n",curtempo);
+ return 1;
}
i++;
};
return 0.;
}
}
+
+smpl_t aubio_beattracking_get_confidence(aubio_beattracking_t * bt) {
+ if (bt->gp) return vec_max(bt->acfout);
+ else return 0.;
+}
*/
smpl_t aubio_beattracking_get_bpm(aubio_beattracking_t * bt);
+/** get current tempo confidence
+
+ \param bt beat tracking object
+
+ Returns the confidence with which the tempo has been observed, 0 if no
+ consistent value is found.
+
+*/
+smpl_t aubio_beattracking_get_confidence(aubio_beattracking_t * bt);
/** delete beat tracking object
\param p beat tracking object
return aubio_beattracking_get_bpm(o->bt);
}
+smpl_t aubio_tempo_get_confidence(aubio_tempo_t *o) {
+ return aubio_beattracking_get_confidence(o->bt);
+}
+
void del_aubio_tempo (aubio_tempo_t *o)
{
del_aubio_onsetdetection(o->od);
*/
smpl_t aubio_tempo_get_bpm(aubio_tempo_t * bt);
+/** get current tempo confidence
+
+ \param bt beat tracking object
+
+ Returns the confidence with which the tempo has been observed, 0 if no
+ consistent value is found.
+
+*/
+smpl_t aubio_tempo_get_confidence(aubio_tempo_t * bt);
+
/** delete tempo detection object */
void del_aubio_tempo(aubio_tempo_t * o);
aubio_beattracking_t * new_aubio_beattracking(uint_t winlen, uint_t channels);
void aubio_beattracking_do(aubio_beattracking_t * bt, fvec_t * dfframes, fvec_t * out);
void del_aubio_beattracking(aubio_beattracking_t * p);
+smpl_t aubio_beattracking_get_bpm(aubio_beattracking_t * p);
+smpl_t aubio_beattracking_get_confidence(aubio_beattracking_t * p);