From 3e0446e7fda10c3d85a628b8c1effaa5bf7f5529 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Mon, 14 Mar 2005 04:58:13 +0000 Subject: fixes for OSX docs optimizations and fixes use optimized version optimized function calls adjust pd and py files for correct argument passing more optimizations svn path=/trunk/; revision=2627 --- externals/grill/py/scripts/sig.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'externals/grill/py/scripts') diff --git a/externals/grill/py/scripts/sig.py b/externals/grill/py/scripts/sig.py index 8dccf5fe..0eac237a 100644 --- a/externals/grill/py/scripts/sig.py +++ b/externals/grill/py/scripts/sig.py @@ -42,6 +42,30 @@ class gain(pyext._class): self._outvec(0)[:] = self._invec(0)*self.gain +class gain2(pyext._class): + """More optimized version""" + + gain = 0 + + def _dsp(self): + # cache vectors + self.invec =self._invec(0) + self.outvec = self._outvec(0) + # initialize _signal method here for optimized version + if self.invec is self.outvec: + self._signal = self.signal1 + else: + self._signal = self.signal2 + + def signal1(self): + # Multiply signal vector in place + self.outvec *= self.gain + + def signal2(self): + # Multiply input vector by gain and copy to output + self.outvec[:] = self.invec*self.gain + + class pan(pyext._class): """Stereo panning""" -- cgit v1.2.1