Mercurial > hg > nnls-chroma
comparison Chordino.cpp @ 168:0a743c2dac6a
Let's be even more slack about that one
author | Chris Cannam |
---|---|
date | Thu, 22 Oct 2015 11:06:23 +0100 |
parents | 25db325b6cf9 |
children | d95c4cdef8af |
comparison
equal
deleted
inserted
replaced
167:25db325b6cf9 | 168:0a743c2dac6a |
---|---|
499 for (int iBin = 12; iBin < 24; iBin++) { | 499 for (int iBin = 12; iBin < 24; iBin++) { |
500 tempchordvalue += m_chorddict[24 * iChord + iBin] * chroma[iBin]; | 500 tempchordvalue += m_chorddict[24 * iChord + iBin] * chroma[iBin]; |
501 } | 501 } |
502 if (iChord == nChord-1) tempchordvalue *= .7; | 502 if (iChord == nChord-1) tempchordvalue *= .7; |
503 if (tempchordvalue < 0) tempchordvalue = 0.0; | 503 if (tempchordvalue < 0) tempchordvalue = 0.0; |
504 if (tempchordvalue > 40.0) { | 504 if (tempchordvalue > 200.0) { |
505 if (!clipwarned) { | 505 if (!clipwarned) { |
506 cerr << "WARNING: interim chroma contains extreme chord value " << tempchordvalue << ", clipping this and any others that appear" << endl; | 506 cerr << "WARNING: interim chroma contains extreme chord value " << tempchordvalue << ", clipping this and any others that appear" << endl; |
507 clipwarned = true; | 507 clipwarned = true; |
508 } | 508 } |
509 tempchordvalue = 40.0; | 509 tempchordvalue = 200.0; |
510 } | 510 } |
511 tempchordvalue = pow(1.3, tempchordvalue); | 511 tempchordvalue = pow(1.3, tempchordvalue); |
512 sumchordvalue += tempchordvalue; | 512 sumchordvalue += tempchordvalue; |
513 currentChordSalience.push_back(tempchordvalue); | 513 currentChordSalience.push_back(tempchordvalue); |
514 } | 514 } |