src/onset/onset.{c,h}: added get_descriptor and get_thresholded_descriptor
authorPaul Brossier <piem@piem.org>
Tue, 12 Feb 2013 19:06:31 +0000 (14:06 -0500)
committerPaul Brossier <piem@piem.org>
Tue, 12 Feb 2013 19:06:31 +0000 (14:06 -0500)
src/onset/onset.c
src/onset/onset.h

index b556345..ecf9a47 100644 (file)
@@ -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;
index f6db345..c5ed9f4 100644 (file)
@@ -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