shithub: aubio

Download patch

ref: 08f6688c7ac7ab967f7cca62cca4730fd168cd34
parent: e83c8957b6f162f52ee162576253d539531b1fe5
author: Paul Brossier <piem@altern.org>
date: Wed May 17 05:14:33 EDT 2006

fixes dcthreshold
fixes dcthreshold


--- a/python/aubio/aubioclass.py
+++ b/python/aubio/aubioclass.py
@@ -116,11 +116,10 @@
            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,