History

simplify aubiopitch simplify aubiopitch

Paul Brossier committed 20 years ago

Commit 0fe9aab1 parent 300adc31 file · +10 −22Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/aubiopitch+10−22
@@ -85,12 +85,13 @@ options, args = parse_args() · 84 unmodified lines
8585
8686 filename = options.filename
8787 params = taskparams()
88−#params.samplerate = float(sndfile(filename).samplerate())
88+params.samplerate = float(sndfile(filename).samplerate())
8989 params.hopsize = int(options.hopsize)
9090 params.bufsize = int(options.bufsize)
91−#params.step = float(samplerate)/float(hopsize)
91+params.step = params.samplerate/float(params.hopsize)
9292 params.threshold = float(options.threshold)
9393 params.silence = float(options.silence)
94+params.verbose = options.verbose
9495 #mintol = float(options.mintol)*step
9596 # default take back system delay
9697 if options.delay: delay = float(options.delay)
@@ -100,27 +101,14 @@ if options.note: · 3 unmodified lines
100101 exit("not implemented yet")
101102
102103
103−pitch = []
104+wplot,oplots = [],[]
104105 modes = options.mode.split(',')
105106 for i in range(len(modes)):
107+ pitch = []
106108 params.pitchmode = modes[i]
107− dotask = taskpitch
108− #pitch.append(getpitch(filename, #threshold,
109− # mode=mode[i],
110− # omode=options.omode,
111− # bufsize=bufsize,hopsize=hopsize,
112− # silence=silence))
113− filetask = dotask(filename,params=params)
114− pitch.append(filetask.compute_all())
115− for j in range(len(pitch[i])):
116− if pitch[i][j] > 10000 or pitch[i][j] < 40:
117− pitch[i][j] = 0.;
109+ filetask = taskpitch(filename,params=params)
110+ pitch = filetask.compute_all()
111+ #print filetask.eval(pitch[i])
112+ filetask.plot(pitch,wplot,oplots)
118113
119− if options.verbose:
120− for j in range(len(pitch[i])):
121− print "%f\t" % (j/params.step),
122− print "%f\t" % pitch[i][j],
123− print
124−
125− if options.plot:
126− filetask.plot(pitch,outplot=options.outplot)
114+filetask.plotplot(wplot,oplots,outplot=options.outplot)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t