Changeset 3027c6e for python/aubio


Ignore:
Timestamp:
Oct 8, 2009, 8:59:23 PM (15 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
8802f92
Parents:
61316a6
Message:

python/aubio: update to latest pitch prototypes

Location:
python/aubio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/aubio/aubioclass.py

    r61316a6 r3027c6e  
    126126class pitchdetection:
    127127    def __init__(self,mode=aubio_pitch_mcomb,bufsize=2048,hopsize=1024,
    128         channels=1,samplerate=44100.,omode=aubio_pitchm_freq,yinthresh=0.1):
     128        channels=1,samplerate=44100.,omode=aubio_pitchm_freq,tolerance=0.1):
    129129        self.pitchp = new_aubio_pitchdetection(bufsize,hopsize,channels,
    130130                samplerate,mode,omode)
    131         aubio_pitchdetection_set_yinthresh(self.pitchp,yinthresh)
     131        self.mypitch = fvec(1, channels)
     132        aubio_pitchdetection_set_tolerance(self.pitchp,tolerance)
    132133        #self.filt     = filter(srate,"adsgn")
    133134    def __del__(self):
    134135        del_aubio_pitchdetection(self.pitchp)
    135136    def __call__(self,myvec):
    136         #self.filt(myvec)
    137         return aubio_pitchdetection_do(self.pitchp,myvec())
     137        aubio_pitchdetection_do(self.pitchp,myvec(), self.mypitch())
     138        return self.mypitch.get(0,0)
    138139
    139140class filter:
  • python/aubio/task/pitch.py

    r61316a6 r3027c6e  
    88                task.__init__(self,input,params=params)
    99                self.shortlist = [0. for i in range(self.params.pitchsmooth)]
    10                 if self.params.pitchmode == 'yinfft':
    11                         yinthresh = self.params.yinfftthresh
    12                 elif self.params.pitchmode == 'yin':
    13                         yinthresh = self.params.yinthresh
    14                 else:
    15                         yinthresh = 0.
    16                 self.pitchdet  = pitchdetection(mode=get_pitch_mode(self.params.pitchmode),
     10                if self.params.pitchmode == 'yin':
     11                        tolerance = self.params.yinthresh
     12                elif self.params.pitchmode == 'yinfft':
     13                        tolerance = self.params.yinfftthresh
     14                else:
     15                        tolerance = 0.
     16                self.pitchdet   = pitchdetection(mode=get_pitch_mode(self.params.pitchmode),
    1717                        bufsize=self.params.bufsize,
    1818                        hopsize=self.params.hopsize,
     
    2020                        samplerate=self.srate,
    2121                        omode=self.params.omode,
    22                         yinthresh=yinthresh)
     22                        tolerance = tolerance)
    2323
    2424        def __call__(self):
Note: See TracChangeset for help on using the changeset viewer.