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
Changes from 1 commit
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
Prev Previous commit
remove some space
  • Loading branch information
cvf-bcn-gituser committed Nov 5, 2021
commit 33e53919b852c0fb052ac30f3b4a07e8179f263a
6 changes: 1 addition & 5 deletions test/src/unittests/tonal/test_pitchcontours.py
Original file line number Diff line number Diff line change
@@ -97,9 +97,6 @@ def _roundArray(self, pitch):

def testRegressionSynthetic(self):
# Use synthetic audio for Regression Test.
#
#

hopSize = defaultHopSize
frameSize = defaultFrameSize
sampleRate = defaultSampleRate
@@ -216,7 +213,6 @@ def testRegressionSynthetic(self):
# Check at least 156 instances of pitch value 363
self.assertGreater(int(format(rpitch.count(363))), 156)

#
# The following code ais taken the following source code from the following functions
# select_contours, _extract_pitch_contours, _join_contours, _remove_overlaps
# https://github.com/sertansenturk/predominantmelodymakam
@@ -295,7 +291,7 @@ def _extract_pitch_contours(self, audio, tc, pc):
run_windowing = estd.Windowing(zeroPadding=3 *defaultFrameSize)
run_spectrum = estd.Spectrum(size=defaultFrameSize * 4)
run_spectral_peaks = estd.SpectralPeaks(minFrequency=1,
maxFrequency=20000,
MaxFrequency=20000,
maxPeaks=100,
sampleRate=defaultSampleRate,
magnitudeThreshold=0,
3 changes: 1 addition & 2 deletions test/src/unittests/tonal/test_pitchcontoursegmentation.py
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ def testOnes(self):
# Expected values for onset is 0, with constant "ones" input.
# Expected values for duration is 2.9692516, with constant "ones" input.
# Expected values for MIDIpitch is -36., with constant "ones" input.
# FIXME there should be no such thing as a negative pitch value-.
# FIXME there should be no such thing as a negative pitch value.
self.assertEqualVector(onset, [0])
self.assertAlmostEqualVector(duration, [2.9692516],8)
self.assertEqualVector(MIDIpitch, [-36.])
@@ -119,7 +119,6 @@ def testARealCase1(self):
self.assertAlmostEqualVector(duration, referenceDurations, 8)
self.assertAlmostEqualVector(MIDIpitch, referenceMIDIpitch, 8)


onset, duration, MIDIpitch = PitchContourSegmentation(pitchDistanceThreshold=100,rmsThreshold=-3)( pitch,audio)

referenceOnsets = [0.1015873, 0.5834014, 0.68208617, 0.78077096, 0.88816327, 1.0071656,