summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn Glover <j@johnglover.net>2012-07-29 19:21:44 +0100
committerJohn Glover <j@johnglover.net>2012-07-29 19:21:44 +0100
commit4e56550800e95d8a31531045ddab3eb5884da62a (patch)
tree94823b4d0fe47ebeb9850b17b06b9adc14224e9f /tests
parente5710117c3c4a8d5f9cf321941ddc36abb561db0 (diff)
downloadsimpl-4e56550800e95d8a31531045ddab3eb5884da62a.tar.gz
simpl-4e56550800e95d8a31531045ddab3eb5884da62a.tar.bz2
simpl-4e56550800e95d8a31531045ddab3eb5884da62a.zip
[partial_tracking] Call Cython PartialTracking.update_partials
instead of C++ method so that Python classes can inherit it. Save frame partials as a Python list instead of getting a list of peaks from the C++ object. Update partial tracking tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_partial_tracking.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/test_partial_tracking.py b/tests/test_partial_tracking.py
index 32f2653..cab6b2b 100644
--- a/tests/test_partial_tracking.py
+++ b/tests/test_partial_tracking.py
@@ -46,10 +46,6 @@ class TestPartialTracking(object):
pt = PartialTracking()
frames = pt.find_partials(frames)
- print 'frames: %d (expected: %d)' %\
- (len(frames), len(self.audio) / hop_size)
- assert len(frames) == len(self.audio) / hop_size
-
assert len(frames[0].partials) == 0
assert frames[0].max_partials == 100
@@ -64,6 +60,7 @@ class TestSMSPartialTracking(object):
def test_basic(self):
pd = SMSPeakDetection()
pd.hop_size = hop_size
+ pd.frame_size = hop_size
pd.max_peaks = max_peaks
pd.static_frame_size = True
frames = pd.find_peaks(self.audio)
@@ -72,11 +69,7 @@ class TestSMSPartialTracking(object):
pt.max_partials = max_partials
frames = pt.find_partials(frames)
- print 'frames: %d (expected: %d)' %\
- (len(frames), len(self.audio) / hop_size)
- assert len(frames) == len(self.audio) / hop_size
-
- assert frames[0].num_partials == max_partials
+ assert len(frames[0].partials) == max_partials
assert frames[0].max_partials == max_partials
def test_partial_tracking(self):