fix aubio-onset detection parameters
authorRobin Gareus <robin@gareus.org>
Sun, 1 May 2016 16:47:14 +0000 (18:47 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 1 May 2016 16:47:14 +0000 (18:47 +0200)
libs/ardour/ardour/onset_detector.h
libs/ardour/onset_detector.cc
libs/vamp-plugins/Onset.cpp

index 40eac9b4653f2a9bffdc48bf8af18540732f47bf..a77b84f8902df9f6b923e56ee14a1a087c835562 100644 (file)
@@ -37,6 +37,7 @@ public:
 
        void set_silence_threshold (float);
        void set_peak_threshold (float);
+       void set_minioi (float);
        void set_function (int);
 
        int run (const std::string& path, Readable*, uint32_t channel, AnalysisFeatureList& results);
index 60fea6dabb33dac17accf227ab16da7be146e984..eb64a774333304976cb0a4285ee5762c20f4b4d0 100644 (file)
@@ -92,6 +92,16 @@ OnsetDetector::set_peak_threshold (float val)
        }
 }
 
+void
+OnsetDetector::set_minioi (float val)
+{
+#ifdef HAVE_AUBIO4
+       if (plugin) {
+               plugin->setParameter ("minioi", val);
+       }
+#endif
+}
+
 void
 OnsetDetector::set_function (int val)
 {
index 93f90f94690b0604e0ba180844eaa483190fe5c5..03e35ba3fe8f3e41836f843013146d39e968c1fe 100644 (file)
@@ -166,6 +166,12 @@ Onset::reset()
                                              lrintf(m_inputSampleRate));
 
     m_lastOnset = Vamp::RealTime::zeroTime - m_delay - m_delay;
+#else
+    if (m_onsetdet) aubio_onsetdetection_free(m_onsetdet);
+    if (m_peakpick) del_aubio_peakpicker(m_peakpick);
+
+    m_peakpick = new_aubio_peakpicker(m_threshold);
+    m_onsetdet = new_aubio_onsetdetection(m_onsettype, m_blockSize, m_channelCount);
 #endif
 }