From ae81726ff86a442ecd236e0a6060f51bcb996a90 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Tue, 12 Feb 2013 14:06:31 -0500 Subject: [PATCH] src/onset/onset.{c,h}: added get_descriptor and get_thresholded_descriptor --- src/onset/onset.c | 9 +++++++++ src/onset/onset.h | 16 ++++++++++++++++ 2 files changed, 25 insertions(+) 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 -- 2.26.2