Index: src/mathutils.c
===================================================================
--- src/mathutils.c	(revision 858cfa7b34a9a932edd72c56297ddd19e5a8a6f7)
+++ src/mathutils.c	(revision 407bba93972ee15016a4aa4255c180ca3ad677f3)
@@ -26,6 +26,22 @@
 #include "config.h"
 
+
+/** Window types */
+typedef enum
+{
+  aubio_win_rectangle,
+  aubio_win_hamming,
+  aubio_win_hanning,
+  aubio_win_hanningz,
+  aubio_win_blackman,
+  aubio_win_blackman_harris,
+  aubio_win_gaussian,
+  aubio_win_welch,
+  aubio_win_parzen,
+  aubio_win_default = aubio_win_hanningz,
+} aubio_window_type;
+
 fvec_t *
-new_aubio_window (uint_t size, aubio_window_type wintype)
+new_aubio_window (char_t * window_type, uint_t size)
 {
   // create fvec of size x 1 channel
@@ -33,4 +49,30 @@
   smpl_t * w = win->data[0];
   uint_t i;
+  aubio_window_type wintype;
+  if (strcmp (window_type, "rectangle") == 0)
+      wintype = aubio_win_rectangle;
+  else if (strcmp (window_type, "hamming") == 0)
+      wintype = aubio_win_hamming;
+  else if (strcmp (window_type, "hanning") == 0)
+      wintype = aubio_win_hanning;
+  else if (strcmp (window_type, "hanningz") == 0)
+      wintype = aubio_win_hanningz;
+  else if (strcmp (window_type, "blackman") == 0)
+      wintype = aubio_win_blackman;
+  else if (strcmp (window_type, "blackman_harris") == 0)
+      wintype = aubio_win_blackman_harris;
+  else if (strcmp (window_type, "gaussian") == 0)
+      wintype = aubio_win_gaussian;
+  else if (strcmp (window_type, "welch") == 0)
+      wintype = aubio_win_welch;
+  else if (strcmp (window_type, "parzen") == 0)
+      wintype = aubio_win_parzen;
+  else if (strcmp (window_type, "default") == 0)
+      wintype = aubio_win_default;
+  else {
+      AUBIO_ERR ("unknown window type %s, using default.\n", window_type);
+      wintype = aubio_win_default;
+      return NULL;
+  }
   switch(wintype) {
     case aubio_win_rectangle:
Index: src/mathutils.h
===================================================================
--- src/mathutils.h	(revision 858cfa7b34a9a932edd72c56297ddd19e5a8a6f7)
+++ src/mathutils.h	(revision 407bba93972ee15016a4aa4255c180ca3ad677f3)
@@ -30,5 +30,5 @@
 #endif
 
-/** Window types 
+/** create window 
  
   References:
@@ -44,19 +44,5 @@
 
 */
-typedef enum
-{
-  aubio_win_rectangle,
-  aubio_win_hamming,
-  aubio_win_hanning,
-  aubio_win_hanningz,
-  aubio_win_blackman,
-  aubio_win_blackman_harris,
-  aubio_win_gaussian,
-  aubio_win_welch,
-  aubio_win_parzen
-} aubio_window_type;
-
-/** create window */
-fvec_t *new_aubio_window (uint_t size, aubio_window_type wintype);
+fvec_t *new_aubio_window (char_t * window_type, uint_t size);
 
 /** compute the principal argument
Index: src/pitch/pitchfcomb.c
===================================================================
--- src/pitch/pitchfcomb.c	(revision 858cfa7b34a9a932edd72c56297ddd19e5a8a6f7)
+++ src/pitch/pitchfcomb.c	(revision 407bba93972ee15016a4aa4255c180ca3ad677f3)
@@ -52,5 +52,5 @@
   p->fftLastPhase = new_fvec(bufsize, channels);
   p->fft = new_aubio_fft(bufsize, 1);
-  p->win = new_aubio_window(bufsize, aubio_win_hanning);
+  p->win = new_aubio_window("hanning", bufsize);
   return p;
 }
Index: src/pitch/pitchyinfft.c
===================================================================
--- src/pitch/pitchyinfft.c	(revision 858cfa7b34a9a932edd72c56297ddd19e5a8a6f7)
+++ src/pitch/pitchyinfft.c	(revision 407bba93972ee15016a4aa4255c180ca3ad677f3)
@@ -57,5 +57,5 @@
   p->yinfft = new_fvec(bufsize/2+1,1);
   p->tol    = 0.85;
-  p->win    = new_aubio_window(bufsize, aubio_win_hanningz);
+  p->win    = new_aubio_window("hanningz", bufsize);
   p->weight      = new_fvec(bufsize/2+1,1);
   {
Index: src/spectral/phasevoc.c
===================================================================
--- src/spectral/phasevoc.c	(revision 858cfa7b34a9a932edd72c56297ddd19e5a8a6f7)
+++ src/spectral/phasevoc.c	(revision 407bba93972ee15016a4aa4255c180ca3ad677f3)
@@ -96,5 +96,5 @@
   pv->dataold  = new_fvec  (win_s-hop_s, channels);
   pv->synthold = new_fvec (win_s-hop_s, channels);
-  pv->w        = new_aubio_window (win_s, aubio_win_hanningz);
+  pv->w        = new_aubio_window ("hanningz", win_s);
 
   pv->channels = channels;
Index: tests/src/test-hist.c
===================================================================
--- tests/src/test-hist.c	(revision 858cfa7b34a9a932edd72c56297ddd19e5a8a6f7)
+++ tests/src/test-hist.c	(revision 407bba93972ee15016a4aa4255c180ca3ad677f3)
@@ -7,5 +7,5 @@
   for (length = 1; length < 10; length ++ ) {
     aubio_hist_t *o = new_aubio_hist(0, 1, length, 5);
-    fvec_t *t = new_aubio_window(length,aubio_win_hanning);
+    fvec_t *t = new_aubio_window("hanning", length);
     aubio_hist_do(o,t);
     fvec_print(t);
@@ -15,5 +15,5 @@
     fvec_print(t);
     del_fvec(t);
-    t = new_aubio_window(length,aubio_win_hanningz);
+    t = new_aubio_window("hanningz", length);
     aubio_hist_do(o,t);
     fvec_print(t);
Index: tests/src/test-window.c
===================================================================
--- tests/src/test-window.c	(revision 858cfa7b34a9a932edd72c56297ddd19e5a8a6f7)
+++ tests/src/test-window.c	(revision 407bba93972ee15016a4aa4255c180ca3ad677f3)
@@ -7,28 +7,31 @@
   for (length = 2; length <= 5; length++)
   {
-    fvec_t *t = new_aubio_window(length,aubio_win_rectangle);
+    fvec_t *t = new_aubio_window("rectangle", length);
     del_fvec(t);
-    t = new_aubio_window(length,aubio_win_hamming);
+    t = new_aubio_window("hamming", length);
     fvec_print(t);
     del_fvec(t);
-    t = new_aubio_window(length,aubio_win_hanning);
+    t = new_aubio_window("hanning", length);
     fvec_print(t);
     del_fvec(t);
-    t = new_aubio_window(length,aubio_win_hanningz);
+    t = new_aubio_window("hanningz", length);
     fvec_print(t);
     del_fvec(t);
-    t = new_aubio_window(length,aubio_win_blackman);
+    t = new_aubio_window("blackman", length);
     fvec_print(t);
     del_fvec(t);
-    t = new_aubio_window(length,aubio_win_blackman_harris);
+    t = new_aubio_window("blackman_harris", length);
     fvec_print(t);
     del_fvec(t);
-    t = new_aubio_window(length,aubio_win_gaussian);
+    t = new_aubio_window("gaussian", length);
     fvec_print(t);
     del_fvec(t);
-    t = new_aubio_window(length,aubio_win_welch);
+    t = new_aubio_window("welch", length);
     fvec_print(t);
     del_fvec(t);
-    t = new_aubio_window(length,aubio_win_parzen);
+    t = new_aubio_window("parzen", length);
+    fvec_print(t);
+    del_fvec(t);
+    t = new_aubio_window("default", length);
     fvec_print(t);
     del_fvec(t);
