Index: examples/utils.c
===================================================================
--- examples/utils.c	(revision a29ad469acef958f7657a3757cfc43a0de6fd7d1)
+++ examples/utils.c	(revision 5cf415f92b76a68cf282426ab69502f2cd029901)
@@ -30,6 +30,6 @@
 
 /* energy,specdiff,hfc,complexdomain,phase */
-aubio_onsetdetection_type type_onset  = kl;
-aubio_onsetdetection_type type_onset2 = complexdomain;
+aubio_onsetdetection_type type_onset  = aubio_onset_kl;
+aubio_onsetdetection_type type_onset2 = aubio_onset_complex;
 smpl_t threshold                      = 0.3;
 smpl_t threshold2                     = -90.;
@@ -140,13 +140,19 @@
                         case 'O':   /*onset type*/
                                 if (strcmp(optarg,"energy") == 0) 
-                                        type_onset = energy;
+                                        type_onset = aubio_onset_energy;
                                 else if (strcmp(optarg,"specdiff") == 0) 
-                                        type_onset = specdiff;
+                                        type_onset = aubio_onset_specdiff;
                                 else if (strcmp(optarg,"hfc") == 0) 
-                                        type_onset = hfc;
+                                        type_onset = aubio_onset_hfc;
                                 else if (strcmp(optarg,"complexdomain") == 0) 
-                                        type_onset = complexdomain;
+                                        type_onset = aubio_onset_complex;
+                                else if (strcmp(optarg,"complex") == 0) 
+                                        type_onset = aubio_onset_complex;
                                 else if (strcmp(optarg,"phase") == 0) 
