- Timestamp:
- Feb 26, 2006, 6:29:23 PM (19 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- ea98179
- Parents:
- ee7b9da
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/aubio/aubioclass.py
ree7b9da r897b455 78 78 class onsetpick: 79 79 """ superclass for aubio_pvoc + aubio_onsetdetection + aubio_peakpicker """ 80 def __init__(self,bufsize,hopsize,channels,myvec,threshold,mode='dual',derivate=False ):80 def __init__(self,bufsize,hopsize,channels,myvec,threshold,mode='dual',derivate=False,dcthreshold=0): 81 81 self.myfft = cvec(bufsize,channels) 82 82 self.pv = pvoc(bufsize,hopsize,channels) … … 92 92 self.pp = peakpick(float(threshold)) 93 93 self.derivate = derivate 94 self.dcthreshold = dcthreshold 94 95 self.oldval = 0. 95 96 … … 104 105 dval = val - self.oldval 105 106 self.oldval = val 107 if dval > 0: self.myonset.set(dval,0,0) 108 else: self.myonset.set(0.,0,0) 109 if self.dcthreshold: 110 dval = self.myonset.get(0,0) - self.dcthreshold 106 111 if dval > 0: self.myonset.set(dval,0,0) 107 112 else: self.myonset.set(0.,0,0)
Note: See TracChangeset
for help on using the changeset viewer.