shithub: aubio

Download patch

ref: ae81726ff86a442ecd236e0a6060f51bcb996a90
parent: b0d5a4829cb24f19de93d13b9ea4fdcadfabca8f
author: Paul Brossier <[email protected]>
date: Tue Feb 12 09:06:31 EST 2013

src/onset/onset.{c,h}: added get_descriptor and get_thresholded_descriptor

--- a/src/onset/onset.c
+++ b/src/onset/onset.c
@@ -72,6 +72,15 @@
   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;
--- a/src/onset/onset.h
+++ b/src/onset/onset.h
@@ -72,6 +72,22 @@
 */
 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