Mercurial > hg > nnls-chroma
comparison NNLSBase.cpp @ 95:dab7e7bfeba1 matthiasm-plugin 0.2
added release notes, updated README
author | matthiasm |
---|---|
date | Fri, 03 Dec 2010 00:46:12 +0900 |
parents | 12cdf228c47d |
children | d1398182a072 |
comparison
equal
deleted
inserted
replaced
94:19f3b33a19fb | 95:dab7e7bfeba1 |
---|---|
47 m_kernelNoteIndex(0), | 47 m_kernelNoteIndex(0), |
48 m_dict(0), | 48 m_dict(0), |
49 m_tuneLocal(0.0), | 49 m_tuneLocal(0.0), |
50 m_doNormalizeChroma(0), | 50 m_doNormalizeChroma(0), |
51 m_rollon(0.0), | 51 m_rollon(0.0), |
52 m_boostN(1.1), | 52 m_boostN(0.1), |
53 m_s(0.7), | 53 m_s(0.7), |
54 sinvalues(0), | 54 sinvalues(0), |
55 cosvalues(0) | 55 cosvalues(0) |
56 { | 56 { |
57 if (debug_on) cerr << "--> NNLSBase" << endl; | 57 if (debug_on) cerr << "--> NNLSBase" << endl; |
80 NNLSBase::getPluginVersion() const | 80 NNLSBase::getPluginVersion() const |
81 { | 81 { |
82 if (debug_on) cerr << "--> getPluginVersion" << endl; | 82 if (debug_on) cerr << "--> getPluginVersion" << endl; |
83 // Increment this each time you release a version that behaves | 83 // Increment this each time you release a version that behaves |
84 // differently from the previous one | 84 // differently from the previous one |
85 return 1; | 85 return 2; |
86 } | 86 } |
87 | 87 |
88 string | 88 string |
89 NNLSBase::getCopyright() const | 89 NNLSBase::getCopyright() const |
90 { | 90 { |
446 // make magnitude | 446 // make magnitude |
447 float maxmag = -10000; | 447 float maxmag = -10000; |
448 for (size_t iBin = 0; iBin < m_blockSize/2; iBin++) { | 448 for (size_t iBin = 0; iBin < m_blockSize/2; iBin++) { |
449 magnitude[iBin] = sqrt(fbuf[2 * iBin] * fbuf[2 * iBin] + | 449 magnitude[iBin] = sqrt(fbuf[2 * iBin] * fbuf[2 * iBin] + |
450 fbuf[2 * iBin + 1] * fbuf[2 * iBin + 1]); | 450 fbuf[2 * iBin + 1] * fbuf[2 * iBin + 1]); |
451 if (magnitude[iBin]>m_blockSize*1.0) magnitude[iBin] = m_blockSize; | 451 if (magnitude[iBin]>m_blockSize*1.0) magnitude[iBin] = m_blockSize; // a valid audio signal (between -1 and 1) should not be limited here. |
452 if (maxmag < magnitude[iBin]) maxmag = magnitude[iBin]; | 452 if (maxmag < magnitude[iBin]) maxmag = magnitude[iBin]; |
453 if (m_rollon > 0) { | 453 if (m_rollon > 0) { |
454 energysum += pow(magnitude[iBin],2); | 454 energysum += pow(magnitude[iBin],2); |
455 } | 455 } |
456 } | 456 } |