Mercurial > hg > qm-vamp-plugins
comparison plugins/KeyDetect.cpp @ 233:c9c562f37dd7
Update tests and versions for qm-dsp fixes
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Thu, 30 May 2019 16:22:09 +0100 |
parents | dcf5800f0f00 |
children | 3e882621e2dd |
comparison
equal
deleted
inserted
replaced
232:48c60a09577d | 233:c9c562f37dd7 |
---|---|
73 } | 73 } |
74 | 74 |
75 int | 75 int |
76 KeyDetector::getPluginVersion() const | 76 KeyDetector::getPluginVersion() const |
77 { | 77 { |
78 return 4; | 78 return 5; |
79 } | 79 } |
80 | 80 |
81 string | 81 string |
82 KeyDetector::getCopyright() const | 82 KeyDetector::getCopyright() const |
83 { | 83 { |
286 | 286 |
287 for ( unsigned int i = 0 ; i < m_blockSize; i++ ) { | 287 for ( unsigned int i = 0 ; i < m_blockSize; i++ ) { |
288 m_inputFrame[i] = (double)inputBuffers[0][i]; | 288 m_inputFrame[i] = (double)inputBuffers[0][i]; |
289 } | 289 } |
290 | 290 |
291 // int key = (m_getKeyMode->process(m_inputFrame) % 24); | |
292 int key = m_getKeyMode->process(m_inputFrame); | 291 int key = m_getKeyMode->process(m_inputFrame); |
293 bool minor = m_getKeyMode->isModeMinor(key); | 292 bool minor = m_getKeyMode->isModeMinor(key); |
294 int tonic = key; | 293 int tonic = key; |
295 if (tonic > 12) tonic -= 12; | 294 if (tonic > 12) tonic -= 12; |
296 | 295 |
299 | 298 |
300 if (m_first || (tonic != prevTonic)) { | 299 if (m_first || (tonic != prevTonic)) { |
301 Feature feature; | 300 Feature feature; |
302 feature.hasTimestamp = true; | 301 feature.hasTimestamp = true; |
303 feature.timestamp = now; | 302 feature.timestamp = now; |
304 // feature.timestamp = now; | |
305 feature.values.push_back((float)tonic); | 303 feature.values.push_back((float)tonic); |
306 feature.label = getKeyName(tonic, minor, false); | 304 feature.label = getKeyName(tonic, minor, false); |
307 returnFeatures[0].push_back(feature); // tonic | 305 returnFeatures[0].push_back(feature); // tonic |
308 } | 306 } |
309 | 307 |