diff options
author | John Glover <glover.john@gmail.com> | 2010-10-21 15:18:28 +0100 |
---|---|---|
committer | John Glover <glover.john@gmail.com> | 2010-10-21 15:18:28 +0100 |
commit | 6f77a1d31d008f1b896aef59e4acfc9742d62d1a (patch) | |
tree | 9d862d5653c9f12e0025b4e44bb30aaf9379be1a | |
parent | ce65c30264be9683dd3a59b35730d2f31e02d37f (diff) | |
download | simpl-6f77a1d31d008f1b896aef59e4acfc9742d62d1a.tar.gz simpl-6f77a1d31d008f1b896aef59e4acfc9742d62d1a.tar.bz2 simpl-6f77a1d31d008f1b896aef59e4acfc9742d62d1a.zip |
Removed unnecessary code
-rw-r--r-- | sndobj.py | 32 |
1 files changed, 1 insertions, 31 deletions
@@ -206,7 +206,7 @@ class SndObjSynthesis(simpl.Synthesis): self._synth.Set('max tracks', num_partials) self._max_partials = num_partials - def _synth_frame(self, peaks): + def synth_frame(self, peaks): "Synthesises a frame of audio, given a list of peaks from tracks" self._analysis.peaks = peaks if len(peaks) > self._max_partials: @@ -215,33 +215,3 @@ class SndObjSynthesis(simpl.Synthesis): self._synth.PopOut(self._current_frame) return self._current_frame - def synth(self, partials, original=None): - "Synthesise audio from the given partials" - # return an empty frame if there are no partials - if not partials: - return simpl.array([]) - - audio_out = simpl.array([]) - current_partials = [] - num_frames = max([partial.get_last_frame() for partial in partials]) - - # for each frame of audio - for frame_number in range(num_frames): - # get all partials that start on this frame, append to list of continuing partials - current_partials.extend([partial.list_peaks() for partial in partials if partial.starting_frame == frame_number]) - # get all peaks to be synthesised for this frame - current_peaks = [] - for partial_number, partial in enumerate(current_partials): - try: - current_peaks.append(partial.next()) - except StopIteration: - # End of partial. Set this partial to None, remove it from the list later - current_partials[partial_number] = None - - # synth frame - audio_out = np.hstack((audio_out, self._synth_frame(current_peaks))) - # remove any finished partials - current_partials = [partial for partial in current_partials if partial] - - return audio_out - |