From ab1f41992c74ac05b14f04a3422971eb1be91241 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 31 Oct 2013 22:46:08 +0100 Subject: [PATCH] add parent list iterating in pipe, fix odf results --- timeside/analyzer/odf.py | 9 +++------ timeside/core.py | 10 ++++------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/timeside/analyzer/odf.py b/timeside/analyzer/odf.py index f99a4a4..161986a 100644 --- a/timeside/analyzer/odf.py +++ b/timeside/analyzer/odf.py @@ -40,11 +40,8 @@ class OnsetDetectionFunction(Analyzer): else: self.input_stepsize = blocksize / 2 - @staticmethod - @interfacedoc - def parents(self): - return list(Spectrogram(blocksize=self.input_blocksize, - stepsize=self.input_stepsize)) + self.parents.append(Spectrogram(blocksize=self.input_blocksize, + stepsize=self.input_stepsize)) @interfacedoc def setup(self, channels=None, samplerate=None, @@ -73,7 +70,7 @@ class OnsetDetectionFunction(Analyzer): def post_process(self): #spectrogram = self.parents()[0]['spectrogram_analyzer'].data - spectrogram = self.pipe._results['spectrogram_analyzer'].data + spectrogram = self.pipe.results['spectrogram_analyzer'].data #spectrogram = self.pipe._results[self.parents()[0].id] # Low-pass filtering of the spectrogram amplitude along the time axis diff --git a/timeside/core.py b/timeside/core.py index 254622a..c82ea46 100644 --- a/timeside/core.py +++ b/timeside/core.py @@ -84,10 +84,6 @@ class Processor(Component): self.pipe = None self._uuid = "%08x" % random.getrandbits(32) - interfacedoc - def parents(self): - pass - @interfacedoc def setup(self, channels=None, samplerate=None, blocksize=None, totalframes=None): @@ -255,8 +251,10 @@ class ProcessPipe(object): def __ior__(self, other): if isinstance(other, Processor): - self |= other.parents - print self + parents = other.parents + if parents: + for parent in parents: + self |= parent self.processors.append(other) elif isinstance(other, ProcessPipe): self.processors.extend(other.processors) -- 2.39.5