diff options
author | John Glover <j@johnglover.net> | 2012-10-25 09:54:10 +0200 |
---|---|---|
committer | John Glover <j@johnglover.net> | 2012-10-25 09:54:10 +0200 |
commit | 04be6d799285d7d47a2d8f8fb4a6249c6eb9e2f8 (patch) | |
tree | e9ae405f6c6bbd89330f082d7f18d5430aa09ad7 | |
parent | 22648d5210892739f0eabe68afc34839b2bebb2c (diff) | |
download | simpl-04be6d799285d7d47a2d8f8fb4a6249c6eb9e2f8.tar.gz simpl-04be6d799285d7d47a2d8f8fb4a6249c6eb9e2f8.tar.bz2 simpl-04be6d799285d7d47a2d8f8fb4a6249c6eb9e2f8.zip |
[mq] Synthesis bug fix: correctly limit number of
synthesised partials (if set)
-rw-r--r-- | simpl/mq.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/simpl/mq.py b/simpl/mq.py index eb19bd8..8e86718 100644 --- a/simpl/mq.py +++ b/simpl/mq.py @@ -360,7 +360,12 @@ class MQSynthesis(simpl.Synthesis): output = np.zeros(self.hop_size, dtype=simpl.dtype) size = self.hop_size - for n, p in enumerate(frame.partials): + num_partials = min(len(frame.partials), self._max_partials) + + for n in range(num_partials): + partials = frame.partials + p = partials[n] + # get values for last amplitude, frequency and phase # these are the initial values of the instantaneous # amplitude/frequency/phase |