# HG changeset patch # User Chris Cannam # Date 1147697806 0 # Node ID 8230b03a8060265e625b7521fa587bf04faf31fa # Parent 76761a42d2390b74ba9cd451a5020755ef9c2ed7 * Add onset detection function output. diff -r 76761a42d239 -r 8230b03a8060 plugins/Onset.cpp --- a/plugins/Onset.cpp Thu May 11 14:51:10 2006 +0000 +++ b/plugins/Onset.cpp Mon May 15 12:56:46 2006 +0000 @@ -31,7 +31,8 @@ m_onsetdet(0), m_onsettype(aubio_onset_mkl), m_threshold(0.3), - m_silence(-90) + m_silence(-90), + m_channelCount(1) { } @@ -215,6 +216,17 @@ d.sampleType = OutputDescriptor::OneSamplePerStep; list.push_back(d); + d = OutputDescriptor(); + d.name = "detectionfunction"; + d.unit = ""; + d.description = "Onset Detection Function"; + d.hasFixedBinCount = true; + d.binCount = m_channelCount; + d.hasKnownExtents = false; + d.isQuantized = false; + d.sampleType = OutputDescriptor::OneSamplePerStep; + list.push_back(d); + return list; } @@ -243,6 +255,11 @@ if (isonset) { returnFeatures[0].push_back(Feature()); } + Feature feature; + for (size_t j = 0; j < m_channelCount; ++j) { + feature.values.push_back(m_onset->data[j][0]); + } + returnFeatures[1].push_back(feature); return returnFeatures; }