From: Paul Brossier Date: Wed, 17 May 2006 09:14:33 +0000 (+0000) Subject: fixes dcthreshold X-Git-Tag: bzr2git~698 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=08f6688c7ac7ab967f7cca62cca4730fd168cd34;p=aubio.git fixes dcthreshold fixes dcthreshold --- diff --git a/python/aubio/aubioclass.py b/python/aubio/aubioclass.py index a9049bed..70113e50 100644 --- a/python/aubio/aubioclass.py +++ b/python/aubio/aubioclass.py @@ -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,