Update of /cvsroot/pure-data/externals/grill/py/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18952/scripts
Modified Files: sig.py Log Message: fixes for OSX docs optimizations and fixes use optimized version optimized function calls adjust pd and py files for correct argument passing more optimizations
Index: sig.py =================================================================== RCS file: /cvsroot/pure-data/externals/grill/py/scripts/sig.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sig.py 13 Mar 2005 04:59:46 -0000 1.1 --- sig.py 14 Mar 2005 04:58:12 -0000 1.2 *************** *** 43,46 **** --- 43,70 ----
+ 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"""