changeset 9:deae47ee00e7

OnsetsDS Vamp plugin can now output the raw/filtered ODF - thanks Jose Javier Valero Mas
author Dan Stowell <dan.stowell@elec.qmul.ac.uk>
date Fri, 29 Nov 2013 11:57:32 +0000
parents 8d42e9e7d394
children 1aa45968fbad
files onsetsdsplugin.cpp
diffstat 1 files changed, 35 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/onsetsdsplugin.cpp	Fri Sep 06 18:30:17 2013 +0100
+++ b/onsetsdsplugin.cpp	Fri Nov 29 11:57:32 2013 +0000
@@ -248,7 +248,30 @@
     onsets.binCount = 0;
     onsets.sampleType = OutputDescriptor::VariableSampleRate;
     onsets.sampleRate = (m_inputSampleRate / m_stepSize);
+    list.push_back(onsets);
 
+    //--- Extracting the ODF
+    onsets = OutputDescriptor();
+    onsets.identifier = "odf";
+    onsets.name = "Onset Detection Function";
+    onsets.description = "Onset Detection Function used for detecting onsets";
+    onsets.unit = "";
+    onsets.hasFixedBinCount = false;
+    onsets.binCount = 0;
+    onsets.sampleType = OutputDescriptor::OneSamplePerStep;
+    onsets.sampleRate = (m_inputSampleRate / m_stepSize);
+    list.push_back(onsets);
+
+    //--- Extracting the Filtered ODF
+    onsets = OutputDescriptor();
+    onsets.identifier = "filtered_odf";
+    onsets.name = "Filtered Onset Detection Function";
+    onsets.description = "Filtered Onset Detection Function used for detecting onsets";
+    onsets.unit = "";
+    onsets.hasFixedBinCount = false;
+    onsets.binCount = 0;
+    onsets.sampleType = OutputDescriptor::OneSamplePerStep;
+    onsets.sampleRate = (m_inputSampleRate / m_stepSize);
     list.push_back(onsets);
 
     return list;
@@ -277,6 +300,18 @@
         returnFeatures[0].push_back(feature); // onsets are output 0
     }
 
+    //--- Extracting the ODF
+    Feature odf_feature;
+    odf_feature.hasTimestamp = false;
+    odf_feature.values.push_back(m_ods->odfvals[0]);
+    returnFeatures[1].push_back(odf_feature);
+
+    //--- Extracting the Filtered ODF
+    Feature filtered_odf_feature;
+    filtered_odf_feature.hasTimestamp = false;
+    filtered_odf_feature.values.push_back(m_ods->odfvalpost);
+    returnFeatures[2].push_back(filtered_odf_feature);
+
     return returnFeatures;
 }