Changeset fe163ad for python/aubiopitch


Ignore:
Timestamp:
Oct 15, 2009, 6:54:23 PM (15 years ago)
Author:
Paul Brossier <piem@piem.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:
515c7b2
Parents:
cd77c15
Message:

src/pitch: use a string to set pitch method, add a new function to set pitch unit, keep pitch enums private, update pitch methods where they are used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/aubiopitch

    rcd77c15 rfe163ad  
    1818      help="input sound file")
    1919  parser.add_option("-m","--mode",
    20       action="store", dest="mode", default='mcomb',
     20      action="store", dest="mode", default='yinfft',
    2121      help="pitch detection mode [default=mcomb] \
    2222      mcomb|yin|fcomb|schmitt")
    23   parser.add_option("-u","--units", action="callback",
    24       callback=check_pitchm_mode, dest="omode",
    25       default=aubio_pitchm_freq,
     23  parser.add_option("-u","--units",
     24      action="store", dest="omode", default="freq",
    2625      help="output pitch in units [default=Hz] \
    2726      freq|midi|cent|bin")
     
    7877  (options, args) = parser.parse_args()
    7978  if not options.bufsize:
    80     if options.mode == aubio_pitch_yin:     options.bufsize = 1024
    81     if options.mode == aubio_pitch_schmitt: options.bufsize = 2048
    82     if options.mode == aubio_pitch_mcomb:   options.bufsize = 4096
    83     if options.mode == aubio_pitch_fcomb:   options.bufsize = 4096
     79    if options.mode == "yin":     options.bufsize = 1024
     80    if options.mode == "schmitt": options.bufsize = 2048
     81    if options.mode == "mcomb":   options.bufsize = 4096
     82    if options.mode == "fcomb":   options.bufsize = 4096
    8483    else: options.bufsize = 2048
    8584  if not options.hopsize:
     
    106105if options.pitchmax:  params.pitchmax    = int(options.pitchmax)
    107106if options.pitchmin:  params.pitchmin    = int(options.pitchmin)
    108 if options.omode:     params.omode       = int(options.omode)
    109107#mintol     = float(options.mintol)*step
    110108# default take back system delay
Note: See TracChangeset for help on using the changeset viewer.