From 04be6d799285d7d47a2d8f8fb4a6249c6eb9e2f8 Mon Sep 17 00:00:00 2001 From: John Glover Date: Thu, 25 Oct 2012 09:54:10 +0200 Subject: [mq] Synthesis bug fix: correctly limit number of synthesised partials (if set) --- simpl/mq.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3