Changeset 5cf415f for python/aubiopitch


Ignore:
Timestamp:
Aug 9, 2005, 8:35:14 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:
b1f723d
Parents:
a29ad46
Message:

protected onset enumerators, factorise python check_modes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/aubiopitch

    ra29ad46 r5cf415f  
    1111usage = "usage: %s [options] -i soundfile" % sys.argv[0]
    1212
    13 def check_mode(option, opt, value, parser):
    14         nvalue = parser.rargs[0]
    15         if   nvalue == 'mcomb' :
    16                  setattr(parser.values, option.dest, aubio_pitch_mcomb)
    17         elif nvalue == 'yin'           :
    18                  setattr(parser.values, option.dest, aubio_pitch_yin)
    19         elif nvalue == 'fcomb'         :
    20                  setattr(parser.values, option.dest, aubio_pitch_fcomb)
    21         elif nvalue == 'schmitt'      :
    22                  setattr(parser.values, option.dest, aubio_pitch_schmitt)
    23 
    2413
    2514def parse_args():
     
    3019                          help="input sound file")
    3120        parser.add_option("-m","--mode", action="callback",
    32                           callback=check_mode, dest="mode", default=aubio_pitch_mcomb,
     21                          callback=check_pitch_mode, dest="mode",
     22                          default=aubio_pitch_mcomb,
    3323                          help="pitch detection mode [default=mcomb] \
    3424                          mcomb|yin|fcomb|schmitt")
Note: See TracChangeset for help on using the changeset viewer.