fixes dcthreshold
authorPaul Brossier <piem@altern.org>
Wed, 17 May 2006 09:14:33 +0000 (09:14 +0000)
committerPaul Brossier <piem@altern.org>
Wed, 17 May 2006 09:14:33 +0000 (09:14 +0000)
fixes dcthreshold

python/aubio/aubioclass.py

index a9049bedeef0e795fd90239968131360b671b464..70113e503cf7601477be627c93ec69e025ea61d2 100644 (file)
@@ -116,11 +116,10 @@ class onsetpick:
            self.oldval = val
            if dval > 0: self.myonset.set(dval,0,0)
            else:  self.myonset.set(0.,0,0)
+        isonset, dval = self.pp.do(self.myonset),self.myonset.get(0,0)
         if self.dcthreshold:
-           dval        = self.myonset.get(0,0) - self.dcthreshold
-           if dval > 0: self.myonset.set(dval,0,0)
-           else:  self.myonset.set(0.,0,0)
-        return self.pp.do(self.myonset),self.myonset.get(0,0)
+           if dval < self.dcthreshold: isonset = 0 
+        return isonset, dval
 
 class pitchdetection:
     def __init__(self,mode=aubio_pitch_mcomb,bufsize=2048,hopsize=1024,