Mercurial > hg > pyin
changeset 4:3cf34d0effed
Ensure that parameters are initialised with their default values; avoid crashing on empty input (both flagged by vamp-plugin-tester)
author | Chris Cannam |
---|---|
date | Thu, 28 Nov 2013 13:08:57 +0000 |
parents | 72f014d0bce0 |
children | dab27ad8ce8a |
files | PYIN.cpp VampYin.cpp |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/PYIN.cpp Thu Nov 28 13:08:25 2013 +0000 +++ b/PYIN.cpp Thu Nov 28 13:08:57 2013 +0000 @@ -55,7 +55,7 @@ m_oSmoothedPitchTrack(0), m_oNotes(0), m_threshDistr(2.0f), - m_outputUnvoiced(0), + m_outputUnvoiced(2.0f), m_pitchProb(0), m_timestamp(0) { @@ -442,6 +442,10 @@ f.hasTimestamp = true; f.hasDuration = false; + if (m_pitchProb.empty()) { + return fs; + } + // MONO-PITCH STUFF MonoPitch mp; std::cerr << "before viterbi" << std::endl;