# HG changeset patch # User matthiasm # Date 1427128648 0 # Node ID e9b99e85b92915da222bbd30496a4b3583f7750f # Parent 50e39363a3cbb8ae7c9497ee162b6c6b00f24e47 one minor one major thing: * moved line in PYinVamp.cpp -- should not have any effect * reinstated using peaks instead of using the difference function directly diff -r 50e39363a3cb -r e9b99e85b929 PYinVamp.cpp --- a/PYinVamp.cpp Mon Mar 23 16:09:48 2015 +0000 +++ b/PYinVamp.cpp Mon Mar 23 16:37:28 2015 +0000 @@ -449,10 +449,8 @@ } rms /= m_blockSize; rms = sqrt(rms); - // float m_lowAmp = 0.5; + bool isLowAmplitude = (rms < m_lowAmp); - float factor = ((rms+0.01*m_lowAmp)/(1.01*m_lowAmp)); - // std::cerr << rms << " " << factor << std::endl; Yin::YinOutput yo = m_yin.processProbabilisticYin(dInputBuffers); delete [] dInputBuffers; @@ -466,9 +464,11 @@ { double tempPitch = 12 * std::log(yo.freqProb[iCandidate].first/440)/std::log(2.) + 69; if (!isLowAmplitude) + { tempPitchProb.push_back(pair (tempPitch, yo.freqProb[iCandidate].second)); - else { + } else { + float factor = ((rms+0.01*m_lowAmp)/(1.01*m_lowAmp)); tempPitchProb.push_back(pair (tempPitch, yo.freqProb[iCandidate].second*factor)); } diff -r 50e39363a3cb -r e9b99e85b929 YinUtil.cpp --- a/YinUtil.cpp Mon Mar 23 16:09:48 2015 +0000 +++ b/YinUtil.cpp Mon Mar 23 16:37:28 2015 +0000 @@ -288,12 +288,12 @@ minInd = tau; } currThreshInd = nThresholdInt-1; - // while (thresholds[currThreshInd] > yinBuffer[tau] && currThreshInd > -1) { - // // std::cerr << distribution[currThreshInd] << std::endl; - // peakProb[tau] += distribution[currThreshInd]; - // currThreshInd--; - // } - peakProb[tau] = 1 - yinBuffer[tau]; + while (thresholds[currThreshInd] > yinBuffer[tau] && currThreshInd > -1) { + // std::cerr << distribution[currThreshInd] << std::endl; + peakProb[tau] += distribution[currThreshInd]; + currThreshInd--; + } + // peakProb[tau] = 1 - yinBuffer[tau]; sumProb += peakProb[tau]; tau++; } else {