shithub: aubio

Download patch

ref: 862d78f7adbe1541ea6b183bd18995a70b347914
parent: fabb7cd7c6c58dd5a5b74c64198252d8ddcc3583
author: Paul Brossier <piem@piem.org>
date: Wed Nov 21 07:02:28 EST 2007

utils.c, utils.py: add specflux onset function

--- a/examples/utils.c
+++ b/examples/utils.c
@@ -173,6 +173,8 @@
                                         type_onset = aubio_onset_mkl;
                                 else if (strcmp(optarg,"kl") == 0) 
                                         type_onset = aubio_onset_kl;
+                                else if (strcmp(optarg,"specflux") == 0) 
+                                        type_onset = aubio_onset_specflux;
                                 else {
                                         errmsg("unknown onset type.\n");
                                         abort();
--- a/python/aubio/task/utils.py
+++ b/python/aubio/task/utils.py
@@ -16,11 +16,13 @@
 		 return aubio_onset_kl
 	elif nvalue == 'mkl'           :
 		 return aubio_onset_mkl
+	elif nvalue == 'specflux'      :
+		 return aubio_onset_specflux
 	elif nvalue == 'dual'          :
 		 return 'dual'
 	else:
 		 import sys
-		 print "unknown onset detection function selected"
+		 print "unknown onset detection function selected: %s" % nvalue
 		 sys.exit(1)
 
 def get_pitch_mode(nvalue):