Changeset 0fe9aab


Ignore:
Timestamp:
Mar 1, 2006, 4:18:18 AM (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:
1e3089c
Parents:
300adc3
Message:

simplify aubiopitch
simplify aubiopitch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/aubiopitch

    r300adc3 r0fe9aab  
    8686filename   = options.filename
    8787params = taskparams()
    88 #params.samplerate = float(sndfile(filename).samplerate())
     88params.samplerate = float(sndfile(filename).samplerate())
    8989params.hopsize    = int(options.hopsize)
    9090params.bufsize    = int(options.bufsize)
    91 #params.step       = float(samplerate)/float(hopsize)
     91params.step       = params.samplerate/float(params.hopsize)
    9292params.threshold  = float(options.threshold)
    9393params.silence    = float(options.silence)
     94params.verbose    = options.verbose
    9495#mintol     = float(options.mintol)*step
    9596# default take back system delay
     
    101102
    102103
    103 pitch = []
     104wplot,oplots = [],[]
    104105modes = options.mode.split(',')
    105106for 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)
     114filetask.plotplot(wplot,oplots,outplot=options.outplot)
Note: See TracChangeset for help on using the changeset viewer.