Changeset 5e491b3b for python/aubiopitch


Ignore:
Timestamp:
Aug 28, 2005, 7:58:31 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:
3c86eb1
Parents:
4cc9fe5
Message:

massive changes from cam

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/aubiopitch

    r4cc9fe5 r5e491b3b  
    55"""
    66
    7 
    87import sys
    9 from aubio.aubioclass import *
     8from aubio.tasks import *
    109
    1110usage = "usage: %s [options] -i soundfile" % sys.argv[0]
     
    7473                if options.mode == aubio_pitch_mcomb:   options.bufsize = 4096
    7574                if options.mode == aubio_pitch_fcomb:   options.bufsize = 4096
     75                else: options.bufsize = 2048
    7676        if not options.hopsize:
    7777                options.hopsize = float(options.bufsize) / 2
     
    9292threshold  = float(options.threshold)
    9393silence    = float(options.silence)
     94mode       = options.mode
    9495#mintol     = float(options.mintol)*step
    9596# default take back system delay
     
    100101        exit("not implemented yet")
    101102else:
    102         pitch = getpitch(filename, #threshold,
    103                 mode=options.mode,
    104                 omode=options.omode,
    105                 bufsize=bufsize,hopsize=hopsize,
    106                 silence=silence)
     103        pitch = []
     104        for i in range(len(mode)):
     105                pitch.append(getpitch(filename, #threshold,
     106                        mode=mode[i],
     107                        omode=options.omode,
     108                        bufsize=bufsize,hopsize=hopsize,
     109                        silence=silence))
    107110
    108111## take back system delay
     
    123126# print times in second
    124127if options.verbose:
    125         for i in range(len(pitch)):
    126                 print "%f\t%f" % (i/step,pitch[i])
     128        for j in range(len(pitch[0])):
     129                print "%f\t" % (j/step),
     130                for i in range(len(pitch)):
     131                        print "%f\t" % pitch[i][j],
     132                print
    127133
    128134if options.plot:
     
    130136        plot_pitch(filename, pitch,
    131137                samplerate=samplerate, hopsize=hopsize, outplot=options.outplot)
    132 
Note: See TracChangeset for help on using the changeset viewer.