Showing the changes to python/scripts (1 of 1 file). Show all
Unified · Split
| @@ -54,6 +54,13 @@ def parse_args(): · 53 unmodified lines | ||
| 54 | 54 | action="store_true", dest="cut", default=False, |
| 55 | 55 | help="cut input sound file at detected labels \ |
| 56 | 56 | best used with option -L") |
| 57 | + | |
| 58 | + # minioi | |
| 59 | + parser.add_option("-M","--minioi", | |
| 60 | + metavar = "<value>", type='string', | |
| 61 | + action="store", dest="minioi", default="12ms", | |
| 62 | + help="minimum inter onset interval [default=12ms]") | |
| 63 | + | |
| 57 | 64 | """ |
| 58 | 65 | parser.add_option("-D","--delay", |
| 59 | 66 | action = "store", dest = "delay", type = "float", |
| @@ -64,10 +71,6 @@ def parse_args(): · 4 unmodified lines | ||
| 64 | 71 | metavar = "<value>", |
| 65 | 72 | action="store", dest="dcthreshold", default=1., |
| 66 | 73 | help="onset peak picking DC component [default=1.]") |
| 67 | − parser.add_option("-M","--mintol", | |
| 68 | − metavar = "<value>", | |
| 69 | − action="store", dest="mintol", default=0.048, | |
| 70 | − help="minimum inter onset interval [default=0.048]") | |
| 71 | 74 | parser.add_option("-L","--localmin", |
| 72 | 75 | action="store_true", dest="localmin", default=False, |
| 73 | 76 | help="use local minima after peak detection") |
| @@ -152,6 +155,13 @@ if __name__ == '__main__': · 78 unmodified lines | ||
| 152 | 155 | o = tempo(options.onset_method, bufsize, hopsize) |
| 153 | 156 | else: |
| 154 | 157 | o = onset(options.onset_method, bufsize, hopsize) |
| 158 | + if options.minioi: | |
| 159 | + if options.minioi.endswith('ms'): | |
| 160 | + o.set_minioi_ms(int(options.minioi[:-2])) | |
| 161 | + elif options.minioi.endswith('s'): | |
| 162 | + o.set_minioi_s(int(options.minioi[:-1])) | |
| 163 | + else: | |
| 164 | + o.set_minioi(int(options.minioi)) | |
| 155 | 165 | o.set_threshold(options.threshold) |
| 156 | 166 | |
| 157 | 167 | timestamps = [] |