Mercurial > hg > pyin
diff MonoNoteHMM.cpp @ 89:354c2c421661
some parameter changes for note and also pitch track (this may not be wise, since I made some different changes for the tony branch.. will have to merge at some point)
author | matthiasm |
---|---|
date | Wed, 07 Jan 2015 14:36:30 +0000 |
parents | 5945b8905d1f |
children | b087967c4417 |
line wrap: on
line diff
--- a/MonoNoteHMM.cpp Thu Dec 04 18:27:00 2014 +0000 +++ b/MonoNoteHMM.cpp Wed Jan 07 14:36:30 2015 +0000 @@ -68,7 +68,9 @@ minDistCandidate = iCandidate; } } - tempProb = std::pow(minDistProb, par.yinTrust) * boost::math::pdf(pitchDistr[i], pitchProb[minDistCandidate].first); + tempProb = std::pow(minDistProb, par.yinTrust) * + boost::math::pdf(pitchDistr[i], + pitchProb[minDistCandidate].first); } else { tempProb = 1; } @@ -177,15 +179,20 @@ { int fromPitch = iPitch; int toPitch = jPitch; - double semitoneDistance = std::abs(fromPitch - toPitch) * 1.0 / par.nPPS; + double semitoneDistance = + std::abs(fromPitch - toPitch) * 1.0 / par.nPPS; // if (std::fmod(semitoneDistance, 1) == 0 && semitoneDistance > par.minSemitoneDistance) - if (semitoneDistance == 0 || (semitoneDistance > par.minSemitoneDistance && semitoneDistance < par.maxJump)) + if (semitoneDistance == 0 || + (semitoneDistance > par.minSemitoneDistance + && semitoneDistance < par.maxJump)) { size_t toIndex = jPitch * par.nSPP; // note attack index - double tempWeightSilent = boost::math::pdf(noteDistanceDistr, semitoneDistance); - double tempWeightInter = semitoneDistance == 0 ? 0 : tempWeightSilent; + double tempWeightSilent = boost::math::pdf(noteDistanceDistr, + semitoneDistance); + double tempWeightInter = semitoneDistance == 0 ? + 0 : tempWeightSilent; probSumSilent += tempWeightSilent; probSumInter += tempWeightInter;