# HG changeset patch # User matthiasm # Date 1420644123 0 # Node ID 686d59c7c3bef3742bf4ca126f8fdcbbaa0508c4 # Parent c6e4ea83f84dcd934f82cc7d5bb04b826bc45808 removed fourth "inter-note" state because it wasn't used anyway diff -r c6e4ea83f84d -r 686d59c7c3be MonoNoteHMM.cpp --- a/MonoNoteHMM.cpp Wed Jan 07 14:36:30 2015 +0000 +++ b/MonoNoteHMM.cpp Wed Jan 07 15:22:03 2015 +0000 @@ -165,15 +165,15 @@ to.push_back(index+2); transProb.push_back(par.pSilentSelftrans); - // the "easy" inter state transition - from.push_back(index+3); - to.push_back(index+3); - transProb.push_back(par.pInterSelftrans); + // // the "easy" inter state transition + // from.push_back(index+3); + // to.push_back(index+3); + // transProb.push_back(par.pInterSelftrans); // the more complicated transitions from the silent and inter state double probSumSilent = 0; - double probSumInter = 0; - vector tempTransProbInter; + // double probSumInter = 0; + // vector tempTransProbInter; vector tempTransProbSilent; for (size_t jPitch = 0; jPitch < (par.nS * par.nPPS); ++jPitch) { @@ -191,24 +191,24 @@ double tempWeightSilent = boost::math::pdf(noteDistanceDistr, semitoneDistance); - double tempWeightInter = semitoneDistance == 0 ? - 0 : tempWeightSilent; + // double tempWeightInter = semitoneDistance == 0 ? + // 0 : tempWeightSilent; probSumSilent += tempWeightSilent; - probSumInter += tempWeightInter; + // probSumInter += tempWeightInter; tempTransProbSilent.push_back(tempWeightSilent); - tempTransProbInter.push_back(tempWeightInter); + // tempTransProbInter.push_back(tempWeightInter); from.push_back(index+2); to.push_back(toIndex); - from.push_back(index+3); - to.push_back(toIndex); + // from.push_back(index+3); + // to.push_back(toIndex); } } for (size_t i = 0; i < tempTransProbSilent.size(); ++i) { transProb.push_back((1-par.pSilentSelftrans) * tempTransProbSilent[i]/probSumSilent); - transProb.push_back((1-par.pInterSelftrans) * tempTransProbInter[i]/probSumInter); + // transProb.push_back((1-par.pInterSelftrans) * tempTransProbInter[i]/probSumInter); } } } diff -r c6e4ea83f84d -r 686d59c7c3be MonoNoteParameters.cpp --- a/MonoNoteParameters.cpp Wed Jan 07 14:36:30 2015 +0000 +++ b/MonoNoteParameters.cpp Wed Jan 07 15:22:03 2015 +0000 @@ -16,17 +16,17 @@ MonoNoteParameters::MonoNoteParameters() : minPitch(35), nPPS(3), - nS(50), - nSPP(4), // states per pitch + nS(69), + nSPP(3), // states per pitch n(0), initPi(0), pAttackSelftrans(0.9), pStableSelftrans(0.99), pStable2Silent(0.01), - pSilentSelftrans(0.99999), + pSilentSelftrans(0.9999), sigma2Note(0.7), maxJump(13), - pInterSelftrans(0.9), + pInterSelftrans(0.0), priorPitchedProb(.7), priorWeight(0.5), minSemitoneDistance(.5), diff -r c6e4ea83f84d -r 686d59c7c3be MonoPitchHMM.cpp --- a/MonoPitchHMM.cpp Wed Jan 07 14:36:30 2015 +0000 +++ b/MonoPitchHMM.cpp Wed Jan 07 15:22:03 2015 +0000 @@ -22,7 +22,7 @@ using std::pair; MonoPitchHMM::MonoPitchHMM() : -m_minFreq(27.5), +m_minFreq(61.735), m_nBPS(5), m_nPitch(0), m_transitionWidth(0), @@ -31,7 +31,7 @@ m_freqs(0) { m_transitionWidth = 5*(m_nBPS/2) + 1; - m_nPitch = 72 * m_nBPS; + m_nPitch = 69 * m_nBPS; m_freqs = vector(2*m_nPitch); for (size_t iPitch = 0; iPitch < m_nPitch; ++iPitch) { diff -r c6e4ea83f84d -r 686d59c7c3be PYIN.cpp --- a/PYIN.cpp Wed Jan 07 14:36:30 2015 +0000 +++ b/PYIN.cpp Wed Jan 07 15:22:03 2015 +0000 @@ -470,8 +470,6 @@ std::vector notePitchTrack; // collects pitches for one note at a time for (size_t iFrame = 0; iFrame < nFrame; ++iFrame) { - if (mnOut[iFrame].noteState>3) - std::cerr << mnOut[iFrame].noteState << std::endl; isVoiced = mnOut[iFrame].noteState < 3 && smoothedPitch[iFrame].size() > 0; if (isVoiced && iFrame != nFrame-1) { @@ -483,7 +481,7 @@ float pitch = smoothedPitch[iFrame][0].first; notePitchTrack.push_back(pitch); // add to the note's pitch track } else { // not currently voiced - if (oldIsVoiced == 1 && notePitchTrack.size() > 17) // end of the note + if (oldIsVoiced == 1 && notePitchTrack.size() > 17) // end of note { std::sort(notePitchTrack.begin(), notePitchTrack.end()); float medianPitch = notePitchTrack[notePitchTrack.size()/2];