shithub: aubio

Download patch

ref: 17b08e6f755363a97f44fe0d630c994e447b53d7
parent: b6bb2658491cd6591930e14b81b68eb1a3a19d02
author: Paul Brossier <piem@piem.org>
date: Sat Dec 17 07:10:53 EST 2016

src/notes/notes.h: add aubio_notes_{get,set}_minioi_ms

--- a/src/notes/notes.c
+++ b/src/notes/notes.c
@@ -119,6 +119,20 @@
   return aubio_pitch_get_silence(o->pitch);
 }
 
+uint_t aubio_notes_set_minioi_ms (aubio_notes_t *o, smpl_t minioi_ms)
+{
+  uint_t err = AUBIO_OK;
+  if (!o->onset || (aubio_onset_set_minioi_ms(o->onset, minioi_ms) != 0)) {
+    err = AUBIO_FAIL;
+  }
+  return err;
+}
+
+smpl_t aubio_notes_get_minioi_ms(const aubio_notes_t *o)
+{
+  return aubio_pitch_get_silence(o->pitch);
+}
+
 /** append new note candidate to the note_buffer and return filtered value. we
  * need to copy the input array as fvec_median destroy its input data.*/
 static void
--- a/src/notes/notes.h
+++ b/src/notes/notes.h
@@ -73,6 +73,8 @@
   \param o notes detection object as returned by new_aubio_notes()
   \param silence new silence detection threshold
 
+  \return 0 on success, non-zero otherwise
+
 */
 uint_t aubio_notes_set_silence(aubio_notes_t * o, smpl_t silence);
 
@@ -84,6 +86,25 @@
 
 */
 smpl_t aubio_notes_get_silence(const aubio_notes_t * o);
+
+/** get notes detection minimum inter-onset interval, in millisecond
+
+  \param o notes detection object as returned by new_aubio_notes()
+
+  \return current minimum inter onset interval
+
+ */
+smpl_t aubio_notes_get_minioi_ms(const aubio_notes_t *o);
+
+/** set notes detection minimum inter-onset interval, in millisecond
+
+  \param o notes detection object as returned by new_aubio_notes()
+  \param minioi_ms new inter-onset interval
+
+  \return 0 on success, non-zero otherwise
+
+*/
+uint_t aubio_notes_set_minioi_ms (aubio_notes_t *o, smpl_t minioi_ms);
 
 #ifdef __cplusplus
 }