summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-05-01 18:47:14 +0200
committerRobin Gareus <robin@gareus.org>2016-05-01 18:47:14 +0200
commit9d50074a99c4bd9e9b07ae3dccde6df889a8d899 (patch)
treed6e356260f44272ba89179b98088d3901b0a065d /libs
parent5f65964ee9d84748cebf3fe75d8c204a20aac9ae (diff)
fix aubio-onset detection parameters
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/onset_detector.h1
-rw-r--r--libs/ardour/onset_detector.cc10
-rw-r--r--libs/vamp-plugins/Onset.cpp6
3 files changed, 17 insertions, 0 deletions
diff --git a/libs/ardour/ardour/onset_detector.h b/libs/ardour/ardour/onset_detector.h
index 40eac9b465..a77b84f890 100644
--- a/libs/ardour/ardour/onset_detector.h
+++ b/libs/ardour/ardour/onset_detector.h
@@ -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);
diff --git a/libs/ardour/onset_detector.cc b/libs/ardour/onset_detector.cc
index 60fea6dabb..eb64a77433 100644
--- a/libs/ardour/onset_detector.cc
+++ b/libs/ardour/onset_detector.cc
@@ -93,6 +93,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)
{
if (plugin) {
diff --git a/libs/vamp-plugins/Onset.cpp b/libs/vamp-plugins/Onset.cpp
index 93f90f9469..03e35ba3fe 100644
--- a/libs/vamp-plugins/Onset.cpp
+++ b/libs/vamp-plugins/Onset.cpp
@@ -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
}