Changeset 5cf415f for python/aubiocut
- Timestamp:
- Aug 9, 2005, 8:35:14 PM (19 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/aubiocut
ra29ad46 r5cf415f 10 10 usage = "usage: %s [options] -i soundfile" % sys.argv[0] 11 11 12 def check_mode(option, opt, value, parser):13 nvalue = parser.rargs[0]14 if nvalue == 'complexdomain' :15 setattr(parser.values, option.dest, complexdomain)16 elif nvalue == 'hfc' :17 setattr(parser.values, option.dest, hfc)18 elif nvalue == 'phase' :19 setattr(parser.values, option.dest, phase)20 elif nvalue == 'specdiff' :21 setattr(parser.values, option.dest, specdiff)22 elif nvalue == 'energy' :23 setattr(parser.values, option.dest, energy)24 elif nvalue == 'kl' :25 setattr(parser.values, option.dest, kl)26 elif nvalue == 'mkl' :27 setattr(parser.values, option.dest, mkl)28 elif nvalue == 'dual' :29 setattr(parser.values, option.dest, 'dual')30 else:31 print "unknown detection function selected\n", usage32 sys.exit(1)33 34 12 def parse_args(): 35 13 from optparse import OptionParser … … 39 17 help="input sound file") 40 18 parser.add_option("-m","--mode", action="callback", 41 callback=check_ mode, dest="mode", default='dual',19 callback=check_onset_mode, dest="mode", default='dual', 42 20 help="onset detection mode [default=dual] \ 43 21 complexdomain|hfc|phase|specdiff|energy|kl|mkl|dual")
Note: See TracChangeset
for help on using the changeset viewer.