Index: python/aubio/aubioclass.py
===================================================================
--- python/aubio/aubioclass.py	(revision 855ed0abdc4d1b371747073c9102894cbf1ea666)
+++ python/aubio/aubioclass.py	(revision c29dae2f4df4a98a1cee38ef86021c00edf59e3e)
@@ -125,19 +125,33 @@
                  setattr(parser.values, option.dest, 'dual')
         else:
-                 print "unknown detection function selected\n", usage
+                 print "unknown onset detection function selected"
                  sys.exit(1)
 
 def check_pitch_mode(option, opt, value, parser):
         nvalue = parser.rargs[0]
-        if   nvalue == 'mcomb' :
+        if   nvalue == 'mcomb'  :
                  setattr(parser.values, option.dest, aubio_pitch_mcomb)
-        elif nvalue == 'yin'           :
+        elif nvalue == 'yin'    :
                  setattr(parser.values, option.dest, aubio_pitch_yin)
-        elif nvalue == 'fcomb'         :
+        elif nvalue == 'fcomb'  :
                  setattr(parser.values, option.dest, aubio_pitch_fcomb)
-        elif nvalue == 'schmitt'      :
+        elif nvalue == 'schmitt':
                  setattr(parser.values, option.dest, aubio_pitch_schmitt)
         else:
-                 print "unknown detection function selected\n", usage
+                 print "error: unknown pitch detection function selected"
+                 sys.exit(1)
+
+def check_pitchm_mode(option, opt, value, parser):
+        nvalue = parser.rargs[0]
+        if   nvalue == 'freq'  :
+                 setattr(parser.values, option.dest, aubio_pitchm_freq)
+        elif nvalue == 'midi'  :
+                 setattr(parser.values, option.dest, aubio_pitchm_midi)
+        elif nvalue == 'cent'  :
+                 setattr(parser.values, option.dest, aubio_pitchm_cent)
+        elif nvalue == 'bin'   :
+                 setattr(parser.values, option.dest, aubio_pitchm_bin)
+        else:
+                 print "error: unknown pitch detection output selected"
                  sys.exit(1)
 
@@ -192,5 +206,5 @@
     framestep = hopsize/(filei.samplerate()+0.)
     channels  = filei.channels()
-    newname   = "%s%s%f%s%s" % (filein.split(".")[0].split("/")[-1],".",
+    newname   = "%s%s%09.5f%s%s" % (filein.split(".")[0].split("/")[-1],".",
                 frameread*framestep,".",filein.split(".")[-1])
     fileo     = sndfile(newname,model=filei)
@@ -214,5 +228,5 @@
                     zerocross += 1
             del fileo
-            fileo = sndfile("%s%s%f%s%s" % 
+            fileo = sndfile("%s%s%09.5f%s%s" % 
                 (filein.split(".")[0].split("/")[-1],".",
                 frameread*framestep,".",filein.split(".")[-1]),model=filei)
@@ -261,5 +275,5 @@
                 mylist.append(freq)
         else: 
-                mylist.append(0)
+                mylist.append(-1.)
         frameread += 1
     return mylist
Index: python/aubiopitch
===================================================================
--- python/aubiopitch	(revision 855ed0abdc4d1b371747073c9102894cbf1ea666)
+++ python/aubiopitch	(revision c29dae2f4df4a98a1cee38ef86021c00edf59e3e)
@@ -23,9 +23,14 @@
                           help="pitch detection mode [default=mcomb] \
                           mcomb|yin|fcomb|schmitt")
+        parser.add_option("-u","--units", action="callback", 
+                          callback=check_pitchm_mode, dest="omode",
+                          default=aubio_pitchm_freq,
+                          help="output pitch in units [default=Hz] \
+                          freq|midi|cent|bin")
         parser.add_option("-B","--bufsize",
-                          action="store", dest="bufsize", default=1024, 
+                          action="store", dest="bufsize", default=None, 
                           help="buffer size [default=1024]")
         parser.add_option("-H","--hopsize",
-                          action="store", dest="hopsize", default=512, 
+                          action="store", dest="hopsize", default=None, 
                           help="overlap size [default=512]")
         parser.add_option("-t","--threshold",
@@ -64,10 +69,19 @@
                           help="be quiet")
         (options, args) = parser.parse_args()
+        if not options.bufsize:
+                if options.mode == aubio_pitch_yin:     options.bufsize = 1024
+                if options.mode == aubio_pitch_schmitt: options.bufsize = 2048
+                if options.mode == aubio_pitch_mcomb:   options.bufsize = 4096
+                if options.mode == aubio_pitch_fcomb:   options.bufsize = 4096 
+        if not options.hopsize:
+                options.hopsize = float(options.bufsize) / 2
         if not options.filename: 
-                 print "no file name given\n", usage
-                 sys.exit(1)
+                print "no file name given\n", usage
+                sys.exit(1)
         return options, args
 
 options, args = parse_args()
+
+#print options.bufsize, options.hopsize
 
 filename   = options.filename
@@ -86,7 +100,9 @@
         exit("not implemented yet")
 else:
-        pitch = getpitch(filename, #threshold,silence,
+        pitch = getpitch(filename, #threshold,
                 mode=options.mode,
-                bufsize=bufsize,hopsize=hopsize)
+                omode=options.omode,
+                bufsize=bufsize,hopsize=hopsize,
+                silence=silence)
 
 ## take back system delay