-                                        type_onset = phase;
+                                        type_onset = aubio_onset_phase;
+                                else if (strcmp(optarg,"mkl") == 0) 
+                                        type_onset = aubio_onset_mkl;
+                                else if (strcmp(optarg,"kl") == 0) 
+                                        type_onset = aubio_onset_kl;
                                 else {
                                         debug("could not get onset type.\n");
Index: plugins/puredata/aubioonset~.c
===================================================================
--- plugins/puredata/aubioonset~.c	(revision a29ad469acef958f7657a3757cfc43a0de6fd7d1)
+++ plugins/puredata/aubioonset~.c	(revision 5cf415f92b76a68cf282426ab69502f2cd029901)
@@ -71,5 +71,5 @@
 	x->hopsize   = x->bufsize / 2;
 
-	x->o = new_aubio_onsetdetection(complexdomain, x->bufsize, 1);
+	x->o = new_aubio_onsetdetection(aubio_onset_complex, x->bufsize, 1);
 	x->vec = (fvec_t *)new_fvec(x->hopsize,1);
 	x->pv = new_aubio_pvoc(x->bufsize, x->hopsize, 1);
Index: python/aubio/aubioclass.py
===================================================================
--- python/aubio/aubioclass.py	(revision a29ad469acef958f7657a3757cfc43a0de6fd7d1)
+++ python/aubio/aubioclass.py	(revision 5cf415f92b76a68cf282426ab69502f2cd029901)
@@ -80,6 +80,6 @@
         self.pv       = pvoc(bufsize,hopsize,channels)
         if mode in ['dual'] :
-                self.myod     = onsetdetection(hfc,bufsize,channels)
-                self.myod2    = onsetdetection(complexdomain,bufsize,channels)
+                self.myod     = onsetdetection(aubio_onset_hfc,bufsize,channels)
+                self.myod2    = onsetdetection(aubio_onset_complex,bufsize,channels)
                 self.myonset  = fvec(1,channels)
                 self.myonset2 = fvec(1,channels)
@@ -105,4 +105,41 @@
                 else:  self.myonset.set(0.,0,0)
         return self.pp.do(self.myonset),self.myonset.get(0,0)
+
+def check_onset_mode(option, opt, value, parser):
+        nvalue = parser.rargs[0]
+        if   nvalue == 'complexdomain' or nvalue == 'complex' :
+                 setattr(parser.values, option.dest, aubio_onset_complex)
+        elif nvalue == 'hfc'           :
+                 setattr(parser.values, option.dest, aubio_onset_hfc)
+        elif nvalue == 'phase'         :
+                 setattr(parser.values, option.dest, aubio_onset_phase)
+        elif nvalue == 'specdiff'      :
+                 setattr(parser.values, option.dest, aubio_onset_specdiff)
+        elif nvalue == 'energy'        :
+                 setattr(parser.values, option.dest, aubio_onset_energy)
+        elif nvalue == 'kl'            :
+                 setattr(parser.values, option.dest, aubio_onset_kl)
+        elif nvalue == 'mkl'           :
+                 setattr(parser.values, option.dest, aubio_onset_mkl)
+        elif nvalue == 'dual'          :
+                 setattr(parser.values, option.dest, 'dual')
+        else:
+                 print "unknown detection function selected\n", usage
+                 sys.exit(1)
+
+def check_pitch_mode(option, opt, value, parser):
+        nvalue = parser.rargs[0]
+        if   nvalue == 'mcomb' :
+                 setattr(parser.values, option.dest, aubio_pitch_mcomb)
+        elif nvalue == 'yin'           :
+                 setattr(parser.values, option.dest, aubio_pitch_yin)
+        elif nvalue == 'fcomb'         :
+                 setattr(parser.values, option.dest, aubio_pitch_fcomb)
+        elif nvalue == 'schmitt'      :
+                 setattr(parser.values, option.dest, aubio_pitch_schmitt)
+        else:
+                 print "unknown detection function selected\n", usage
+                 sys.exit(1)
+
 
 def getonsets(filein,threshold=0.2,silence=-70.,bufsize=1024,hopsize=512,
Index: python/aubiocut
===================================================================
--- python/aubiocut	(revision a29ad469acef958f7657a3757cfc43a0de6fd7d1)
+++ python/aubiocut	(revision 5cf415f92b76a68cf282426ab69502f2cd029901)
@@ -10,26 +10,4 @@
 usage = "usage: %s [options] -i soundfile" % sys.argv[0]
 
-def check_mode(option, opt, value, parser):
-        nvalue = parser.rargs[0]
-        if   nvalue == 'complexdomain' :
-                 setattr(parser.values, option.dest, complexdomain)
-        elif nvalue == 'hfc'           :
-                 setattr(parser.values, option.dest, hfc)
-        elif nvalue == 'phase'         :
-                 setattr(parser.values, option.dest, phase)
-        elif nvalue == 'specdiff'      :
-                 setattr(parser.values, option.dest, specdiff)
-        elif nvalue == 'energy'        :
-                 setattr(parser.values, option.dest, energy)
-        elif nvalue == 'kl'            :
-                 setattr(parser.values, option.dest, kl)
-        elif nvalue == 'mkl'           :
-                 setattr(parser.values, option.dest, mkl)
-        elif nvalue == 'dual'          :
-                 setattr(parser.values, option.dest, 'dual')
-        else:
-                 print "unknown detection function selected\n", usage
-                 sys.exit(1)
-
 def parse_args():
         from optparse import OptionParser
@@ -39,5 +17,5 @@
                           help="input sound file")
         parser.add_option("-m","--mode", action="callback", 
-                          callback=check_mode, dest="mode", default='dual', 
+                          callback=check_onset_mode, dest="mode", default='dual', 
                           help="onset detection mode [default=dual] \
                           complexdomain|hfc|phase|specdiff|energy|kl|mkl|dual")
Index: python/aubiopitch
===================================================================
--- python/aubiopitch	(revision a29ad469acef958f7657a3757cfc43a0de6fd7d1)
+++ python/aubiopitch	(revision 5cf415f92b76a68cf282426ab69502f2cd029901)
@@ -11,15 +11,4 @@
 usage = "usage: %s [options] -i soundfile" % sys.argv[0]
 
-def check_mode(option, opt, value, parser):
-        nvalue = parser.rargs[0]
-        if   nvalue == 'mcomb' :
-                 setattr(parser.values, option.dest, aubio_pitch_mcomb)
-        elif nvalue == 'yin'           :
-                 setattr(parser.values, option.dest, aubio_pitch_yin)
-        elif nvalue == 'fcomb'         :
-                 setattr(parser.values, option.dest, aubio_pitch_fcomb)
-        elif nvalue == 'schmitt'      :
-                 setattr(parser.values, option.dest, aubio_pitch_schmitt)
-
 
 def parse_args():
@@ -30,5 +19,6 @@
                           help="input sound file")
         parser.add_option("-m","--mode", action="callback", 
-                          callback=check_mode, dest="mode", default=aubio_pitch_mcomb,
+                          callback=check_pitch_mode, dest="mode", 
+                          default=aubio_pitch_mcomb,
                           help="pitch detection mode [default=mcomb] \
                           mcomb|yin|fcomb|schmitt")
