diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2005-03-14 04:58:13 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2005-03-14 04:58:13 +0000 |
commit | 3e0446e7fda10c3d85a628b8c1effaa5bf7f5529 (patch) | |
tree | eac19e282f78a1d64759ca7dbeff02ee63d6a1d1 /externals/grill/py/scripts | |
parent | bf9523d0f232dc39ddf0b5d1985e93d431100c13 (diff) |
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
Diffstat (limited to 'externals/grill/py/scripts')
-rw-r--r-- | externals/grill/py/scripts/sig.py | 24 |
1 files changed, 24 insertions, 0 deletions
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"""
|