From: Paul Brossier Date: Wed, 4 Nov 2009 23:29:53 +0000 (+0100) Subject: src/onset/onset.{c,h}: minimum inter-onset-interval in millisecond X-Git-Tag: bzr2git~42 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0bbdbfd57c05a73f4fd1e6f1250bcefcac06b271;p=aubio.git src/onset/onset.{c,h}: minimum inter-onset-interval in millisecond --- diff --git a/src/onset/onset.c b/src/onset/onset.c index d626702b..37453ae4 100644 --- a/src/onset/onset.c +++ b/src/onset/onset.c @@ -90,7 +90,7 @@ uint_t aubio_onset_set_threshold(aubio_onset_t * o, smpl_t threshold) { } uint_t aubio_onset_set_minioi(aubio_onset_t * o, uint_t minioi) { - o->minioi = minioi; + o->minioi = FLOOR(minioi / 1000. * o->samplerate / o->hop_size); return AUBIO_OK; } diff --git a/src/onset/onset.h b/src/onset/onset.h index 67a34f48..be7b71fc 100644 --- a/src/onset/onset.h +++ b/src/onset/onset.h @@ -84,8 +84,8 @@ uint_t aubio_onset_set_threshold(aubio_onset_t * o, smpl_t threshold); /** set minimum inter onset interval \param o onset detection object as returned by new_aubio_onset - \param minioi minimum number of frames between onsets (in multiple of - hop_size/samplerare) + \param minioi minimum interval between two consecutive onsets (in + milliseconds) */ uint_t aubio_onset_set_minioi(aubio_onset_t * o, uint_t minioi);