comparison plugins/Onset.cpp @ 71:649c343a4b94

plugins/Onset.cpp: added onset detection function and threshold odf
author Paul Brossier <piem@piem.org>
date Wed, 28 Jan 2015 13:27:52 +0100
parents 757e99172fa0
children f80b207ccd15
comparison
equal deleted inserted replaced
70:c49a58161590 71:649c343a4b94
242 d.binCount = 0; 242 d.binCount = 0;
243 d.sampleType = OutputDescriptor::VariableSampleRate; 243 d.sampleType = OutputDescriptor::VariableSampleRate;
244 d.sampleRate = 0; 244 d.sampleRate = 0;
245 list.push_back(d); 245 list.push_back(d);
246 246
247 d.identifier = "odf";
248 d.name = "Onset detection function";
249 d.description = "Output of the onset detection function";
250 d.binCount = 1;
251 d.isQuantized = true;
252 d.quantizeStep = 1.0;
253 d.sampleType = OutputDescriptor::OneSamplePerStep;
254 list.push_back(d);
255
256 d.identifier = "todf";
257 d.name = "Thresholded Onset detection function";
258 d.description = "Output of the thresholded onset detection function";
259 d.binCount = 1;
260 d.isQuantized = true;
261 d.quantizeStep = 1.0;
262 d.sampleType = OutputDescriptor::OneSamplePerStep;
263 list.push_back(d);
264
247 return list; 265 return list;
248 } 266 }
249 267
250 Onset::FeatureSet 268 Onset::FeatureSet
251 Onset::process(const float *const *inputBuffers, 269 Onset::process(const float *const *inputBuffers,
270 returnFeatures[0].push_back(onsettime); 288 returnFeatures[0].push_back(onsettime);
271 m_lastOnset = timestamp; 289 m_lastOnset = timestamp;
272 } 290 }
273 } 291 }
274 292
293 Feature odf;
294 odf.hasTimestamp = false;
295 odf.values.push_back(aubio_onset_get_descriptor(m_onsetdet));
296 returnFeatures[1].push_back(odf);
297
298 Feature todf;
299 todf.hasTimestamp = false;
300 todf.values.push_back(aubio_onset_get_thresholded_descriptor(m_onsetdet));
301 returnFeatures[2].push_back(todf);
302
275 return returnFeatures; 303 return returnFeatures;
276 } 304 }
277 305
278 Onset::FeatureSet 306 Onset::FeatureSet
279 Onset::getRemainingFeatures() 307 Onset::getRemainingFeatures()