From: Paul Brossier Date: Tue, 12 Feb 2013 19:06:31 +0000 (-0500) Subject: src/onset/onset.{c,h}: added get_descriptor and get_thresholded_descriptor X-Git-Tag: 0.4.0-beta1~326 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=ae81726ff86a442ecd236e0a6060f51bcb996a90;p=aubio.git src/onset/onset.{c,h}: added get_descriptor and get_thresholded_descriptor --- diff --git a/src/onset/onset.c b/src/onset/onset.c index b5563454..ecf9a473 100644 --- a/src/onset/onset.c +++ b/src/onset/onset.c @@ -72,6 +72,15 @@ void aubio_onset_do (aubio_onset_t *o, fvec_t * input, fvec_t * onset) return; } +smpl_t aubio_onset_get_descriptor(aubio_onset_t * o) { + return o->of->data[0]; +} + +smpl_t aubio_onset_get_thresholded_descriptor(aubio_onset_t * o) { + fvec_t * thresholded = aubio_peakpicker_get_thresholded_input(o->pp); + return thresholded->data[0]; +} + uint_t aubio_onset_set_silence(aubio_onset_t * o, smpl_t silence) { o->silence = silence; return AUBIO_OK; diff --git a/src/onset/onset.h b/src/onset/onset.h index f6db345a..c5ed9f4b 100644 --- a/src/onset/onset.h +++ b/src/onset/onset.h @@ -72,6 +72,22 @@ void aubio_onset_do (aubio_onset_t *o, fvec_t * input, fvec_t * onset); */ uint_t aubio_onset_set_silence(aubio_onset_t * o, smpl_t silence); +/** get onset detection function + + \param o onset detection object as returned by new_aubio_onset + \return the current value of the descriptor + +*/ +smpl_t aubio_onset_get_descriptor ( aubio_onset_t *o); + +/** get thresholded onset detection function + + \param o onset detection object as returned by new_aubio_onset + \return the value of the thresholded descriptor + +*/ +smpl_t aubio_onset_get_thresholded_descriptor ( aubio_onset_t *o); + /** set onset detection peak picking threshold \param o onset detection object as returned by new_aubio_onset