Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix in line 56 for pitchcontour segmentation #1165

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/algorithms/tonal/pitchcontours.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class PitchContours : public Algorithm {
declareParameter("binResolution", "salience function bin resolution [cents]", "(0,inf)", 10.0);
declareParameter("peakFrameThreshold", "per-frame salience threshold factor (fraction of the highest peak salience in a frame)", "[0,1]", 0.9);
declareParameter("peakDistributionThreshold", "allowed deviation below the peak salience mean over all frames (fraction of the standard deviation)", "[0,2]", 0.9);
declareParameter("pitchContinuity", "pitch continuity cue (maximum allowed pitch change durig 1 ms time period) [cents]", "[0,inf)", 27.5625);
declareParameter("pitchContinuity", "pitch continuity cue (maximum allowed pitch change during 1 ms time period) [cents]", "[0,inf)", 27.5625);
declareParameter("timeContinuity", "time continuity cue (the maximum allowed gap duration for a pitch contour) [ms]", "(0,inf)", 100.);
declareParameter("minDuration", "the minimum allowed contour duration [ms]", "(0,inf)", 100.);
}
Expand Down
4 changes: 4 additions & 0 deletions src/algorithms/tonal/pitchcontoursegmentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ void PitchContourSegmentation::reSegment() {
// find sequences of consecutive non-zero pitch values
startC.clear();
endC.clear();

if (pitch.size()==0){
throw(EssentiaException("PitchContourSegmentation: Empty pitch values."));
}

if (pitch[0] > 0) {
startC.push_back(0);
Expand Down