Changeset 4798fdf for python/aubio/task
- Timestamp:
- Apr 20, 2006, 2:46:42 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:
- 9bec8fe
- Parents:
- 650e39b
- Location:
- python/aubio/task
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/aubio/task/params.py
r650e39b r4798fdf 26 26 self.yinfftthresh = 0.85 27 27 self.pitchsmooth = 0 28 self.pitchmin= 10.28 self.pitchmin=20. 29 29 self.pitchmax=20000. 30 self.pitchdelay = -0.5 30 31 self.dcthreshold = -1. 31 32 self.omode = aubio_pitchm_freq -
python/aubio/task/pitch.py
r650e39b r4798fdf 79 79 else: 80 80 pitch.append(-1.) 81 return time,pitch #0,aubio_miditofreq(float(floatpit))81 return time,pitch 82 82 except ValueError: 83 83 # FIXME very weak check … … 121 121 if pitch[i] == "nan" or pitch[i] == -1: 122 122 pitch[i] = -1 123 time = [ i*self.params.step for i in range(len(pitch)) ]123 time = [ (i+self.params.pitchdelay)*self.params.step for i in range(len(pitch)) ] 124 124 #print len(timet),len(pitcht) 125 125 #print len(time),len(pitch) … … 153 153 154 154 def plot(self,pitch,wplot,oplots,outplot=None): 155 import numarray156 155 import Gnuplot 157 156 158 downtime = self.params.step*numarray.arange(len(pitch))157 time = [ (i+self.params.pitchdelay)*self.params.step for i in range(len(pitch)) ] 159 158 pitch = [aubio_freqtomidi(i) for i in pitch] 160 oplots.append(Gnuplot.Data( downtime,pitch,with='lines',159 oplots.append(Gnuplot.Data(time,pitch,with='lines', 161 160 title=self.params.pitchmode)) 162 161 163 162 164 def plotplot(self,wplot,oplots,outplot=None,multiplot = 0, midi = 1):163 def plotplot(self,wplot,oplots,outplot=None,multiplot = 1, midi = 1): 165 164 from aubio.gnuplot import gnuplot_init, audio_to_array, make_audio_plot 166 165 import re … … 185 184 # plot waveform and onsets 186 185 g('set size 1,0.3') 186 g('set ytics 10') 187 187 g('set origin 0,0.7') 188 188 g('set xrange [0:%f]' % max(time)) … … 203 203 g('set yrange [100:%f]' % self.params.pitchmax) 204 204 else: 205 g.ylabel(' pitch (midi)')205 g.ylabel('midi') 206 206 g('set yrange [%f:%f]' % (aubio_freqtomidi(self.params.pitchmin), aubio_freqtomidi(self.params.pitchmax))) 207 207 g('set key right top')
Note: See TracChangeset
for help on using the changeset viewer.