From: Paul Brossier Date: Tue, 6 Oct 2009 15:06:30 +0000 (+0200) Subject: examples/aubioonset.c: use interpolated onset position X-Git-Tag: bzr2git~204 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=19f1dc9b5dd9997b2b152cebacb9ff8112adc323;p=aubio.git examples/aubioonset.c: use interpolated onset position --- diff --git a/examples/aubioonset.c b/examples/aubioonset.c index ea9f12f3..1d412e31 100644 --- a/examples/aubioonset.c +++ b/examples/aubioonset.c @@ -43,11 +43,11 @@ int aubio_process(smpl_t **input, smpl_t **output, int nframes) { aubio_onsetdetection(o2,fftgrain, onset2); onset->data[0][0] *= onset2->data[0][0]; } - isonset = aubio_peakpick_pimrt(onset,parms); + isonset = aubio_peakpicker_do(parms, onset); if (isonset) { /* test for silence */ if (aubio_silence_detection(ibuf, silence)==1) - isonset=0; + isonset=0.; else for (pos = 0; pos < overlap_size; pos++){ obuf->data[0][pos] = woodblock->data[0][pos]; @@ -71,7 +71,7 @@ void process_print (void) { * actual onset */ if (isonset && output_filename == NULL) { if(frames >= 4) { - outmsg("%f\n",(frames-frames_delay)*overlap_size/(float)samplerate); + outmsg("%f\n",(frames - frames_delay + isonset)*overlap_size/(float)samplerate); } else if (frames < frames_delay) { outmsg("%f\n",0.); } @@ -79,7 +79,7 @@ void process_print (void) { } int main(int argc, char **argv) { - frames_delay = 4; + frames_delay = 3; examples_common_init(argc,argv); examples_common_process(aubio_process,process_print); examples_common_del(); diff --git a/examples/utils.c b/examples/utils.c index 304fb47b..fe86ef8c 100644 --- a/examples/utils.c +++ b/examples/utils.c @@ -67,7 +67,7 @@ aubio_onsetdetection_t *o; aubio_onsetdetection_t *o2; fvec_t *onset; fvec_t *onset2; -int isonset = 0; +smpl_t isonset = 0; aubio_pickpeak_t *parms; diff --git a/examples/utils.h b/examples/utils.h index 5901c1f4..b3acf328 100644 --- a/examples/utils.h +++ b/examples/utils.h @@ -100,7 +100,7 @@ extern aubio_onsetdetection_t *o; extern aubio_onsetdetection_t *o2; extern fvec_t *onset; extern fvec_t *onset2; -extern int isonset; +extern smpl_t isonset; extern aubio_pickpeak_t *parms;