shithub: aubio

Download patch

ref: 4c0a1db6fb446db277ca3a1e735d509ade4f7d3f
parent: 467122daa160b993eef8a0f3fb145d31b0c65688
author: Paul Brossier <[email protected]>
date: Sat Feb 22 10:38:12 EST 2014

python/scripts/aubiocut: add minioi option

--- a/python/scripts/aubiocut
+++ b/python/scripts/aubiocut
@@ -54,6 +54,13 @@
             action="store_true", dest="cut", default=False,
             help="cut input sound file at detected labels \
                     best used with option -L")
+
+    # minioi
+    parser.add_option("-M","--minioi",
+            metavar = "<value>", type='string',
+            action="store", dest="minioi", default="12ms",
+            help="minimum inter onset interval [default=12ms]")
+
     """
     parser.add_option("-D","--delay",
             action = "store", dest = "delay", type = "float",
@@ -64,10 +71,6 @@
             metavar = "<value>",
             action="store", dest="dcthreshold", default=1.,
             help="onset peak picking DC component [default=1.]")
-    parser.add_option("-M","--mintol",
-            metavar = "<value>",
-            action="store", dest="mintol", default=0.048,
-            help="minimum inter onset interval [default=0.048]")
     parser.add_option("-L","--localmin",
             action="store_true", dest="localmin", default=False,
             help="use local minima after peak detection")
@@ -152,6 +155,13 @@
         o = tempo(options.onset_method, bufsize, hopsize)
     else:
         o = onset(options.onset_method, bufsize, hopsize)
+        if options.minioi:
+            if options.minioi.endswith('ms'):
+                o.set_minioi_ms(int(options.minioi[:-2]))
+            elif options.minioi.endswith('s'):
+                o.set_minioi_s(int(options.minioi[:-1]))
+            else:
+                o.set_minioi(int(options.minioi))
     o.set_threshold(options.threshold)
 
     timestamps = []