Mercurial > hg > qm-vamp-plugins
comparison plugins/TonalChangeDetect.cpp @ 222:bd084c486076
Fix incorrect time alignment of tonal-change plugin outputs. This bug was introduced in December 2008, so we are squashing it just before its tenth birthday.
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Mon, 05 Nov 2018 15:31:19 +0000 |
parents | f96ea0e4b475 |
children | c9c562f37dd7 |
comparison
equal
deleted
inserted
replaced
221:9de7d3bcf7e3 | 222:bd084c486076 |
---|---|
102 return "Queen Mary, University of London"; | 102 return "Queen Mary, University of London"; |
103 } | 103 } |
104 | 104 |
105 int TonalChangeDetect::getPluginVersion() const | 105 int TonalChangeDetect::getPluginVersion() const |
106 { | 106 { |
107 return 2; | 107 return 3; |
108 } | 108 } |
109 | 109 |
110 std::string TonalChangeDetect::getCopyright() const | 110 std::string TonalChangeDetect::getCopyright() const |
111 { | 111 { |
112 return "Plugin by Martin Gasser and Christopher Harte. Copyright (c) 2006-2009 QMUL - All Rights Reserved"; | 112 return "Plugin by Martin Gasser and Christopher Harte. Copyright (c) 2006-2009 QMUL - All Rights Reserved"; |
312 return list; | 312 return list; |
313 } | 313 } |
314 | 314 |
315 TonalChangeDetect::FeatureSet | 315 TonalChangeDetect::FeatureSet |
316 TonalChangeDetect::process(const float *const *inputBuffers, | 316 TonalChangeDetect::process(const float *const *inputBuffers, |
317 | |
317 Vamp::RealTime timestamp) | 318 Vamp::RealTime timestamp) |
318 { | 319 { |
319 if (!m_chromagram) { | 320 if (!m_chromagram) { |
320 cerr << "ERROR: TonalChangeDetect::process: " | 321 cerr << "ERROR: TonalChangeDetect::process: " |
321 << "Chromagram has not been initialised" | 322 << "Chromagram has not been initialised" |
322 << endl; | 323 << endl; |
323 return FeatureSet(); | 324 return FeatureSet(); |
324 } | 325 } |
325 | 326 |
326 if (!m_haveOrigin) m_origin = timestamp; | 327 if (!m_haveOrigin) { |
328 m_origin = timestamp; | |
329 m_haveOrigin = true; | |
330 } | |
327 | 331 |
328 // convert float* to double* | 332 // convert float* to double* |
329 double *tempBuffer = new double[m_block]; | 333 double *tempBuffer = new double[m_block]; |
330 for (size_t i = 0; i < m_block; ++i) { | 334 for (size_t i = 0; i < m_block; ++i) { |
331 tempBuffer[i] = inputBuffers[0][i]; | 335 tempBuffer[i] = inputBuffers[0][i]; |