Changeset 650e39b for python/aubio/task


Ignore:
Timestamp:
Mar 21, 2006, 11:59:17 PM (19 years ago)
Author:
Paul Brossier <piem@altern.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:
4798fdf
Parents:
4994ebb
Message:

add yinfft method, make it default for pd plugin
add yinfft method, make it default for pd plugin

Location:
python/aubio/task
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/aubio/task/pitch.py

    r4994ebb r650e39b  
    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.
    1016                self.pitchdet  = pitchdetection(mode=get_pitch_mode(self.params.pitchmode),
    1117                        bufsize=self.params.bufsize,
     
    1420                        samplerate=self.srate,
    1521                        omode=self.params.omode,
    16                         yinthresh=self.params.yinthresh)
     22                        yinthresh=yinthresh)
    1723
    1824        def __call__(self):
     
    6874                                while(tasksil.readsize==tasksil.params.hopsize):
    6975                                        tasksil()
    70                                         time.append(tasksil.params.step*tasksil.frameread)
     76                                        time.append(tasksil.params.step*(tasksil.frameread))
    7177                                        if not tasksil.issilence:
    7278                                                pitch.append(self.truth)
     
    156162
    157163                       
    158         def plotplot(self,wplot,oplots,outplot=None,multiplot = 1, midi = 1):
     164        def plotplot(self,wplot,oplots,outplot=None,multiplot = 0, midi = 1):
    159165                from aubio.gnuplot import gnuplot_init, audio_to_array, make_audio_plot
    160166                import re
     
    198204                else:
    199205                        g.ylabel('pitch (midi)')
    200                         g('set yrange [%f:%f]' % (40, aubio_freqtomidi(self.params.pitchmax)))
     206                        g('set yrange [%f:%f]' % (aubio_freqtomidi(self.params.pitchmin), aubio_freqtomidi(self.params.pitchmax)))
    201207                g('set key right top')
    202208                g('set noclip one')
  • python/aubio/task/utils.py

    r4994ebb r650e39b  
    3434        elif nvalue == 'schmitt':
    3535                 return aubio_pitch_schmitt
     36        elif nvalue == 'yinfft':
     37                 return aubio_pitch_yinfft
    3638        else:
    3739                 import sys
Note: See TracChangeset for help on using the changeset viewer.