From 8fb92dfb98a5a09c1c3f59aea96c77cc884a6a22 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 28 Jan 2015 13:27:52 +0100 Subject: [PATCH] plugins/Onset.cpp: added onset detection function and threshold odf --- plugins/Onset.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/plugins/Onset.cpp b/plugins/Onset.cpp index 87949b3..49cd566 100644 --- a/plugins/Onset.cpp +++ b/plugins/Onset.cpp @@ -244,6 +244,24 @@ Onset::getOutputDescriptors() const d.sampleRate = 0; list.push_back(d); + d.identifier = "odf"; + d.name = "Onset detection function"; + d.description = "Output of the onset detection function"; + d.binCount = 1; + d.isQuantized = true; + d.quantizeStep = 1.0; + d.sampleType = OutputDescriptor::OneSamplePerStep; + list.push_back(d); + + d.identifier = "todf"; + d.name = "Thresholded Onset detection function"; + d.description = "Output of the thresholded onset detection function"; + d.binCount = 1; + d.isQuantized = true; + d.quantizeStep = 1.0; + d.sampleType = OutputDescriptor::OneSamplePerStep; + list.push_back(d); + return list; } @@ -272,6 +290,16 @@ Onset::process(const float *const *inputBuffers, } } + Feature odf; + odf.hasTimestamp = false; + odf.values.push_back(aubio_onset_get_descriptor(m_onsetdet)); + returnFeatures[1].push_back(odf); + + Feature todf; + todf.hasTimestamp = false; + todf.values.push_back(aubio_onset_get_thresholded_descriptor(m_onsetdet)); + returnFeatures[2].push_back(todf); + return returnFeatures; } -- 2.11.0