diff options
author | John Glover <j@johnglover.net> | 2012-07-30 23:40:05 +0100 |
---|---|---|
committer | John Glover <j@johnglover.net> | 2012-07-30 23:40:05 +0100 |
commit | db190be6c52c1457237889bcc75cdec7dba43105 (patch) | |
tree | 810183147965b082a922793940d94a8478a9ef71 | |
parent | 5b70ef466f08dbf0012186f25bfe3a8b4cd1bdf0 (diff) | |
download | simpl-db190be6c52c1457237889bcc75cdec7dba43105.tar.gz simpl-db190be6c52c1457237889bcc75cdec7dba43105.tar.bz2 simpl-db190be6c52c1457237889bcc75cdec7dba43105.zip |
[plot] Bug fix: check number of partials in each
frame.
-rw-r--r-- | simpl/plot/__init__.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/simpl/plot/__init__.py b/simpl/plot/__init__.py index 5a62020..c2eded4 100644 --- a/simpl/plot/__init__.py +++ b/simpl/plot/__init__.py @@ -36,11 +36,11 @@ def plot_partials(frames, show_peaks=True): return for n in range(len(frames) - 1): - for p in range(frame.max_partials): + for p in range(len(frames[n].partials)): x = [n, n + 1] - y = [frames[n].partial(p).frequency, - frames[n + 1].partial(p).frequency] - amp = frames[n].partial(p).amplitude + y = [frames[n].partials[p].frequency, + frames[n + 1].partials[p].frequency] + amp = frames[n].partials[p].amplitude plt.plot(x, y, color=colours.pbj(amp / max_amp)) if show_peaks: |