Mercurial > hg > qm-vamp-plugins
changeset 33:7359cda467c3
Just a few comments to help explain bin numbering etc. Matches revision 541 to qm-dsp's GetKeyMode.
author | chriss <devnull@localhost> |
---|---|
date | Wed, 21 Nov 2007 16:54:56 +0000 |
parents | 8cde4a0f36ef |
children | 1682d09ec2dd |
files | plugins/KeyDetect.cpp |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/KeyDetect.cpp Fri Nov 09 17:03:58 2007 +0000 +++ b/plugins/KeyDetect.cpp Wed Nov 21 16:54:56 2007 +0000 @@ -279,6 +279,7 @@ int tonic = key; if (tonic > 12) tonic -= 12; + int prevTonic = m_prevKey; if (prevTonic > 12) prevTonic -= 12; @@ -309,6 +310,9 @@ if (minor) feature.label += " minor"; else feature.label += " major"; returnFeatures[2].push_back(feature); // key + cerr << "int key = "<<key<<endl; + cerr << "int tonic = "<<tonic<<endl; + cerr << "feature label = "<<feature.label<<endl; } m_prevKey = key; @@ -350,6 +354,8 @@ const char * KeyDetector::getKeyName(int index) { + // Keys are numbered with 1 => C, 12 => B + // This is based on chromagram base set to a C in qm-dsp's GetKeyMode.cpp static const char *names[] = { "C", "C# / Db", "D", "D# / Eb", "E", "F", "F# / Gb", "G", @@ -358,6 +364,6 @@ if (index < 1 || index > 12) { return "(unknown)"; } - return names[index - 1]; + return names[index - 1]; //'-1' because our names array starts from 0 }