Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -85,12 +85,13 @@ options, args = parse_args() · 84 unmodified lines | |||
| 85 | 85 | ||
| 86 | filename = options.filename | 86 | filename = options.filename |
| 87 | params = taskparams() | 87 | params = taskparams() |
| 88 | #params.samplerate = float(sndfile(filename).samplerate()) | 88 | params.samplerate = float(sndfile(filename).samplerate()) |
| 89 | params.hopsize = int(options.hopsize) | 89 | params.hopsize = int(options.hopsize) |
| 90 | params.bufsize = int(options.bufsize) | 90 | params.bufsize = int(options.bufsize) |
| 91 | #params.step = float(samplerate)/float(hopsize) | 91 | params.step = params.samplerate/float(params.hopsize) |
| 92 | params.threshold = float(options.threshold) | 92 | params.threshold = float(options.threshold) |
| 93 | params.silence = float(options.silence) | 93 | params.silence = float(options.silence) |
| 94 | params.verbose = options.verbose | ||
| 94 | #mintol = float(options.mintol)*step | 95 | #mintol = float(options.mintol)*step |
| 95 | # default take back system delay | 96 | # default take back system delay |
| 96 | if options.delay: delay = float(options.delay) | 97 | if options.delay: delay = float(options.delay) |
| @@ -100,27 +101,14 @@ if options.note: · 3 unmodified lines | |||
| 100 | exit("not implemented yet") | 101 | exit("not implemented yet") |
| 101 | 102 | ||
| 102 | 103 | ||
| 103 | pitch = [] | 104 | wplot,oplots = [],[] |
| 104 | modes = options.mode.split(',') | 105 | modes = options.mode.split(',') |
| 105 | for i in range(len(modes)): | 106 | for i in range(len(modes)): |
| 107 | pitch = [] | ||
| 106 | params.pitchmode = modes[i] | 108 | params.pitchmode = modes[i] |
| 107 | dotask = taskpitch | 109 | filetask = taskpitch(filename,params=params) |
| 108 | #pitch.append(getpitch(filename, #threshold, | 110 | pitch = filetask.compute_all() |
| 109 | # mode=mode[i], | 111 | #print filetask.eval(pitch[i]) |
| 110 | # omode=options.omode, | 112 | filetask.plot(pitch,wplot,oplots) |
| 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.; | ||
| 118 | 113 | ||
| 119 | if options.verbose: | 114 | filetask.plotplot(wplot,oplots,outplot=options.outplot) |
| 120 | for j in range(len(pitch[i])): | ||
| 121 | print "%f\t" % (j/params.step), | ||
| 122 | print "%f\t" % pitch[i][j], | ||
| 123 | |||
| 124 | |||
| 125 | if options.plot: | ||
| 126 | filetask.plot(pitch,outplot=options.outplot) | ||