Index: src/onsetdetection.c
===================================================================
--- src/onsetdetection.c	(revision a29ad469acef958f7657a3757cfc43a0de6fd7d1)
+++ src/onsetdetection.c	(revision 5cf415f92b76a68cf282426ab69502f2cd029901)
@@ -208,10 +208,10 @@
 	switch(type) {
 		/* for both energy and hfc, only fftgrain->norm is required */
-		case energy: 
-			break;
-		case hfc:
+		case aubio_onset_energy: 
+			break;
+		case aubio_onset_hfc:
 			break;
 		/* the other approaches will need some more memory spaces */
-		case complexdomain:
+		case aubio_onset_complex:
 			o->oldmag = new_fvec(rsize,channels);
 			/** bug: must be complex array */
@@ -221,5 +221,5 @@
 			o->theta2 = new_fvec(rsize,channels);
 			break;
-		case phase:
+		case aubio_onset_phase:
 			o->dev1	 = new_fvec(rsize,channels);
 			o->theta1 = new_fvec(rsize,channels);
@@ -228,5 +228,5 @@
 			o->threshold = 0.1;
 			break;
-		case specdiff:
+		case aubio_onset_specdiff:
 			o->oldmag = new_fvec(rsize,channels);
 			o->dev1	  = new_fvec(rsize,channels);
@@ -234,8 +234,8 @@
 			o->threshold = 0.1;
 			break;
-                case kl:
+                case aubio_onset_kl:
 			o->oldmag = new_fvec(rsize,channels);
                         break;
-                case mkl:
+                case aubio_onset_mkl:
 			o->oldmag = new_fvec(rsize,channels);
                         break;
@@ -249,23 +249,23 @@
 
 	switch(type) {
-		case energy:
+		case aubio_onset_energy:
 			o->funcpointer = aubio_onsetdetection_energy;
 			break;
-		case hfc:
+		case aubio_onset_hfc:
 			o->funcpointer = aubio_onsetdetection_hfc;
 			break;
-		case complexdomain:
+		case aubio_onset_complex:
 			o->funcpointer = aubio_onsetdetection_complex;
 			break;
-		case phase:
+		case aubio_onset_phase:
 			o->funcpointer = aubio_onsetdetection_phase;
 			break;
-		case specdiff:
+		case aubio_onset_specdiff:
 			o->funcpointer = aubio_onsetdetection_specdiff;
 			break;
-                case kl:
+                case aubio_onset_kl:
 			o->funcpointer = aubio_onsetdetection_kl;
 			break;
-                case mkl:
+                case aubio_onset_mkl:
 			o->funcpointer = aubio_onsetdetection_mkl;
 			break;
@@ -281,10 +281,10 @@
 	switch(o->type) {
 		/* for both energy and hfc, only fftgrain->norm is required */
-		case energy: 
-			break;
-		case hfc:
+		case aubio_onset_energy: 
+			break;
+		case aubio_onset_hfc:
 			break;
 		/* the other approaches will need some more memory spaces */
-		case complexdomain:
+		case aubio_onset_complex:
 	                AUBIO_FREE(o->meas);
                         del_fvec(o->oldmag);
@@ -293,5 +293,5 @@
                 	del_fvec(o->theta2);
 			break;
-		case phase:
+		case aubio_onset_phase:
 	                del_fvec(o->dev1);
 	                del_fvec(o->theta1);
@@ -299,5 +299,5 @@
                         del_aubio_hist(o->histog);
 			break;
-		case specdiff:
+		case aubio_onset_specdiff:
                         del_fvec(o->oldmag);
 	                del_fvec(o->dev1);
Index: src/onsetdetection.h
===================================================================
--- src/onsetdetection.h	(revision a29ad469acef958f7657a3757cfc43a0de6fd7d1)
+++ src/onsetdetection.h	(revision 5cf415f92b76a68cf282426ab69502f2cd029901)
@@ -50,11 +50,11 @@
 /** onsetdetection types */
 typedef enum {
-	energy,		/**< energy based */          
-	specdiff,       /**< spectral diff */         
-	hfc,		/**< high frequency content */
-	complexdomain,  /**< complex domain */        
-	phase,		/**< phase fast */            
-        kl,             /**< Kullback Liebler (Hainsworth et al.,  Onset detection in musical audio signals) */
-        mkl             /**< modified Kullback Liebler (Hainsworth et al.,  Onset detection in musical audio signals) */
+        aubio_onset_energy,         /**< energy based */          
+        aubio_onset_specdiff,       /**< spectral diff */         
+        aubio_onset_hfc,            /**< high frequency content */
+        aubio_onset_complex,        /**< complex domain */        
+        aubio_onset_phase,          /**< phase fast */            
+        aubio_onset_kl,             /**< Kullback Liebler (Hainsworth et al.,  Onset detection in musical audio signals) */
+        aubio_onset_mkl             /**< modified Kullback Liebler (Hainsworth et al.,  Onset detection in musical audio signals) */
 } aubio_onsetdetection_type;
 
Index: swig/aubio.i
===================================================================
--- swig/aubio.i	(revision a29ad469acef958f7657a3757cfc43a0de6fd7d1)
+++ swig/aubio.i	(revision 5cf415f92b76a68cf282426ab69502f2cd029901)
@@ -139,5 +139,13 @@
 
 /* onset detection */
-typedef enum { energy, specdiff, hfc, complexdomain, phase, kl, mkl } aubio_onsetdetection_type;
+typedef enum { 
+        aubio_onset_energy, 
+        aubio_onset_specdiff, 
+        aubio_onset_hfc, 
+        aubio_onset_complex, 
+        aubio_onset_phase, 
+        aubio_onset_kl, 
+        aubio_onset_mkl 
+} aubio_onsetdetection_type;
 aubio_onsetdetection_t * new_aubio_onsetdetection(aubio_onsetdetection_type type, uint_t size, uint_t channels);
 void aubio_onsetdetection(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
@@ -146,8 +154,10 @@
 /* should these still be exposed ? */
 void aubio_onsetdetection_energy  (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
-void aubio_onsetdetection_hfc 	 (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
+void aubio_onsetdetection_hfc     (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
 void aubio_onsetdetection_complex (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
 void aubio_onsetdetection_phase   (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
 void aubio_onsetdetection_specdiff(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
+void aubio_onsetdetection_kl      (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
+void aubio_onsetdetection_mkl     (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
 
 /* pvoc */
