Index: .bzrignore
===================================================================
--- .bzrignore	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ .bzrignore	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,25 @@
+*/Makefile.in
+*/*/Makefile.in
+*/*/*/Makefile.in
+*/Makefile
+*/*/Makefile
+*/*/*/Makefile
+*/.deps
+*/*/.deps
+*/*/*/.deps
+*/.libs
+*/*/.libs
+*/*/*/.libs
+*/*.lo
+*/*/*.lo
+*/*/*/*.lo
+*/*.la
+plugins/puredata/aubio.pd_linux
+doc/aubiocut.1
+doc/aubionotes.1
+doc/aubioonset.1
+doc/aubiopitch.1
+doc/aubiotrack.1
+src/config.h
+src/config.h.in
+src/stamp-h1
Index: configure.ac
===================================================================
--- configure.ac	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ configure.ac	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -241,5 +241,6 @@
     ext/Makefile
     examples/Makefile
-    examples/tests/Makefile
+    tests/Makefile
+    tests/src/Makefile
     sounds/Makefile
     swig/Makefile
Index: examples/Makefile.am
===================================================================
--- examples/Makefile.am	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ examples/Makefile.am	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -1,6 +1,2 @@
-if COMPILE_TESTS 
-SUBDIRS = tests
-endif
-
 # global flags
 AM_CFLAGS = -DAUBIO_PREFIX=\"$(prefix)\" -I$(top_srcdir)/src -I$(top_srcdir)/ext @AUBIO_CFLAGS@ @LASH_CFLAGS@ @FFTWLIB_CFLAGS@
Index: amples/tests/Makefile.am
===================================================================
--- examples/tests/Makefile.am	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,36 +1,0 @@
-AM_CFLAGS = -I$(top_srcdir)/src
-AM_LDFLAGS = -L$(top_builddir)/src -laubio @FFTWLIB_LIBS@
-
-test_phasevoc_jack_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/ext @JACK_CFLAGS@
-test_phasevoc_jack_LDADD  = $(AM_LDFLAGS) -laubioext -L$(top_builddir)/ext @JACK_LIBS@ 
-
-bin_PROGRAMS = \
-	test-fft \
-	test-mfft \
-	test-hist \
-	test-scale \
-	test-sample \
-	test-window \
-	test-filter \
-	test-biquad \
-	test-resample \
-	test-peakpick \
-	test-phasevoc \
-	test-phasevoc-jack \
-	test-onsetdetection \
-	test-pitchyin \
-	test-pitchyinfft \
-	test-pitchschmitt \
-	test-pitchfcomb \
-	test-pitchmcomb \
-	test-pitchdetection \
-	test-beattracking \
-	test-onset \
-	test-tempo \
-	test-tss
-
-run-tests: $(bin_PROGRAMS)
-	@for i in $(bin_PROGRAMS); do echo $$i; ((time ./$$i 2>&1 > /dev/null) 2>&1; echo $$?); done
-
-run-valgrind-tests: $(bin_PROGRAMS)
-	@for i in $(bin_PROGRAMS); do echo $$i; valgrind .libs/lt-$$i 2>&1 | grep ERROR\ SUMMARY -A4; echo $$?; done
Index: amples/tests/test-beattracking.c
===================================================================
--- examples/tests/test-beattracking.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,39 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t channels   = 1;                          /* number of channel */
-        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
-        fvec_t * out      = new_fvec (win_s/4, channels);     /* input buffer */
-  
-        /* allocate fft and other memory space */
-        aubio_beattracking_t * tempo  = new_aubio_beattracking(win_s, channels);
-
-        uint_t i = 0;
-
-        smpl_t curtempo, curtempoconf;
-
-        while (i < 10) {
-          aubio_beattracking_do(tempo,in,out);
-          curtempo = aubio_beattracking_get_bpm(tempo);
-          if (curtempo != 0.) {
-            fprintf(stdout,"%f\n",curtempo);
-            return 1;
-          }
-          curtempoconf = aubio_beattracking_get_confidence(tempo);
-          if (curtempoconf != 0.) {
-            fprintf(stdout,"%f\n",curtempo);
-            return 1;
-          }
-          i++;
-        };
-
-        del_aubio_beattracking(tempo);
-        del_fvec(in);
-        del_fvec(out);
-        aubio_cleanup();
-
-        return 0;
-}
-
Index: amples/tests/test-biquad.c
===================================================================
--- examples/tests/test-biquad.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,16 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t channels   = 1;                          /* number of channel */
-        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
-        aubio_biquad_t * o = new_aubio_biquad(0.3,0.2,0.1,0.2,0.3);
-
-        aubio_biquad_do_filtfilt(o,in,in);
-        aubio_biquad_do(o,in);
-
-        del_aubio_biquad(o);
-        del_fvec(in);
-        return 0;
-}
Index: amples/tests/test-fft.c
===================================================================
--- examples/tests/test-fft.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,58 +1,0 @@
-#include <stdlib.h>
-#include <math.h>
-#include <complex.h>
-#include <aubio.h>
-
-#define NEW_ARRAY(_t,_n)		(_t*)malloc((_n)*sizeof(_t))
-
-
-int main(){
-        uint_t i,j;
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t channels   = 1;                          /* number of channel */
-        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
-        cvec_t * fftgrain = new_cvec (win_s, channels); /* fft norm and phase */
-        fvec_t * out      = new_fvec (win_s, channels); /* output buffer */
-  
-        /* allocate fft and other memory space */
-        aubio_fft_t * fft      = new_aubio_fft(win_s);      /* fft interface */
-        smpl_t * w             = NEW_ARRAY(smpl_t,win_s); /* window */
-        /* complex spectral data */
-        fft_data_t ** spec     = NEW_ARRAY(fft_data_t*,channels); 
-        for (i=0; i < channels; i++)
-                spec[i] = NEW_ARRAY(fft_data_t,win_s);
-        /* initialize the window (see mathutils.c) */
-        aubio_window(w,win_s,aubio_win_hanningz);
-  
-        /* fill input with some data */
-        in->data[0][win_s/2] = 1;
-  
-        /* execute stft */
-        for (i=0; i < channels; i++) {
-                aubio_fft_do (fft,in->data[i],spec[i],win_s);
-                /* put norm and phase into fftgrain */
-                aubio_fft_getnorm(fftgrain->norm[i], spec[i], win_s/2+1);
-                aubio_fft_getphas(fftgrain->phas[i], spec[i], win_s/2+1);
-        }
-  
-        /* execute inverse fourier transform */
-        for (i=0; i < channels; i++) {
-                for (j=0; j<win_s/2+1; j++) {
-                        spec[i][j]  = cexp(I*aubio_unwrap2pi(fftgrain->phas[i][j]));
-                        spec[i][j] *= fftgrain->norm[i][j];
-                }
-                aubio_fft_rdo(fft,spec[i],out->data[i],win_s);
-        }
-
-        del_fvec(in);
-        del_fvec(out);
-        del_cvec(fftgrain);
-        free(w);
-        del_aubio_fft(fft);
-        for (i=0; i < channels; i++)
-                free(spec[i]);
-        free(spec); 
-        aubio_cleanup();
-        return 0;
-}
Index: amples/tests/test-filter.c
===================================================================
--- examples/tests/test-filter.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,23 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t channels   = 1;                          /* number of channel */
-        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
-        fvec_t * out      = new_fvec (win_s, channels);     /* input buffer */
-  
-        /* allocate fft and other memory space */
-        aubio_filter_t * o = new_aubio_cdsgn_filter(44100);
-
-        aubio_filter_do(o,in);
-        aubio_filter_do_outplace(o,in,out);
-        aubio_filter_do_filtfilt(o,in,out);
-
-        del_aubio_filter(o);
-        del_fvec(in);
-        del_fvec(out);
-        aubio_cleanup();
-
-        return 0;
-}
Index: amples/tests/test-hist.c
===================================================================
--- examples/tests/test-hist.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,38 +1,0 @@
-#include <aubio.h>
-#include <stdlib.h>
-
-void print_array(fvec_t *f);
-void print_array(fvec_t *f){
-  uint i,j;
-  for (i=0;i<f->channels;i++){
-    for (j=0;j<f->length;j++){
-      printf("%f, ", f->data[i][j]); 
-    }
-    printf(";\n"); 
-  }
-}
-
-int main( int argc, char** argv )
-{
-  uint_t length;
-  for (length = 1; length < 10; length ++ ) {
-    fvec_t *t = new_fvec(length,5);
-    aubio_hist_t *o = new_aubio_hist(0, 1, length, 5);
-    aubio_window(t->data[0],t->length,aubio_win_hanning);
-    aubio_window(t->data[1],t->length,aubio_win_hanningz);
-    aubio_window(t->data[2],t->length,aubio_win_blackman);
-    aubio_window(t->data[3],t->length,aubio_win_blackman_harris);
-    aubio_window(t->data[4],t->length,aubio_win_hamming);
-    print_array(t);
-    aubio_hist_do(o,t);
-    print_array(t);
-    aubio_hist_do_notnull(o,t);
-    print_array(t);
-    aubio_hist_dyn_notnull(o,t);
-    print_array(t);
-    del_aubio_hist(o);
-    del_fvec(t);
-  }
-  return 0;
-}
-
Index: amples/tests/test-mfft.c
===================================================================
--- examples/tests/test-mfft.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,28 +1,0 @@
-
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 4096;                       /* window size        */
-        uint_t channels   = 100;                        /* number of channels */
-        fvec_t * in       = new_fvec (win_s, channels); /* input buffer       */
-        cvec_t * fftgrain = new_cvec (win_s, channels); /* fft norm and phase */
-        fvec_t * out      = new_fvec (win_s, channels); /* output buffer      */
-        /* allocate fft and other memory space */
-        aubio_mfft_t * fft = new_aubio_mfft(win_s,channels);
-        /* fill input with some data */
-        //printf("initialised\n");
-        /* execute stft */
-        aubio_mfft_do (fft,in,fftgrain);
-        //printf("computed forward\n");
-        /* execute inverse fourier transform */
-        aubio_mfft_rdo(fft,fftgrain,out);
-        //printf("computed backard\n");
-        del_aubio_mfft(fft);
-        del_fvec(in);
-        del_cvec(fftgrain);
-        del_fvec(out);
-        //printf("memory freed\n");
-        aubio_cleanup();
-        return 0;
-}
Index: amples/tests/test-onset.c
===================================================================
--- examples/tests/test-onset.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,23 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t channels   = 1;                          /* number of channel */
-        fvec_t * in       = new_fvec (win_s/4, channels); /* input buffer */
-        fvec_t * out      = new_fvec (2, channels);     /* input buffer */
-        aubio_onset_t * onset  = new_aubio_onset(aubio_onset_complex, win_s, win_s/4, channels);
-        uint_t i = 0;
-
-        while (i < 10) {
-          aubio_onset(onset,in,out);
-          i++;
-        };
-
-        del_aubio_onset(onset);
-        del_fvec(in);
-        del_fvec(out);
-        aubio_cleanup();
-
-        return 0;
-}
Index: amples/tests/test-onsetdetection.c
===================================================================
--- examples/tests/test-onsetdetection.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,54 +1,0 @@
-
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t channels   = 1;                          /* number of channel */
-        cvec_t * in       = new_cvec (win_s, channels); /* input buffer */
-        fvec_t * out      = new_fvec (1, channels);     /* input buffer */
-  
-        /* allocate fft and other memory space */
-        aubio_onsetdetection_t * o = 
-          new_aubio_onsetdetection(aubio_onset_energy, win_s, channels);
-        aubio_onsetdetection(o,in,out);
-        aubio_onsetdetection_energy(o,in,out);
-        del_aubio_onsetdetection(o);
-
-        o = new_aubio_onsetdetection(aubio_onset_specdiff, win_s, channels);
-        aubio_onsetdetection(o,in,out);
-        aubio_onsetdetection_specdiff(o,in,out);
-        del_aubio_onsetdetection(o);
-
-        o = new_aubio_onsetdetection(aubio_onset_hfc, win_s, channels);
-        aubio_onsetdetection(o,in,out);
-        aubio_onsetdetection_hfc(o,in,out);
-        del_aubio_onsetdetection(o);
-
-        o = new_aubio_onsetdetection(aubio_onset_complex, win_s, channels);
-        aubio_onsetdetection(o,in,out);
-        aubio_onsetdetection_complex(o,in,out);
-        del_aubio_onsetdetection(o);
-
-        o = new_aubio_onsetdetection(aubio_onset_phase, win_s, channels);
-        aubio_onsetdetection(o,in,out);
-        aubio_onsetdetection_phase(o,in,out);
-        del_aubio_onsetdetection(o);
-
-        o = new_aubio_onsetdetection(aubio_onset_kl, win_s, channels);
-        aubio_onsetdetection(o,in,out);
-        aubio_onsetdetection_kl(o,in,out);
-        del_aubio_onsetdetection(o);
-
-        o = new_aubio_onsetdetection(aubio_onset_mkl, win_s, channels);
-        aubio_onsetdetection(o,in,out);
-        aubio_onsetdetection_mkl(o,in,out);
-        del_aubio_onsetdetection(o);
-
-        del_cvec(in);
-        del_fvec(out);
-        aubio_cleanup();
-
-        return 0;
-}
-
Index: amples/tests/test-peakpick.c
===================================================================
--- examples/tests/test-peakpick.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,19 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t channels   = 1;                          /* number of channel */
-        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
-        aubio_pickpeak_t * o = new_aubio_peakpicker(0.3);
-
-        aubio_peakpick_pimrt(in,o);
-        aubio_peakpick_pimrt(in,o);
-        aubio_peakpick_pimrt(in,o);
-        aubio_peakpick_pimrt(in,o);
-
-        del_aubio_peakpicker(o);
-        del_fvec(in);
-        return 0;
-}
-
Index: amples/tests/test-phasevoc-jack.c
===================================================================
--- examples/tests/test-phasevoc-jack.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,84 +1,0 @@
-/* test sample for phase vocoder 
- *
- * this program should start correctly using JACK_START_SERVER=true and
- * reconstruct each audio input frame perfectly on the corresponding input with
- * a delay equal to the window size, hop_s.
- */
-
-#include <unistd.h>  /* pause() or sleep() */
-#include <aubio.h>
-#include <aubioext.h>
-
-uint_t win_s    = 32; /* window size                       */
-uint_t hop_s    = 8;  /* hop size                          */
-uint_t channels = 4;  /* number of channels                */
-uint_t pos      = 0;  /* frames%dspblocksize for jack loop */
-
-fvec_t * in;
-cvec_t * fftgrain;
-fvec_t * out;
-
-aubio_pvoc_t * pv;
-
-#ifdef JACK_SUPPORT
-aubio_jack_t * jack_setup;
-#endif
-
-int aubio_process(float **input, float **output, int nframes);
-
-int main(){
-        /* allocate some memory */
-        in       = new_fvec (hop_s, channels); /* input buffer       */
-        fftgrain = new_cvec (win_s, channels); /* fft norm and phase */
-        out      = new_fvec (hop_s, channels); /* output buffer      */
-        /* allocate fft and other memory space */
-        pv = new_aubio_pvoc(win_s,hop_s,channels);
-        /* fill input with some data */
-        printf("initialised\n");
-        /* execute stft */
-        aubio_pvoc_do (pv,in,fftgrain);
-        printf("computed forward\n");
-        /* execute inverse fourier transform */
-        aubio_pvoc_rdo(pv,fftgrain,out);
-        printf("computed backard\n");
-
-#ifdef JACK_SUPPORT
-        jack_setup  = new_aubio_jack(channels, channels,
-                        (aubio_process_func_t)aubio_process);
-        aubio_jack_activate(jack_setup);
-        sleep(10); //pause(); /* enter main jack loop */
-        aubio_jack_close(jack_setup);
-#endif
-        
-        del_aubio_pvoc(pv);
-        del_cvec(fftgrain);
-        del_fvec(in);
-        del_fvec(out);
-        aubio_cleanup();
-        printf("memory freed\n");
-        return 0;
-}
-
-int aubio_process(float **input, float **output, int nframes) {
-  uint_t i;       /*channels*/
-  uint_t j;       /*frames*/
-  for (j=0;j<(unsigned)nframes;j++) {
-    for (i=0;i<channels;i++) {
-      /* write input to datanew */
-      fvec_write_sample(in, input[i][j], i, pos);
-      /* put synthnew in output */
-      output[i][j] = fvec_read_sample(out, i, pos);
-    }
-    /*time for fft*/
-    if (pos == hop_s-1) {
-      /* block loop */
-      aubio_pvoc_do (pv,in, fftgrain);
-      //for (i=0;i<fftgrain->length;i++) fftgrain->phas[0][i] *= 2.; 
-      //for (i=0;i<fftgrain->length;i++) fftgrain->phas[0][i] = 0.; 
-      aubio_pvoc_rdo(pv,fftgrain,out);
-      pos = -1;
-    }
-    pos++;
-  }
-  return 0;
-}
Index: amples/tests/test-phasevoc.c
===================================================================
--- examples/tests/test-phasevoc.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,30 +1,0 @@
-/* test sample for phase vocoder */
-
-#include <aubio.h>
-
-int main(){
-        uint_t win_s    = 1024; /* window size                       */
-        uint_t hop_s    = 256;  /* hop size                          */
-        uint_t channels = 4;  /* number of channels                */
-        /* allocate some memory */
-        fvec_t * in       = new_fvec (hop_s, channels); /* input buffer       */
-        cvec_t * fftgrain = new_cvec (win_s, channels); /* fft norm and phase */
-        fvec_t * out      = new_fvec (hop_s, channels); /* output buffer      */
-        /* allocate fft and other memory space */
-        aubio_pvoc_t * pv = new_aubio_pvoc(win_s,hop_s,channels);
-        /* fill input with some data */
-        printf("initialised\n");
-        /* execute stft */
-        aubio_pvoc_do (pv,in,fftgrain);
-        printf("computed forward\n");
-        /* execute inverse fourier transform */
-        aubio_pvoc_rdo(pv,fftgrain,out);
-        printf("computed backard\n");
-        del_aubio_pvoc(pv);
-        del_fvec(in);
-        del_cvec(fftgrain);
-        del_fvec(out);
-        aubio_cleanup();
-        printf("memory freed\n");
-        return 0;
-}
Index: amples/tests/test-pitchdetection.c
===================================================================
--- examples/tests/test-pitchdetection.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,27 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t hop_s      = win_s/4;                    /* hop size */
-        uint_t samplerate = 44100;                      /* samplerate */
-        uint_t channels   = 1;                          /* number of channel */
-        aubio_pitchdetection_mode mode = aubio_pitchm_freq;
-        aubio_pitchdetection_type type = aubio_pitch_yinfft;
-        fvec_t * in       = new_fvec (hop_s, channels); /* input buffer */
-        aubio_pitchdetection_t * o  = new_aubio_pitchdetection(
-          win_s, hop_s, channels, samplerate, type, mode
-          );
-        uint_t i = 0;
-
-        while (i < 1000) {
-          aubio_pitchdetection(o,in);
-          i++;
-        };
-
-        del_aubio_pitchdetection(o);
-        del_fvec(in);
-        aubio_cleanup();
-
-        return 0;
-}
Index: amples/tests/test-pitchfcomb.c
===================================================================
--- examples/tests/test-pitchfcomb.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,25 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t hop_s      = win_s/4;                    /* hop size */
-        uint_t samplerate = 44100;                      /* samplerate */
-        uint_t channels   = 1;                          /* number of channel */
-        fvec_t * in       = new_fvec (hop_s, channels); /* input buffer */
-        aubio_pitchfcomb_t * o  = new_aubio_pitchfcomb (
-          win_s, hop_s, samplerate
-          );
-        uint_t i = 0;
-
-        while (i < 1000) {
-          aubio_pitchfcomb_detect(o,in);
-          i++;
-        };
-
-        del_aubio_pitchfcomb(o);
-        del_fvec(in);
-        aubio_cleanup();
-
-        return 0;
-}
Index: amples/tests/test-pitchmcomb.c
===================================================================
--- examples/tests/test-pitchmcomb.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t hop_s      = win_s/4;                    /* hop size */
-        uint_t samplerate = 44100;
-        uint_t channels   = 1;                          /* number of channel */
-        cvec_t * in       = new_cvec (win_s, channels); /* input buffer */
-        aubio_pitchmcomb_t * o  = new_aubio_pitchmcomb(
-          win_s, hop_s, channels, samplerate );
-        uint_t i = 0;
-
-        while (i < 1000) {
-          aubio_pitchmcomb_detect (o,in);
-          i++;
-        };
-
-        del_aubio_pitchmcomb(o);
-        del_cvec(in);
-        aubio_cleanup();
-
-        return 0;
-}
Index: amples/tests/test-pitchschmitt.c
===================================================================
--- examples/tests/test-pitchschmitt.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,23 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t samplerate = 44100;                          /* number of channel */
-        fvec_t * in       = new_fvec (win_s, 1); /* input buffer */
-        aubio_pitchschmitt_t * o  = new_aubio_pitchschmitt(
-          win_s, samplerate );
-        uint_t i = 0;
-
-        while (i < 1000) {
-          aubio_pitchschmitt_detect (o,in);
-          i++;
-        };
-
-        del_aubio_pitchschmitt(o);
-        del_fvec(in);
-        aubio_cleanup();
-
-        return 0;
-}
-
Index: amples/tests/test-pitchyin.c
===================================================================
--- examples/tests/test-pitchyin.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t channels   = 1;                          /* number of channel */
-        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
-        fvec_t * out      = new_fvec (win_s/2, channels); /* input buffer */
-        uint_t i = 0;
-
-        while (i < 10) {
-          aubio_pitchyin_diff   (in,out);
-          aubio_pitchyin_getcum (out);
-          aubio_pitchyin_getpitch (out);
-          aubio_pitchyin_getpitchfast (in,out,0.2);
-          i++;
-        };
-
-        del_fvec(in);
-        del_fvec(out);
-        aubio_cleanup();
-
-        return 0;
-}
Index: amples/tests/test-pitchyinfft.c
===================================================================
--- examples/tests/test-pitchyinfft.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,22 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t channels   = 1;                          /* number of channel */
-        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
-        aubio_pitchyinfft_t * o  = new_aubio_pitchyinfft(win_s);
-        uint_t i = 0;
-
-        while (i < 10) {
-          aubio_pitchyinfft_detect (o,in,0.2);
-          i++;
-        };
-
-        del_aubio_pitchyinfft(o);
-        del_fvec(in);
-        aubio_cleanup();
-
-        return 0;
-}
-
Index: amples/tests/test-resample.c
===================================================================
--- examples/tests/test-resample.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,23 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t channels   = 1;                          /* number of channel */
-        smpl_t ratio      = 0.5;
-        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
-        fvec_t * out      = new_fvec ((uint_t)(win_s*ratio), channels);     /* input buffer */
-        aubio_resampler_t * o  = new_aubio_resampler(0.5, 0);
-        uint_t i = 0;
-
-        while (i < 100) {
-          aubio_resampler_process(o,in,out);
-          i++;
-        };
-
-        del_aubio_resampler(o);
-        del_fvec(in);
-        del_fvec(out);
-
-        return 0;
-}
Index: amples/tests/test-sample.c
===================================================================
--- examples/tests/test-sample.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t channels   = 1;                          /* number of channel */
-        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
-        cvec_t * sp       = new_cvec (win_s, channels); /* input buffer */
-        del_fvec(in);
-        del_cvec(sp);
-
-        return 0;
-}
-
Index: amples/tests/test-scale.c
===================================================================
--- examples/tests/test-scale.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,21 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t channels   = 1;                          /* number of channel */
-        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
-        aubio_scale_t * o = new_aubio_scale(0,1,2,3);
-        aubio_scale_set(o,0,1,2,3);
-        uint_t i = 0;
-
-        while (i < 1000) {
-          aubio_scale_do(o,in);
-          i++;
-        };
-
-        del_aubio_scale(o);
-        del_fvec(in);
-
-        return 0;
-}
Index: amples/tests/test-tempo.c
===================================================================
--- examples/tests/test-tempo.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,35 +1,0 @@
-#include <aubio.h>
-
-int main(){
-        /* allocate some memory */
-        uint_t win_s      = 1024;                       /* window size */
-        uint_t channels   = 1;                          /* number of channel */
-        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
-        fvec_t * out      = new_fvec (2, channels);     /* input buffer */
-        aubio_tempo_t * o  = new_aubio_tempo(aubio_onset_complex, win_s, win_s/4, channels);
-        uint_t i = 0;
-
-        smpl_t curtempo, curtempoconf;
-
-        while (i < 1000) {
-          aubio_tempo(o,in,out);
-          curtempo = aubio_tempo_get_bpm(o);
-          if (curtempo != 0.) {
-            fprintf(stdout,"%f\n",curtempo);
-            return 1;
-          }
-          curtempoconf = aubio_beattracking_get_confidence(o);
-          if (curtempoconf != 0.) {
-            fprintf(stdout,"%f\n",curtempo);
-            return 1;
-          }
-          i++;
-        };
-
-        del_aubio_tempo(o);
-        del_fvec(in);
-        del_fvec(out);
-        aubio_cleanup();
-
-        return 0;
-}
Index: amples/tests/test-tss.c
===================================================================
--- examples/tests/test-tss.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/* test sample for phase vocoder 
- *
- * this program should start correctly using JACK_START_SERVER=true and
- * reconstruct each audio input frame perfectly on the corresponding input with
- * a delay equal to the window size, hop_s.
- */
-
-#include <aubio.h>
-
-int main(){
-	int i;
-        uint_t win_s    = 1024; /* window size                       */
-        uint_t hop_s    = 256;  /* hop size                          */
-        uint_t channels = 4;  /* number of channels                */
-        /* allocate some memory */
-        fvec_t * in       = new_fvec (hop_s, channels); /* input buffer       */
-        cvec_t * fftgrain = new_cvec (win_s, channels); /* fft norm and phase */
-        cvec_t * cstead   = new_cvec (win_s, channels); /* fft norm and phase */
-        cvec_t * ctrans   = new_cvec (win_s, channels); /* fft norm and phase */
-        fvec_t * stead    = new_fvec (hop_s, channels); /* output buffer      */
-        fvec_t * trans    = new_fvec (hop_s, channels); /* output buffer      */
-        /* allocate fft and other memory space */
-        aubio_pvoc_t * pv = new_aubio_pvoc (win_s,hop_s,channels);
-        aubio_pvoc_t * pvt = new_aubio_pvoc(win_s,hop_s,channels);
-        aubio_pvoc_t * pvs = new_aubio_pvoc(win_s,hop_s,channels);
-
-	aubio_tss_t *  tss = new_aubio_tss(0.01,3.,4.,win_s,hop_s,channels);
-        /* fill input with some data */
-        printf("initialised\n");
-        /* execute stft */
-	for (i = 0; i < 10; i++) {
-		aubio_pvoc_do (pv,in,fftgrain);
-		aubio_tss_do  (tss,fftgrain,ctrans,cstead);
-		aubio_pvoc_rdo(pvt,cstead,stead);
-		aubio_pvoc_rdo(pvs,ctrans,trans);
-	}
-        del_aubio_pvoc(pv);
-        del_fvec(in);
-        del_cvec(fftgrain);
-        del_cvec(cstead);
-        del_cvec(ctrans);
-        del_fvec(stead);
-        del_fvec(trans);
-        aubio_cleanup();
-        printf("memory freed\n");
-        return 0;
-}
Index: amples/tests/test-window.c
===================================================================
--- examples/tests/test-window.c	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,37 +1,0 @@
-#include <aubio.h>
-#include <stdlib.h>
-
-void print_array(fvec_t *f);
-void print_array(fvec_t *f){
-  uint i,j;
-  for (i=0;i<f->channels;i++)
-  {
-    for (j=0;j<f->length;j++)
-    {
-      printf("%1.3e, ", f->data[i][j]); 
-    }
-    printf(";\n"); 
-  }
-}
-
-int main( int argc, char** argv )
-{
-  uint_t length;
-  for (length = 2; length <= 5; length++)
-  {
-    fvec_t *t = new_fvec(length,9);
-    aubio_window(t->data[0],t->length,aubio_win_rectangle);
-    aubio_window(t->data[1],t->length,aubio_win_hamming);
-    aubio_window(t->data[2],t->length,aubio_win_hanning);
-    aubio_window(t->data[3],t->length,aubio_win_hanningz);
-    aubio_window(t->data[4],t->length,aubio_win_blackman);
-    aubio_window(t->data[5],t->length,aubio_win_blackman_harris);
-    aubio_window(t->data[6],t->length,aubio_win_gaussian);
-    aubio_window(t->data[7],t->length,aubio_win_welch);
-    aubio_window(t->data[8],t->length,aubio_win_parzen);
-    print_array(t);
-    del_fvec(t);
-  }
-  return 0;
-}
-
Index: thon/test/aubiomodule.py
===================================================================
--- python/test/aubiomodule.py	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,14 +1,0 @@
-import unittest
-
-class aubiomodule_test_case(unittest.TestCase):
-
-  def test_aubio(self):
-    """ try importing aubio module """
-    import aubio 
-
-  def test_aubiowrapper(self):
-    """ try importing aubio.aubiowrapper module """
-    from aubio import aubiowrapper 
- 
-if __name__ == '__main__':
-  unittest.main()
Index: thon/test/bench/onset/Makefile.am
===================================================================
--- python/test/bench/onset/Makefile.am	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,44 +1,0 @@
-export BASEDIR=../../../..
-export PYTHONPATH=$(BASEDIR)/python
-export LD_LIBRARY_PATH=$(BASEDIR)/src/.libs:$(BASEDIR)/ext/.libs
-
-DETAILSOURCE = \
-	/var/tmp/Onset-Mirex2005/poly_pitched \
-	/var/tmp/Onset-Mirex2005/solo_bars_and_bells \
-	/var/tmp/Onset-Mirex2005/solo_brass \
-	/var/tmp/Onset-Mirex2005/solo_drums \
-	/var/tmp/Onset-Mirex2005/solo_plucked_strings \
-	/var/tmp/Onset-Mirex2005/solo_singing_voice \
-	/var/tmp/Onset-Mirex2005/solo_sustained_strings \
-	/var/tmp/Onset-Mirex2005/solo_winds \
-	/var/tmp/Onset-Mirex2005/complex
-
-SOURCE = /var/tmp/Onset-Mirex2005
-
-TESTSOURCE = \
-	/var/tmp/Onset-Mirex2005/solo_bars_and_bells \
-	/var/tmp/Onset-Mirex2005/solo_winds \
-	/archives/samples/DB/PercussivePhrases/CM18/Samba_Audio
-
-test-aubiocut:            $(patsubst %, %.aubiocut,    $(TESTSOURCE))
-test-aubiodelay:          $(patsubst %, %.aubiodelay,  $(TESTSOURCE))
-test-aubiowindow:         $(patsubst %, %.aubiowindow, $(TESTSOURCE))
-
-final-aubiocut:           $(patsubst %, %.aubiocut,    $(DETAILSOURCE) $(SOURCE))
-final-aubiodelay:         $(patsubst %, %.aubiodelay,  $(SOURCE))
-final-aubiowindow:        $(patsubst %, %.aubiowindow, $(SOURCE))
-
-%.aubiocut: %
-	rm -f `basename $@`
-	./bench-onset $< | tee `basename $@`
-	-diff `basename $@`.ref `basename $@`
-
-%.aubiodelay: %
-	rm -f `basename $@`
-	./bench-delay $< | tee `basename $@`
-	-diff `basename $@`.ref `basename $@`
-
-%.aubiowindow: %
-	rm -f `basename $@`
-	./bench-window $< | tee `basename $@`
-	-diff `basename $@`.ref `basename $@`
Index: thon/test/bench/onset/bench-delay
===================================================================
--- python/test/bench/onset/bench-delay	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,62 +1,0 @@
-#! /usr/bin/python
-
-from aubio.bench.onset import benchonset
-from aubio.task.onset import taskonset
-from aubio.task.params import taskparams
-
-class mybenchonset(benchonset):
-
-	def run_bench(self,modes=['dual'],thresholds=[0.5]):
-		from os.path import dirname,basename
-		self.thresholds = thresholds
-		self.pretty_titles()
-
-		for mode in modes:
-			d = []
-			self.params.onsetmode = mode
-			self.params.localmin = True
-			self.params.delay = 1. 
-			self.params.threshold = thresholds[0]
-			#
-			self.params.localmin = False 
-			self.params.delay = 0. 
-			self.dir_eval_print()
-			self.plotdiffs(d,plottitle="Causal")
-			#
-			self.params.localmin = True
-			self.params.delay = 0. 
-			self.dir_eval_print()
-			self.plotdiffs(d,plottitle="Local min")
-
-			self.params.localmin = False 
-			self.params.delay = 6. 
-			self.dir_eval_print()
-			self.plotdiffs(d,plottitle="Fixed delay")
-
-			#self.plotplotdiffs(d)
-			outplot = "_-_".join(("delay",mode,basename(self.datadir) ))
-			for ext in ("png","svg","ps"):
-				self.plotplotdiffs(d,outplot=outplot,extension=ext)
-
-if __name__ == "__main__":
-	import sys
-	if len(sys.argv) > 1: datapath = sys.argv[1]
-	else: print "ERR: a path is required"; sys.exit(1)
-	modes = ['complex', 'energy', 'phase', 'hfc', 'specdiff', 'kl', 'mkl', 'dual']
-	#thresholds = [ 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2]
-	#modes = [ 'hfc' ]
-	thresholds = [0.5]
-
-	#datapath = "%s%s" % (DATADIR,'/onset/DB/*/')
-	respath = '/var/tmp/DB-testings'
-
-	benchonset = mybenchonset(datapath,respath,checkres=True,checkanno=True)
-	benchonset.params = taskparams()
-	benchonset.task = taskonset
-	benchonset.valuesdict = {}
-
-	try:
-		#benchonset.auto_learn2(modes=modes)
-		benchonset.run_bench(modes=modes,thresholds=thresholds)
-	except KeyboardInterrupt:
-		sys.exit(1)
Index: thon/test/bench/onset/bench-onset
===================================================================
--- python/test/bench/onset/bench-onset	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,68 +1,0 @@
-#! /usr/bin/python
-
-from aubio.task import *
-
-from aubio.bench.onset import mmean, stdev, benchonset
-
-class mybenchonset(benchonset):
-
-	def run_bench(self,modes=['dual'],thresholds=[0.5]):
-		from os.path import dirname,basename
-		self.thresholds = thresholds
-		self.pretty_titles()
-		d,e,f,g = [],[],[],[]
-		for mode in modes:
-			self.vlist = []
-			self.params.onsetmode = mode
-			#self.params.localmin = True
-
-			for threshold in self.thresholds:
-				self.params.threshold = threshold
-				self.dir_eval_print()
-				self.vlist.append(self.v)
-			self.plotroc(d)
-			self.plotfmeas(e)
-			self.plotpr(f)
-			#self.plothistcat(g)
-
-
-
-		#self.plotplotroc(d)
-		#self.plotplotfmeas(e)
-		#self.plotplotpr(f)
-		outplot = basename(self.datadir)
-		for ext in ("png","svg","ps"):
-			self.plotplotroc(d,outplot=outplot,extension=ext)
-			self.plotplotfmeas(e,outplot=outplot,extension=ext)
-			self.plotplotpr(f,outplot=outplot,extension=ext)
-			#self.plotplothistcat(g,outplot=outplot,extension=ext)
-
-if __name__ == "__main__":
-	import sys
-	if len(sys.argv) > 1: datapath = sys.argv[1]
-	else: print "ERR: a path is required"; sys.exit(1)
-	modes = ['complex', 'energy', 'phase', 'hfc', 'specdiff', 'kl', 'mkl', 'dual']
-	thresholds = [ 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2]
-	#modes = [ 'hfc' ]
-	#thresholds = [0.5]
-
-	#datapath = "%s%s" % (DATADIR,'/onset/DB/*/')
-	respath = '/var/tmp/DB-testings'
-
-	benchonset = mybenchonset(datapath,respath,checkres=True,checkanno=True)
-	benchonset.params = taskparams()
-	benchonset.params.dcthreshold = -1.
-	benchonset.params.silence = -100.
-	benchonset.params.delay = 5. 
-	benchonset.params.bufsize = 1024 
-	benchonset.params.hopsize = 256 
-	benchonset.params.step = float(benchonset.params.hopsize)/float(benchonset.params.samplerate)
-	benchonset.params.mintol = 4.1 
-	benchonset.task = taskonset
-	benchonset.valuesdict = {}
-
-	try:
-		#benchonset.auto_learn2(modes=modes)
-		benchonset.run_bench(modes=modes,thresholds=thresholds)
-	except KeyboardInterrupt:
-		sys.exit(1)
Index: thon/test/bench/onset/bench-window
===================================================================
--- python/test/bench/onset/bench-window	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,59 +1,0 @@
-#! /usr/bin/python
-
-from aubio.bench.onset import benchonset
-from aubio.task.onset import taskonset
-from aubio.task.params import taskparams
-
-class mybenchonset(benchonset):
-
-	def run_bench(self,modes=['dual'],thresholds=[0.5]):
-		from os.path import dirname,basename
-		self.thresholds = thresholds
-		self.pretty_titles()
-
-		for mode in modes:
-
-			self.params.onsetmode = mode
-			self.params.localmin = True
-			self.params.delay = 1. 
-			self.params.threshold = thresholds[0]
-			self.params.localmin = False 
-			#
-			for delay in (0., 4.):
-				d = []
-				self.params.delay = delay 
-				for buf in (2048, 1024, 512):
-					for hop in (buf/2, buf/4):
-						self.params.bufsize = buf 
-						self.params.hopsize = hop 
-						self.params.step = float(self.params.hopsize)/float(self.params.samplerate)
-						self.dir_eval_print()
-						self.plotdiffs(d,plottitle="%s %s" % (buf,hop))
-				#plotplotdiffs(d)
-				outplot = "_-_".join(("window",mode,"delay-%s" % int(delay),
-					basename(self.datadir) ))
-				for ext in ("png","svg","ps"):
-					self.plotplotdiffs(d,outplot=outplot,extension=ext)
-
-if __name__ == "__main__":
-	import sys
-	if len(sys.argv) > 1: datapath = sys.argv[1]
-	else: print "ERR: a path is required"; sys.exit(1)
-	modes = ['complex', 'energy', 'phase', 'hfc', 'specdiff', 'kl', 'mkl', 'dual']
-	#thresholds = [ 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2]
-	#modes = [ 'hfc' ]
-	thresholds = [0.5]
-
-	#datapath = "%s%s" % (DATADIR,'/onset/DB/*/')
-	respath = '/var/tmp/DB-testings'
-
-	benchonset = mybenchonset(datapath,respath,checkres=True,checkanno=True)
-	benchonset.params = taskparams()
-	benchonset.task = taskonset
-	benchonset.valuesdict = {}
-
-	try:
-		#benchonset.auto_learn2(modes=modes)
-		benchonset.run_bench(modes=modes,thresholds=thresholds)
-	except KeyboardInterrupt:
-		sys.exit(1)
Index: thon/test/bench/pitch/Makefile.am
===================================================================
--- python/test/bench/pitch/Makefile.am	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,59 +1,0 @@
-export AUBIODIR=../../../..
-export PYTHONPATH=$(AUBIODIR)/python
-export LD_LIBRARY_PATH=$(AUBIODIR)/src/.libs:$(AUBIODIR)/ext/.libs
-
-CP=cp -a
-
-SOURCE = \
-	$(BASEDIR)/isolated/vibraphone \
-	$(BASEDIR)/isolated/clavinet \
-	$(BASEDIR)/isolated/elecguitar \
-	$(BASEDIR)/isolated/piano \
-	$(BASEDIR)/isolated/rhodes \
-	$(BASEDIR)/isolated
-
-
-MONOSOURCE = \
-	$(BASEDIR)/monophonic/Mirex04/daisy \
-	$(BASEDIR)/monophonic/Mirex04/midi \
-	$(BASEDIR)/monophonic/Mirex04/jazz \
-	$(BASEDIR)/monophonic/Mirex04/pop \
-	$(BASEDIR)/monophonic/Mirex04/opera \
-	$(BASEDIR)/monophonic/Mirex04
-
-POLYSOURCE = \
-	$(BASEDIR)/polyphonic/Mirex04/daisy \
-	$(BASEDIR)/polyphonic/Mirex04/midi \
-	$(BASEDIR)/polyphonic/Mirex04/jazz \
-	$(BASEDIR)/polyphonic/Mirex04/pop \
-	$(BASEDIR)/polyphonic/Mirex04/opera \
-	$(BASEDIR)/polyphonic/Mirex04
-
-test-aubiopitch-isolated:    $(patsubst %, %.aubiopitch-isolated, $(SOURCE))
-test-aubiopitch-monophonic:  $(patsubst %, %.aubiopitch-monophonic, $(MONOSOURCE))
-test-aubiopitch-polyphonic:  $(patsubst %, %.aubiopitch-polyphonic, $(POLYSOURCE))
-
-plotpitch:
-	../../../aubiopitch -m fcomb,mcomb,yinfft,yin,schmitt -i jazz2REF.wav -p -t 0.2 -l 100 -M 600 -O jazz2REF.ps
-	../../../aubiopitch -m fcomb,mcomb,yinfft,yin,schmitt -p -t 0.2 -l 300 -M 900 -i opera_fem2REF.wav -O opera_fem2REF.ps
-
-timings:
-	./bench-timings $(BASEDIR)/polyphonic/Mirex04/opera
-
-%.aubiopitch-isolated: %
-	$(CP) isolated/`basename $@` isolated/`basename $@`.old
-	./bench-pitch-isolated $< | tee isolated/`basename $@`
-	-diff isolated/`basename $@`.old isolated/`basename $@`
-	-diff isolated/`basename $@`.ref isolated/`basename $@`
-
-%.aubiopitch-monophonic: %
-	$(CP) monophonic/`basename $@` monophonic/`basename $@`.old
-	./bench-pitch-monophonic $< | tee monophonic/`basename $@`
-	-diff monophonic/`basename $@`.ref monophonic/`basename $@`
-	-diff monophonic/`basename $@`.old monophonic/`basename $@`
-
-%.aubiopitch-polyphonic: %
-	$(CP) polyphonic/`basename $@` polyphonic/`basename $@`.old
-	./bench-pitch-polyphonic $< | tee polyphonic/`basename $@`
-	-diff polyphonic/`basename $@`.ref polyphonic/`basename $@`
-	-diff polyphonic/`basename $@`.old polyphonic/`basename $@`
Index: thon/test/bench/pitch/bench-pitch-isolated
===================================================================
--- python/test/bench/pitch/bench-pitch-isolated	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,198 +1,0 @@
-#! /usr/bin/python
-
-from aubio.bench.node import *
-from aubio.task import *
-
-class benchpitch(bench):
-	
-	""" list of values to store per file """
-	valuenames = ['mode']
-	""" list of lists to store per file """
-	valuelists = ['truth', 'osil', 'esil', 'opit', 'epit', 'echr', 
-               'Msil', 'Mpit', 'Mchr',
-	       'TotalPit', 'TotalPit', 'TotalChr' ]
-	""" list of values to print per dir """
-	printnames_total = [ 'mode', 'MinPit', 'MaxPit', 'TotalSil', 'TotalPit', 'TotalChr']
-	printnames_notes = [ 'mode', 'Note', 'Sil', 'Pit', 'Chr']
-	printnames = printnames_notes 
-
-	""" per dir """
-	formats = {'mode': "%12s" , 
-		'truth': "%s",
-		'osil': "%s", 'esil': "%s", 
-		'opit': "%s", 'epit': "%s", 'echr': "%s",
-    'Note': "%s", 'Sil': "%s", 'Chr': "%s", 'Pit': "%s",
-		'TotalPit': "%s", 'TotalSil': "%s", 'TotalChr': "%s",
-		'MinPit': "%s", 'MaxPit': "%s",
-		'Msil': "%s", 'Mpit': "%s", 'Mchr': "%s"}
-
-	def dir_eval(self):
-		""" evaluate statistical data over the directory """
-		v = self.v
-		v['mode']      = self.params.pitchmode
-
-	def file_exec(self,input,output):
-		filetask = self.task(input,params=self.params)
-		computed_data = filetask.compute_all()
- 		osil, esil, opit, epit, echr = filetask.eval(computed_data,tol=0.5)
-		self.v['truth'].append(int(filetask.truth))
-		assert opit > 0
-		
-		self.v['osil'].append(osil)
-		self.v['esil'].append(esil)
-		self.v['opit'].append(opit)
-		self.v['epit'].append(epit)
-		self.v['echr'].append(echr)
-
-		self.v['Msil'].append(esil/float(osil)*100.)
-		self.v['Mpit'].append(epit/float(opit)*100.)
-		self.v['Mchr'].append(echr/float(opit)*100.)
-		#print results#, computed_data
-		#print input, results, results - float(input.split('.')[-2])
-			
-	def run_bench(self,modes=['schmitt'],multiplot=0):
-		from os.path import basename
-		self.modes = modes
-		self.pretty_titles()
-		d = []
-		for mode in self.modes:
-			self.params.pitchmode = mode
-			self.dir_exec()
-			self.dir_eval()
-			truth   = [i for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
-			allOsil = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
-			allEsil = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
-			allOpit = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
-			allEpit = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
-			allEchr = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
-			allMsil = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
-			allMpit = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
-			allMchr = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
-			for i in range(len(self.v['truth'])):
-				allOsil[self.v['truth'][i]-min(self.v['truth'])] += self.v['osil'][i]
-				allEsil[self.v['truth'][i]-min(self.v['truth'])] += self.v['esil'][i]
-				allOpit[self.v['truth'][i]-min(self.v['truth'])] += self.v['opit'][i]
-				allEpit[self.v['truth'][i]-min(self.v['truth'])] += self.v['epit'][i]
-				allEchr[self.v['truth'][i]-min(self.v['truth'])] += self.v['echr'][i]
-			for i in range(len(truth)):
-				allOsil[i] = max(1,allOsil[i])
-				allOpit[i] = max(1,allOpit[i])
-				allMsil[i] = allEsil[i]/float(allOsil[i])*100.
-				allMpit[i] = allEpit[i]/float(allOpit[i])*100.
-				allMchr[i] = allEchr[i]/float(allOpit[i])*100.
-				self.v['Sil'], self.v['Pit'], self.v['Chr'] = allMsil[i], allMpit[i], allMchr[i]
-				self.v['Note'] = truth[i]
-				#self.printnames = self.printnames_notes
-				self.pretty_print()
-			self.v['TotalSil'] = sum(allMsil)/len(truth)
-			self.v['TotalPit'] = sum(allMpit)/len(truth)
-			self.v['TotalChr'] = sum(allMchr)/len(truth)
-			self.v['MinPit'] = min(truth) 
-			self.v['MaxPit'] = max(truth) 
-			#self.printnames = self.printnames_total
-			#self.pretty_print()
-
-			plot = []
-			self.plotpitchtessiture(plot,
-				truth, 
-				allMpit,
-				plottitle="%s %s" % (self.v['mode'],self.params.bufsize),
-				plotmode='lines')
-			"""
-			self.plotpitchtessiture(plot,
-				truth, 
-				allMchr,
-				plottitle="%s %s" % (self.v['mode'],"%12"),
-				plotmode='lines')
-			self.plotpitchtessiture(plot,
-				truth, 
-				allMsil,
-				plottitle="%s %s" % (self.v['mode'],"sil"),
-				plotmode='lines')
-			"""
-			title = basename(self.datadir)
-			if multiplot:
-				d.append(plot)
-			else:
-				d += plot
-		outplot = "_-_".join(('pitchtessiture',title))
-		self.xmin = min(self.v['truth']) #20.
-		self.xmax = max(self.v['truth'])
-		for ext in ('ps','png','svg'): #,''):
-			self.plotplotpitchtessiture(d,
-				plottitle="".join(['Performance against MIDI Note number (',
-					title,
-					", %s" % len(self.sndlist), " samples)"]),
-				outplot=outplot,
-				extension=ext,multiplot=multiplot)
-		#d.append('beta = .25,orig(x) title \"-2 octave\"')
-		#d.append('beta = .50,orig(x) title \"-1 octave\"')
-		#d.append('beta = 1.0,orig(x) title \"original\"')
-		#d.append('beta = 2.0,orig(x) title \"+1 octave\"')
-
-	"""
-	Plot functions 
-	"""
-
-	def plotpitchtessiture(self,d,lx,ly,plottitle="",plotmode='linespoints'):
-		import Gnuplot, Gnuplot.funcutils
-		d.append(Gnuplot.Data(lx, ly, with=plotmode, title="%s" % (plottitle) ))
-
-	def plotplotpitchtessiture(self,d,plottitle='',outplot=0,extension='',multiplot=1):
-		from aubio.gnuplot import gnuplot_create
-		g = gnuplot_create(outplot=outplot,extension=extension) 
-		#g.title(plottitle)
-		#g('orig(x) = beta*x')
-		g.title(plottitle)
-		g('set yrange [50:100]')
-		# erase axis
-		g('set xrange [%f:%f]' % (self.xmin,self.xmax)) #(self.xmax - (self.xmax-self.xmin)*5./4.,self.xmax))
-		#g.plot(*d)
-		g('set border 3')
-		g('set xtics nomirror')
-		g('set ytics nomirror')
-		g('set key bottom')
-		if multiplot:
-			g('set multiplot')
-			for i in range(len(d)):
-				# plot onset detection functions
-				g('set size   1,%f' % ( 1.0/float(len(d)) ) )
-				g('set origin 0,%f' % ( 1.0*float(len(d)-i-1)/float(len(d)) ) )
-				#g.ylabel('%Correct detections')
-				g('set xrange [%f:%f]' % (self.xmin,self.xmax)) #(self.xmax - (self.xmax-self.xmin)*5./4.,self.xmax))
-				g.plot(*d[i])
-				g('unset title')
-			g('unset multiplot')
-		else:
-			g.plot(*d)
-
-
-if __name__ == "__main__":
-	import sys
-	if len(sys.argv) > 1: datapath = sys.argv[1]
-	else: print "error: a path is required"; sys.exit(1)
-	if len(sys.argv) > 2:
-		for each in sys.argv[3:-1]: print each
-	modes = ['schmitt', 'yin', 'yinfft', 'mcomb', 'fcomb']
-	#modes = ['mcomb']
-
-	params = taskparams()
-	params.bufsize = 2048 # 4096 
-	params.hopsize = 256
-	params.silence = -60.
-	params.pitchsmooth = 0 
-	params.pitchmax = 20000
-	params.pitchmin = 20
-	params.pitchyinfft = 0.95
-	benchpitch = benchpitch(datapath,params=params)
-	benchpitch.task = taskpitch
-
-	#benchpitch.titles  = [ 'mode', 'thres', 'avg', 'avgdist' ]
-	#benchpitch.formats = ["%12s" , "| %6s", "| %6s", "| %6s", "| %6s", "| %6s" ]
-	try:
-		benchpitch.run_bench(modes=modes)
-	except KeyboardInterrupt:
-		print "Interrupted by user"
-		sys.exit(1)
-
-	sys.exit(0)
Index: thon/test/bench/pitch/bench-pitch-plot-isolated
===================================================================
--- python/test/bench/pitch/bench-pitch-plot-isolated	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,63 +1,0 @@
-#! /usr/bin/python
-
-if __name__ == '__main__':
-  import sys, Gnuplot
-  from aubio.gnuplot import gnuplot_create
-  from aubio.txtfile import read_datafile
-  from aubio.plot.keyboard import draw_keyboard
-  lines = []
-  titles = []
-  for file in range(len(sys.argv)-1):
-    l = read_datafile(sys.argv[file+1])
-    notes, score = [],[]
-    for i in range(len(l)):
-      notes.append(l[i][0])
-      score.append(l[i][2])
-    lines.append(Gnuplot.Data(notes,score,
-      with='linespoints',
-      title=sys.argv[file+1].split('.')[-1]))
-    titles.append(sys.argv[file+1].split('.')[-1])
-  blacks,whites = draw_keyboard(firstnote = notes[0], lastnote = notes[-1], 
-    y0= 40, y1 = 50)
-
-  g = gnuplot_create(sys.argv[file+1].split('.')[-3],'ps')
-  #g = gnuplot_create('','')
-  #g = gnuplot_create('/tmp/test','eps')
-  g('set yrange [40:100]')
-  #g('set xrange [%f:%f]' % (notes[0],notes[-1]+60))
-  g('set size 0.5')
-  g('set key outside')
-
-  g('set border 3')
-  g('set xtics nomirror')
-  g('set ytics nomirror')
-  multiplot = 1
-  oplots = lines
-  g('set size 1,2')
-  if multiplot:
-    height = 2.
-    g('set lmargin 10')
-    #g('set rmargin 15')
-    g('set multiplot')
-    g('set yrange [50:100]')
-    g('set xrange [%f:%f]' % (notes[0],notes[-1]))
-    g('set xtics %f,12' % notes[0])
-    g('set nokey')
-    for i in range(len(oplots)):
-      g.ylabel(titles[i])
-      g('set size %f,%f' % (1.,height*.85/float(len(oplots))))
-      g('set origin 0,%f' % (height*(.15+.85*float(len(oplots)-i-1)/float(len(oplots)))))
-      g.plot(oplots[i])
-    g('set title "Raw pitch accuracy (%) against midi note numbers"')
-    g('set noxtics')
-    g('set noytics')
-    g('set size %f,%f' % (1.,.15*height))
-    g('set origin 0,%f' % 0)
-    g('set yrange [40:50]')
-    g('set xrange [%f:%f]' % (notes[0],notes[-1]))
-    g.xlabel('')
-    g.ylabel('')
-    g.plot(whites,blacks)
-    g('unset multiplot')
-  else:
-    g.plot(whites,blacks,*lines)
Index: thon/test/bench/tempo/demo-tempo
===================================================================
--- python/test/bench/tempo/demo-tempo	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,313 +1,0 @@
-#! /usr/bin/python
-
-""" this file was written by Paul Brossier 
-  it is released under the GNU/GPL license.
-"""
-
-import sys,time
-from aubio.task import taskbeat,taskparams
-from aubio.aubioclass import fvec, aubio_autocorr
-from aubio.gnuplot import gnuplot_create, gnuplot_addargs
-from aubio.aubiowrapper import *
-from math import exp,log
-
-usage = "usage: %s [options] -i soundfile" % sys.argv[0]
-
-def parse_args():
-        from optparse import OptionParser
-        parser = OptionParser(usage=usage)
-        parser.add_option("-i","--input",
-                          action="store", dest="filename", 
-                          help="input sound file")
-        parser.add_option("-n","--printframe",
-                          action="store", dest="printframe", default=-1, 
-                          help="make a plot of the n_th frame")
-        gnuplot_addargs(parser)
-        (options, args) = parser.parse_args()
-        if not options.filename: 
-                 print "no file name given\n", usage
-                 sys.exit(1)
-        return options, args
-
-def plotdata(x,y,plottitle="",**keyw):
-	import Gnuplot
-	return Gnuplot.Data(x, y, title="%s" % plottitle,**keyw)
-
-options, args = parse_args()
-filename = options.filename
-xsize = float(options.xsize)
-ysize = float(options.ysize)
-
-printframe = int(options.printframe)
-
-if options.outplot and printframe > 0: 
-  extension = options.outplot.split('.')[-1] 
-  outplot = '.'.join(options.outplot.split('.')[:-1])
-else: 
-  extension = ''
-  outplot = None
-f = gnuplot_create(outplot=outplot,extension=extension,options=options)
-
-params = taskparams()
-params.onsetmode = 'specdiff'
-task = taskbeat(filename,params=params)
-
-hopsize = params.hopsize
-bufsize = params.bufsize
-btstep = task.btstep
-winlen = task.btwinlen
-laglen = winlen/4
-step = winlen/4
-
-timesig = 0
-maxnumelem = 4
-gp = 0
-counter = 0
-flagconst = 0
-constthresh = 3.901
-g_var      = 3.901
-rp = 0
-rp1 = 0
-rp2 = 0
-g_mu = 0
-
-rayparam = 48/512.*winlen
-
-#t     = [i for i in range(hopsize)]
-#tlong = [i for i in range(hopsize*(btstep-1))]
-#tall  = [i for i in range(hopsize*btstep)]
-#a     = [0 for i in range(hopsize*btstep)]
-dfx = [i for i in range(winlen)]
-dfframe = [0 for i in range(winlen)]
-dfrev = [0 for i in range(winlen)]
-acframe = [0 for i in range(winlen)]
-
-localacf = [0 for i in range(winlen)]
-inds = [0 for i in range(maxnumelem)]
-
-acx = [i for i in range(laglen)]
-acfout  = [0 for i in range(laglen)]
-
-phwv  = [0 for i in range(2*laglen)]
-phwvx = [i for i in range(2*laglen)]
-
-dfwvnorm = exp(log(2.0)*(winlen+2.)/rayparam);
-dfwv = [exp(log(2.)*(i+1.)/rayparam)/dfwvnorm for i in range(winlen)]
-
-gwv = [exp(-.5*(j+1.-g_mu)**2/g_var**2) for j in range(laglen)]
-rwv = [(i+1.)/rayparam**2 * exp(-(i+1.)**2 / (2.*rayparam)**2)
-        for i in range(0,laglen)] 
-acf = fvec(winlen,1)
-
-nrframe = 0
-while (task.readsize == params.hopsize):
-  task()
-  #print task.pos2
-  #a[:-hopsize] = [i for i in a[-(btstep-1)*hopsize:]]
-  #a[-hopsize:] = [task.myvec.get(i,0) for i in t]
-
-  #g('set xrange [%f:%f]' % (t[0],t[-1]))
-  #time.sleep(.2)
-  if task.pos2==btstep-1:
-    nrframe += 1
-    dfframe = [task.dfframe.get(i,0) for i in range(winlen)]
-    if printframe == nrframe or printframe == -1:
-      d  = [[plotdata(range(-winlen,0),dfframe,plottitle="onset detection", with='lines')]]
-    # start beattracking_do
-    for i in range(winlen):
-      dfrev[winlen-1-i] = 0.
-      dfrev[winlen-1-i] = dfframe[i]*dfwv[i]
-    aubio_autocorr(task.dfframe(),acf()); 
-    acframe = [acf.get(i,0) for i in range(winlen)]
-    if not timesig:
-      numelem = 4
-    else:
-      numelem = timesig
-
-    old = 0
-    acfout = [0 for i in range(winlen/4)]
-    for i in range(1,laglen-1):
-      for a in range(1,numelem+1):
-        for b in range (1-a,a):
-          acfout[i] += acframe[a*(i+1)+b-1] * 1./(2.*a-1.)*rwv[i]
-          if old < acfout[i]:
-            old = acfout[i]
-            maxi = i
-    rp = max(maxi,1);
-
-    if printframe == nrframe or printframe == -1:
-      rwvs = [rwv[i]*max(acframe) for i in range(len(rwv))]
-      d += [[plotdata(acx,acfout,plottitle="comb filterbank", with='lines', axes='x1y1'),
-          plotdata([rp,rp],[1.2*old,min(acfout)],plottitle="period", with='impulses', axes='x1y1'),
-          plotdata(acx,rwvs,plottitle="L_w", with='lines', axes='x1y1')]]
-
-    # getperiod
-    inds = [0 for i in range(maxnumelem)]
-    localacf = [0 for i in range(winlen)]
-    period = 0
-    for a in range(1,4+1):
-      for b in range(1-a,a):
-        localacf[a*rp+b-1] = acframe[a*rp+b-1]
-    for i in range(numelem):
-      maxindex = 0
-      maxval = 0.0
-      for j in range(rp*(i+1)+i):
-        if localacf[j] > maxval:
-          maxval = localacf[j]
-          maxind = j
-        localacf[j] = 0
-      inds[i] = maxind
-    for i in range(numelem):
-      period += inds[i]/(i+1.)
-    period = period/numelem
-    #print "period", period
-
-    # checkstate 
-    if gp:
-      # context dependant model
-      acfout = [0 for i in range(winlen/4)]
-      old = 0
-      for i in range(laglen-1):
-        for a in range(timesig):
-          for b in range(1-a,a):
-            acfout[i] += acframe[a*(i+1)+b-1] * gwv[i]
-        if old < acfout[i]:
-          old = acfout[i]
-          maxi = i
-      gp = maxi
-    else:
-      # general model
-      gp = 0
-    #print "gp", gp
-    if printframe == nrframe or printframe == -1:
-      gwvs = [gwv[i]*max(acfout) for i in range(len(gwv))]
-      d += [[plotdata(acx,acfout,plottitle="comb filterbank", with='lines', axes='x1y1'),
-          plotdata(gp,old,plottitle="period", with='impulses', axes='x1y1'),
-          plotdata(acx,gwvs,plottitle="L_{gw}", with='lines', axes='x1y1')]]
-
-    if counter == 0:
-      # initial step
-      if abs(gp-rp) > 2.*constthresh:
-        flagstep = 1
-        counter  = 3
-      else:
-        flagstep = 0
-    #print "flagstep", flagstep
-    #print "rp2,rp1,rp", rp2,rp1,rp
-    acfw = [dfframe[i]*dfwv[i] for i in range(winlen)]
-
-    if counter == 1 and flagstep == 1:
-      # "3rd frame after flagstep set"
-      if abs(2.*rp-rp1- rp2) < constthresh:
-        flagconst = 1
-        counter = 0
-      else:
-        flagconst = 0
-        counter = 2
-    elif counter > 0:
-      counter -= 1
-
-    rp2 = rp1; rp1 = rp
-
-    if flagconst:
-      # "first run of new hypothesis"
-      gp = rp
-      g_mu = gp
-      timesig = 4 #FIXME
-      gwv = [exp(-.5*(j+1.-g_mu)**2/g_var**2) for j in range(laglen)]
-      flagconst = 0
-      bp = gp
-      phwv = [1 for i in range(2*laglen)]
-    elif timesig:
-      # "contex dependant"
-      bp = gp
-      if step > lastbeat:
-        phwv = [exp(-.5*(1.+j-step+lastbeat)**2/(bp/8.)) for j in range(2*laglen)]
-      else:
-        print "NOT using phase weighting"
-        phwv = [1 for i in range(2*laglen)]
-    else:
-      # "initial state"
-      bp = rp
-      phwv = [1 for i in range(2*laglen)]
-
-    while bp < 25:
-      print "WARNING, doubling the beat period"
-      bp *= 2
-
-    # 
-    phout = [0. for i in range(winlen)]
-
-    kmax = int(winlen/float(bp));
-
-    old = 0
-    for i in range(bp):
-      phout[i] = 0.
-      for k in range(kmax):
-        phout[i] += dfrev[i+bp*k] * phwv[i]
-      if phout[i] > old:
-        old = phout[i]
-        maxi = i
-    maxindex = maxi 
-    if (maxindex == winlen - 1): maxindex = 0
-    phase = 1 + maxindex
-    i = 1
-    beat = bp - phase
-    beats= []
-    if beat >= 0: beats.append(beat)
-    while beat+bp < step: 
-      beat += bp
-      beats.append(beat)
-    lastbeat = beat
-    #print beats,
-    #print "the lastbeat is", lastbeat
-
-    # plot all this
-    if printframe == nrframe or printframe == -1:
-      phwvs = [phwv[i]*max(phout) for i in range(len(phwv))]
-      d += [[plotdata(range(-laglen,0),phwvs[laglen:0:-1],plottitle="A_{gw}", with='lines',axes='x1y1'),
-          plotdata(range(-laglen,0),phout[laglen:0:-1],plottitle="df", with='lines'),
-          plotdata(-phase,old,plottitle="phase", with='impulses', axes='x1y1'),
-          plotdata([i for i in beats],[old for i in beats],plottitle="predicted", with='impulses')
-          ]]
-    #d += [[plotdata(dfx,dfwv,plottitle="phase weighting", with='lines', axes='x1y2'),
-    #    plotdata(dfx,dfrev,plottitle="df reverse", with='lines', axes='x1y1')]]
-    #d += [[plotdata(dfx,phout,plottitle="phase", with='lines', axes='x1y2')]]
-    #d += [[plotdata(dfx,dfwv,plottitle="phase weighting", with='lines', axes='x1y2'),
-    #    plotdata(dfx,dfrev,plottitle="df reverse", with='lines', axes='x1y1')]]
-    #d += [[plotdata(dfx,phout,plottitle="phase", with='lines', axes='x1y2')]]
-
-      f('set lmargin 4')
-      f('set rmargin 4')
-      f('set size %f,%f' % (1.0*xsize,1.0*ysize) )
-      f('set key spacing 1.3')
-      f('set multiplot')
-
-      f('set size %f,%f' % (1.0*xsize,0.33*ysize) )
-      f('set orig %f,%f' % (0.0*xsize,0.66*ysize) )
-      f('set xrange [%f:%f]' % (-winlen,0) )
-      f.title('Onset detection function')
-      f.xlabel('time (df samples)')
-      f.plot(*d[0])
-      f('set size %f,%f' % (0.5*xsize,0.33*ysize) )
-      f('set orig %f,%f' % (0.0*xsize,0.33*ysize) )
-      f('set xrange [%f:%f]' % (0,laglen) )
-      f.title('Period detection: Rayleygh weighting')
-      f.xlabel('lag (df samples)')
-      f.plot(*d[1])
-      f('set size %f,%f' % (0.5*xsize,0.33*ysize) )
-      f('set orig %f,%f' % (0.5*xsize,0.33*ysize) )
-      f('set xrange [%f:%f]' % (0,laglen) )
-      f.title('Period detection: Gaussian weighting')
-      f.xlabel('lag (df samples)')
-      f.plot(*d[2])
-      f('set size %f,%f' % (1.0*xsize,0.33*ysize) )
-      f('set orig %f,%f' % (0.0*xsize,0.00*ysize) )
-      f('set xrange [%f:%f]' % (-laglen,laglen) )
-      f.title('Phase detection and predicted beats')
-      f.xlabel('time (df samples)')
-      f.plot(*d[3])
-      f('set nomultiplot')
-    if printframe == -1: a = sys.stdin.read()
-    elif 0 < printframe and printframe < nrframe:
-      break
Index: thon/test/bench/tempo/demo-tempo-acf
===================================================================
--- python/test/bench/tempo/demo-tempo-acf	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,157 +1,0 @@
-#! /usr/bin/python
-
-""" this file was written by Paul Brossier 
-  it is released under the GNU/GPL license.
-"""
-
-import sys,time
-from aubio.task import taskbeat,taskparams
-from aubio.aubioclass import fvec, aubio_autocorr
-from aubio.gnuplot import gnuplot_create, gnuplot_addargs
-from aubio.aubiowrapper import *
-from math import exp,log
-
-usage = "usage: %s [options] -i soundfile" % sys.argv[0]
-
-def parse_args():
-        from optparse import OptionParser
-        parser = OptionParser(usage=usage)
-        parser.add_option("-i","--input",
-                          action="store", dest="filename", 
-                          help="input sound file")
-        parser.add_option("-n","--printframe",
-                          action="store", dest="printframe", default=-1, 
-                          help="make a plot of the n_th frame")
-        gnuplot_addargs(parser)
-        (options, args) = parser.parse_args()
-        if not options.filename: 
-                 print "no file name given\n", usage
-                 sys.exit(1)
-        return options, args
-
-def plotdata(x,y,plottitle="",**keyw):
-	import Gnuplot
-	return Gnuplot.Data(x, y, title="%s" % plottitle,**keyw)
-
-options, args = parse_args()
-filename = options.filename
-xsize = float(options.xsize)
-ysize = float(options.ysize)
-
-printframe = int(options.printframe)
-
-if options.outplot and printframe > 0: 
-  extension = options.outplot.split('.')[-1] 
-  outplot = '.'.join(options.outplot.split('.')[:-1])
-else: 
-  extension = ''
-  outplot = None
-f = gnuplot_create(outplot,extension,options)
-
-params = taskparams()
-params.onsetmode = 'specdiff'
-task = taskbeat(filename,params=params)
-
-hopsize = params.hopsize
-bufsize = params.bufsize
-btstep = task.btstep
-winlen = task.btwinlen
-laglen = winlen/4
-step = winlen/4
-
-timesig = 0
-maxnumelem = 4
-gp = 0
-counter = 0
-flagconst = 0
-constthresh = 3.901
-g_var      = 3.901
-rp = 0
-rp1 = 0
-rp2 = 0
-g_mu = 0
-
-rayparam = 48/512.*winlen
-
-t     = [i for i in range(hopsize)]
-#tlong = [i for i in range(hopsize*(btstep-1))]
-#tall  = [i for i in range(hopsize*btstep)]
-sig    = [0 for i in range(hopsize*btstep*4)]
-dfx = [i for i in range(winlen)]
-dfframe = [0 for i in range(winlen)]
-dfrev = [0 for i in range(winlen)]
-acframe = [0 for i in range(winlen/2)]
-
-localacf = [0 for i in range(winlen)]
-inds = [0 for i in range(maxnumelem)]
-
-acx = [i for i in range(laglen)]
-acfout  = [0 for i in range(laglen)]
-
-phwv  = [0 for i in range(2*laglen)]
-phwvx = [i for i in range(2*laglen)]
-
-dfwvnorm = exp(log(2.0)*(winlen+2.)/rayparam);
-dfwv = [exp(log(2.)*(i+1.)/rayparam)/dfwvnorm for i in range(winlen)]
-
-gwv = [exp(-.5*(j+1.-g_mu)**2/g_var**2) for j in range(laglen)]
-rwv = [(i+1.)/rayparam**2 * exp(-(i+1.)**2 / (2.*rayparam)**2)
-        for i in range(0,laglen)] 
-acf = fvec(winlen,1)
-
-nrframe = 0
-while (task.readsize == params.hopsize):
-  task()
-  #print task.pos2
-  sig[:-hopsize] = [i for i in sig[-(btstep*4-1)*hopsize:]]
-  sig[-hopsize:] = [task.myvec.get(i,0) for i in t]
-
-  #g('set xrange [%f:%f]' % (t[0],t[-1]))
-  #time.sleep(.2)
-  if task.pos2==btstep-1:
-    nrframe += 1
-    dfframe = [task.dfframe.get(i,0) for i in range(winlen)]
-    # start beattracking_do
-    for i in range(winlen):
-      dfrev[winlen-1-i] = 0.
-      dfrev[winlen-1-i] = dfframe[i]*dfwv[i]
-    aubio_autocorr(task.dfframe(),acf()); 
-    acframe = [acf.get(i,0) for i in range(winlen/2)]
-    if printframe == nrframe or printframe == -1:
-      d  = [[plotdata(range(0,btstep*hopsize*4,4),sig[0:-1:4],plottitle="input signal", with='lines')]]
-      d  += [[plotdata(range(-winlen,0),dfframe,plottitle="onset detection", with='lines')]]
-      d  += [[plotdata(range(winlen/2),acframe,plottitle="autocorrelation", with='lines')]]
-
-    # plot all this
-    if printframe == nrframe or printframe == -1:
-
-      f('set lmargin 4')
-      f('set rmargin 4')
-      f('set size %f,%f' % (1.0*xsize,1.0*ysize) )
-      f('set key spacing 1.3')
-      f('set multiplot')
-
-      f('set size %f,%f' % (1.0*xsize,0.33*ysize) )
-      f('set orig %f,%f' % (0.0*xsize,0.66*ysize) )
-      f('set xrange [%f:%f]' % (0,btstep*hopsize*4) )
-      f('set yrange [%f:%f]' % (-1.2*max(sig),1.2*max(sig)) )
-      f.title('Input signal')
-      f.xlabel('time (samples)')
-      f.plot(*d[0])
-      f('set size %f,%f' % (1.0*xsize,0.33*ysize) )
-      f('set orig %f,%f' % (0.0*xsize,0.33*ysize) )
-      f('set xrange [%f:%f]' % (-winlen,0) )
-      f('set autoscale y')
-      f.title('Onset detection function')
-      f.xlabel('time (df samples)')
-      f.plot(*d[1])
-      f('set size %f,%f' % (1.0*xsize,0.33*ysize) )
-      f('set orig %f,%f' % (0.0*xsize,0.00*ysize) )
-      f('set xrange [%f:%f]' % (0,winlen/2) )
-      f.title('Autocorrelation')
-      f.xlabel('lag (df samples)')
-      f.plot(*d[2])
-      f('set nomultiplot')
-    if printframe == -1: a = sys.stdin.read()
-    elif 0 < printframe and printframe < nrframe:
-      break
Index: thon/test/cvec.py
===================================================================
--- python/test/cvec.py	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,51 +1,0 @@
-import unittest
-
-from aubio.aubiowrapper import *
-
-buf_size = 2048
-channels = 3
-
-class cvec_test_case(unittest.TestCase):
-
-  def setUp(self):
-    self.vector = new_cvec(buf_size, channels)
-
-  def tearDown(self):
-    del_cvec(self.vector)
-
-  def test_cvec(self):
-    """ create and delete cvec """
-    pass
-
-  def test_cvec_read_norm(self):
-    """ check new cvec norm elements are set to 0. """
-    for index in range(buf_size/2+1):
-      for channel in range(channels):
-        self.assertEqual(cvec_read_norm(self.vector,channel,index),0.)
-
-  def test_cvec_read_phas(self):
-    """ check new cvec phas elements are set to 0. """
-    for index in range(buf_size/2+1):
-      for channel in range(channels):
-        self.assertEqual(cvec_read_phas(self.vector,channel,index),0.)
-
-  def test_cvec_write_norm(self):
-    """ check new cvec norm elements are set with cvec_write_norm """
-    for index in range(buf_size/2+1):
-      for channel in range(channels):
-        cvec_write_norm(self.vector,1.,channel,index)
-    for index in range(buf_size/2+1):
-      for channel in range(channels):
-        self.assertEqual(cvec_read_norm(self.vector,channel,index),1.)
-
-  def test_cvec_write_phas(self):
-    """ check new cvec phas elements are set with cvec_write_phas """
-    for index in range(buf_size/2+1):
-      for channel in range(channels):
-        cvec_write_phas(self.vector,1.,channel,index)
-    for index in range(buf_size/2+1):
-      for channel in range(channels):
-        self.assertEqual(cvec_read_phas(self.vector,channel,index),1.)
-
-if __name__ == '__main__':
-  unittest.main()
Index: thon/test/fvec.py
===================================================================
--- python/test/fvec.py	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,36 +1,0 @@
-import unittest
-
-from aubio.aubiowrapper import *
-
-buf_size = 2048
-channels = 3
-
-class fvec_test_case(unittest.TestCase):
-
-  def setUp(self):
-    self.vector = new_fvec(buf_size, channels)
-
-  def tearDown(self):
-    del_fvec(self.vector)
-
-  def test_fvec(self):
-    """ create and delete fvec """
-    pass
-
-  def test_fvec_read_sample(self):
-    """ check new fvec elements are set to 0. """
-    for index in range(buf_size):
-      for channel in range(channels):
-        self.assertEqual(fvec_read_sample(self.vector,channel,index),0.)
-
-  def test_fvec_write_sample(self):
-    """ check new fvec elements are set with fvec_write_sample """
-    for index in range(buf_size):
-      for channel in range(channels):
-        fvec_write_sample(self.vector,1.,channel,index)
-    for index in range(buf_size):
-      for channel in range(channels):
-        self.assertEqual(fvec_read_sample(self.vector,channel,index),1.)
-
-if __name__ == '__main__':
-  unittest.main()
Index: thon/test/list_missing_tests
===================================================================
--- python/test/list_missing_tests	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,30 +1,0 @@
-#! /usr/bin/python
-
-from glob import glob
-from os.path import splitext, exists
-import sys
-
-if len(sys.argv) > 1: verbose = True
-else: verbose = False
-
-cfiles = [ file.split('/')[-1] for file in glob('../../src/*.c') ]
-cfiles.sort()
-
-for cfile in cfiles: 
-  pythonfile=splitext(cfile)[0]+'.py'
-  if not exists(pythonfile):
-    print "[X] %30s" % cfile, "[ ] %30s" % pythonfile
-    #print cfile, "has NO test", pythonfile
-  elif verbose:
-    print "[X] %30s" % cfile, "[X] %30s" % pythonfile
-
-pythonfiles = [ file.split('/')[-1] for file in glob('*.py') ]
-pythonfiles.sort()
-
-for pythonfile in pythonfiles: 
-  cfile=splitext(pythonfile)[0]+'.c'
-  if not exists('../../'+cfile):
-    print "[ ] %30s" % cfile, "[X] %30s" % pythonfile
-    #print pythonfile, "has NO source", cfile
-  elif verbose:
-    print "[X] %30s" % cfile, "[X] %30s" % pythonfile
Index: thon/test/run_all_tests
===================================================================
--- python/test/run_all_tests	(revision 97525e4f81d3798352e3a0ba310d857993661a77)
+++ 	(revision )
@@ -1,15 +1,0 @@
-#! /usr/bin/python
-
-# add ${src}/python and ${src}/python/aubio/.libs to python path
-# so the script is runnable from a compiled source tree.
-import sys, os
-sys.path.append('..')
-sys.path.append(os.path.join('..','aubio','.libs'))
-
-import unittest
-
-modules_to_test = ['aubiomodule', 'fvec', 'cvec']
-
-if __name__ == '__main__':
-  for module in modules_to_test: exec('from %s import *' % module)
-  unittest.main()
Index: tests/list_missing_python_tests
===================================================================
--- tests/list_missing_python_tests	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/list_missing_python_tests	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,37 @@
+#! /usr/bin/python
+
+from glob import glob
+from os.path import splitext, exists, join, dirname
+import sys
+
+tst_dir = join(dirname(sys.argv[0]),'python')
+src_dir = join(dirname(sys.argv[0]),'..','src')
+
+if len(sys.argv) > 1: verbose = True
+else: verbose = False
+
+status = 0
+
+cfiles = [ file.split('/')[-1] for file in glob(join(src_dir,'*.c')) ]
+cfiles.sort()
+
+for cfile in cfiles: 
+  pythonfile=splitext(cfile)[0]+'.py'
+  if not exists(pythonfile):
+    print "%20s [X]" % cfile, "[ ] %s" % pythonfile
+    status = 1
+  elif verbose:
+    print "%20s [X]" % cfile, "[X] %s" % pythonfile
+
+pythonfiles = [ file.split('/')[-1] for file in glob(join(tst_dir,'*.py')) ]
+pythonfiles.sort()
+
+for pythonfile in pythonfiles: 
+  cfile=splitext(pythonfile)[0]+'.c'
+  if not exists(join(src_dir,cfile)):
+    print "%20s [ ]" % cfile, "[X] %s" % pythonfile
+    status = 1
+  elif verbose:
+    print "%20s [X]" % cfile, "[X] %s" % pythonfile
+
+sys.exit(status)
Index: tests/python/aubiomodule.py
===================================================================
--- tests/python/aubiomodule.py	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/python/aubiomodule.py	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,14 @@
+import unittest
+
+class aubiomodule_test_case(unittest.TestCase):
+
+  def test_aubio(self):
+    """ try importing aubio module """
+    import aubio 
+
+  def test_aubiowrapper(self):
+    """ try importing aubio.aubiowrapper module """
+    from aubio import aubiowrapper 
+ 
+if __name__ == '__main__':
+  unittest.main()
Index: tests/python/bench/onset/Makefile.am
===================================================================
--- tests/python/bench/onset/Makefile.am	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/python/bench/onset/Makefile.am	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,44 @@
+export BASEDIR=../../../..
+export PYTHONPATH=$(BASEDIR)/python
+export LD_LIBRARY_PATH=$(BASEDIR)/src/.libs:$(BASEDIR)/ext/.libs
+
+DETAILSOURCE = \
+	/var/tmp/Onset-Mirex2005/poly_pitched \
+	/var/tmp/Onset-Mirex2005/solo_bars_and_bells \
+	/var/tmp/Onset-Mirex2005/solo_brass \
+	/var/tmp/Onset-Mirex2005/solo_drums \
+	/var/tmp/Onset-Mirex2005/solo_plucked_strings \
+	/var/tmp/Onset-Mirex2005/solo_singing_voice \
+	/var/tmp/Onset-Mirex2005/solo_sustained_strings \
+	/var/tmp/Onset-Mirex2005/solo_winds \
+	/var/tmp/Onset-Mirex2005/complex
+
+SOURCE = /var/tmp/Onset-Mirex2005
+
+TESTSOURCE = \
+	/var/tmp/Onset-Mirex2005/solo_bars_and_bells \
+	/var/tmp/Onset-Mirex2005/solo_winds \
+	/archives/samples/DB/PercussivePhrases/CM18/Samba_Audio
+
+test-aubiocut:            $(patsubst %, %.aubiocut,    $(TESTSOURCE))
+test-aubiodelay:          $(patsubst %, %.aubiodelay,  $(TESTSOURCE))
+test-aubiowindow:         $(patsubst %, %.aubiowindow, $(TESTSOURCE))
+
+final-aubiocut:           $(patsubst %, %.aubiocut,    $(DETAILSOURCE) $(SOURCE))
+final-aubiodelay:         $(patsubst %, %.aubiodelay,  $(SOURCE))
+final-aubiowindow:        $(patsubst %, %.aubiowindow, $(SOURCE))
+
+%.aubiocut: %
+	rm -f `basename $@`
+	./bench-onset $< | tee `basename $@`
+	-diff `basename $@`.ref `basename $@`
+
+%.aubiodelay: %
+	rm -f `basename $@`
+	./bench-delay $< | tee `basename $@`
+	-diff `basename $@`.ref `basename $@`
+
+%.aubiowindow: %
+	rm -f `basename $@`
+	./bench-window $< | tee `basename $@`
+	-diff `basename $@`.ref `basename $@`
Index: tests/python/bench/onset/bench-delay
===================================================================
--- tests/python/bench/onset/bench-delay	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/python/bench/onset/bench-delay	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,62 @@
+#! /usr/bin/python
+
+from aubio.bench.onset import benchonset
+from aubio.task.onset import taskonset
+from aubio.task.params import taskparams
+
+class mybenchonset(benchonset):
+
+	def run_bench(self,modes=['dual'],thresholds=[0.5]):
+		from os.path import dirname,basename
+		self.thresholds = thresholds
+		self.pretty_titles()
+
+		for mode in modes:
+			d = []
+			self.params.onsetmode = mode
+			self.params.localmin = True
+			self.params.delay = 1. 
+			self.params.threshold = thresholds[0]
+			#
+			self.params.localmin = False 
+			self.params.delay = 0. 
+			self.dir_eval_print()
+			self.plotdiffs(d,plottitle="Causal")
+			#
+			self.params.localmin = True
+			self.params.delay = 0. 
+			self.dir_eval_print()
+			self.plotdiffs(d,plottitle="Local min")
+
+			self.params.localmin = False 
+			self.params.delay = 6. 
+			self.dir_eval_print()
+			self.plotdiffs(d,plottitle="Fixed delay")
+
+			#self.plotplotdiffs(d)
+			outplot = "_-_".join(("delay",mode,basename(self.datadir) ))
+			for ext in ("png","svg","ps"):
+				self.plotplotdiffs(d,outplot=outplot,extension=ext)
+
+if __name__ == "__main__":
+	import sys
+	if len(sys.argv) > 1: datapath = sys.argv[1]
+	else: print "ERR: a path is required"; sys.exit(1)
+	modes = ['complex', 'energy', 'phase', 'hfc', 'specdiff', 'kl', 'mkl', 'dual']
+	#thresholds = [ 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2]
+	#modes = [ 'hfc' ]
+	thresholds = [0.5]
+
+	#datapath = "%s%s" % (DATADIR,'/onset/DB/*/')
+	respath = '/var/tmp/DB-testings'
+
+	benchonset = mybenchonset(datapath,respath,checkres=True,checkanno=True)
+	benchonset.params = taskparams()
+	benchonset.task = taskonset
+	benchonset.valuesdict = {}
+
+	try:
+		#benchonset.auto_learn2(modes=modes)
+		benchonset.run_bench(modes=modes,thresholds=thresholds)
+	except KeyboardInterrupt:
+		sys.exit(1)
Index: tests/python/bench/onset/bench-onset
===================================================================
--- tests/python/bench/onset/bench-onset	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/python/bench/onset/bench-onset	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,68 @@
+#! /usr/bin/python
+
+from aubio.task import *
+
+from aubio.bench.onset import mmean, stdev, benchonset
+
+class mybenchonset(benchonset):
+
+	def run_bench(self,modes=['dual'],thresholds=[0.5]):
+		from os.path import dirname,basename
+		self.thresholds = thresholds
+		self.pretty_titles()
+		d,e,f,g = [],[],[],[]
+		for mode in modes:
+			self.vlist = []
+			self.params.onsetmode = mode
+			#self.params.localmin = True
+
+			for threshold in self.thresholds:
+				self.params.threshold = threshold
+				self.dir_eval_print()
+				self.vlist.append(self.v)
+			self.plotroc(d)
+			self.plotfmeas(e)
+			self.plotpr(f)
+			#self.plothistcat(g)
+
+
+
+		#self.plotplotroc(d)
+		#self.plotplotfmeas(e)
+		#self.plotplotpr(f)
+		outplot = basename(self.datadir)
+		for ext in ("png","svg","ps"):
+			self.plotplotroc(d,outplot=outplot,extension=ext)
+			self.plotplotfmeas(e,outplot=outplot,extension=ext)
+			self.plotplotpr(f,outplot=outplot,extension=ext)
+			#self.plotplothistcat(g,outplot=outplot,extension=ext)
+
+if __name__ == "__main__":
+	import sys
+	if len(sys.argv) > 1: datapath = sys.argv[1]
+	else: print "ERR: a path is required"; sys.exit(1)
+	modes = ['complex', 'energy', 'phase', 'hfc', 'specdiff', 'kl', 'mkl', 'dual']
+	thresholds = [ 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2]
+	#modes = [ 'hfc' ]
+	#thresholds = [0.5]
+
+	#datapath = "%s%s" % (DATADIR,'/onset/DB/*/')
+	respath = '/var/tmp/DB-testings'
+
+	benchonset = mybenchonset(datapath,respath,checkres=True,checkanno=True)
+	benchonset.params = taskparams()
+	benchonset.params.dcthreshold = -1.
+	benchonset.params.silence = -100.
+	benchonset.params.delay = 5. 
+	benchonset.params.bufsize = 1024 
+	benchonset.params.hopsize = 256 
+	benchonset.params.step = float(benchonset.params.hopsize)/float(benchonset.params.samplerate)
+	benchonset.params.mintol = 4.1 
+	benchonset.task = taskonset
+	benchonset.valuesdict = {}
+
+	try:
+		#benchonset.auto_learn2(modes=modes)
+		benchonset.run_bench(modes=modes,thresholds=thresholds)
+	except KeyboardInterrupt:
+		sys.exit(1)
Index: tests/python/bench/onset/bench-window
===================================================================
--- tests/python/bench/onset/bench-window	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/python/bench/onset/bench-window	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,59 @@
+#! /usr/bin/python
+
+from aubio.bench.onset import benchonset
+from aubio.task.onset import taskonset
+from aubio.task.params import taskparams
+
+class mybenchonset(benchonset):
+
+	def run_bench(self,modes=['dual'],thresholds=[0.5]):
+		from os.path import dirname,basename
+		self.thresholds = thresholds
+		self.pretty_titles()
+
+		for mode in modes:
+
+			self.params.onsetmode = mode
+			self.params.localmin = True
+			self.params.delay = 1. 
+			self.params.threshold = thresholds[0]
+			self.params.localmin = False 
+			#
+			for delay in (0., 4.):
+				d = []
+				self.params.delay = delay 
+				for buf in (2048, 1024, 512):
+					for hop in (buf/2, buf/4):
+						self.params.bufsize = buf 
+						self.params.hopsize = hop 
+						self.params.step = float(self.params.hopsize)/float(self.params.samplerate)
+						self.dir_eval_print()
+						self.plotdiffs(d,plottitle="%s %s" % (buf,hop))
+				#plotplotdiffs(d)
+				outplot = "_-_".join(("window",mode,"delay-%s" % int(delay),
+					basename(self.datadir) ))
+				for ext in ("png","svg","ps"):
+					self.plotplotdiffs(d,outplot=outplot,extension=ext)
+
+if __name__ == "__main__":
+	import sys
+	if len(sys.argv) > 1: datapath = sys.argv[1]
+	else: print "ERR: a path is required"; sys.exit(1)
+	modes = ['complex', 'energy', 'phase', 'hfc', 'specdiff', 'kl', 'mkl', 'dual']
+	#thresholds = [ 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2]
+	#modes = [ 'hfc' ]
+	thresholds = [0.5]
+
+	#datapath = "%s%s" % (DATADIR,'/onset/DB/*/')
+	respath = '/var/tmp/DB-testings'
+
+	benchonset = mybenchonset(datapath,respath,checkres=True,checkanno=True)
+	benchonset.params = taskparams()
+	benchonset.task = taskonset
+	benchonset.valuesdict = {}
+
+	try:
+		#benchonset.auto_learn2(modes=modes)
+		benchonset.run_bench(modes=modes,thresholds=thresholds)
+	except KeyboardInterrupt:
+		sys.exit(1)
Index: tests/python/bench/pitch/Makefile.am
===================================================================
--- tests/python/bench/pitch/Makefile.am	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/python/bench/pitch/Makefile.am	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,59 @@
+export AUBIODIR=../../../..
+export PYTHONPATH=$(AUBIODIR)/python
+export LD_LIBRARY_PATH=$(AUBIODIR)/src/.libs:$(AUBIODIR)/ext/.libs
+
+CP=cp -a
+
+SOURCE = \
+	$(BASEDIR)/isolated/vibraphone \
+	$(BASEDIR)/isolated/clavinet \
+	$(BASEDIR)/isolated/elecguitar \
+	$(BASEDIR)/isolated/piano \
+	$(BASEDIR)/isolated/rhodes \
+	$(BASEDIR)/isolated
+
+
+MONOSOURCE = \
+	$(BASEDIR)/monophonic/Mirex04/daisy \
+	$(BASEDIR)/monophonic/Mirex04/midi \
+	$(BASEDIR)/monophonic/Mirex04/jazz \
+	$(BASEDIR)/monophonic/Mirex04/pop \
+	$(BASEDIR)/monophonic/Mirex04/opera \
+	$(BASEDIR)/monophonic/Mirex04
+
+POLYSOURCE = \
+	$(BASEDIR)/polyphonic/Mirex04/daisy \
+	$(BASEDIR)/polyphonic/Mirex04/midi \
+	$(BASEDIR)/polyphonic/Mirex04/jazz \
+	$(BASEDIR)/polyphonic/Mirex04/pop \
+	$(BASEDIR)/polyphonic/Mirex04/opera \
+	$(BASEDIR)/polyphonic/Mirex04
+
+test-aubiopitch-isolated:    $(patsubst %, %.aubiopitch-isolated, $(SOURCE))
+test-aubiopitch-monophonic:  $(patsubst %, %.aubiopitch-monophonic, $(MONOSOURCE))
+test-aubiopitch-polyphonic:  $(patsubst %, %.aubiopitch-polyphonic, $(POLYSOURCE))
+
+plotpitch:
+	../../../aubiopitch -m fcomb,mcomb,yinfft,yin,schmitt -i jazz2REF.wav -p -t 0.2 -l 100 -M 600 -O jazz2REF.ps
+	../../../aubiopitch -m fcomb,mcomb,yinfft,yin,schmitt -p -t 0.2 -l 300 -M 900 -i opera_fem2REF.wav -O opera_fem2REF.ps
+
+timings:
+	./bench-timings $(BASEDIR)/polyphonic/Mirex04/opera
+
+%.aubiopitch-isolated: %
+	$(CP) isolated/`basename $@` isolated/`basename $@`.old
+	./bench-pitch-isolated $< | tee isolated/`basename $@`
+	-diff isolated/`basename $@`.old isolated/`basename $@`
+	-diff isolated/`basename $@`.ref isolated/`basename $@`
+
+%.aubiopitch-monophonic: %
+	$(CP) monophonic/`basename $@` monophonic/`basename $@`.old
+	./bench-pitch-monophonic $< | tee monophonic/`basename $@`
+	-diff monophonic/`basename $@`.ref monophonic/`basename $@`
+	-diff monophonic/`basename $@`.old monophonic/`basename $@`
+
+%.aubiopitch-polyphonic: %
+	$(CP) polyphonic/`basename $@` polyphonic/`basename $@`.old
+	./bench-pitch-polyphonic $< | tee polyphonic/`basename $@`
+	-diff polyphonic/`basename $@`.ref polyphonic/`basename $@`
+	-diff polyphonic/`basename $@`.old polyphonic/`basename $@`
Index: tests/python/bench/pitch/bench-pitch-isolated
===================================================================
--- tests/python/bench/pitch/bench-pitch-isolated	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/python/bench/pitch/bench-pitch-isolated	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,198 @@
+#! /usr/bin/python
+
+from aubio.bench.node import *
+from aubio.task import *
+
+class benchpitch(bench):
+	
+	""" list of values to store per file """
+	valuenames = ['mode']
+	""" list of lists to store per file """
+	valuelists = ['truth', 'osil', 'esil', 'opit', 'epit', 'echr', 
+               'Msil', 'Mpit', 'Mchr',
+	       'TotalPit', 'TotalPit', 'TotalChr' ]
+	""" list of values to print per dir """
+	printnames_total = [ 'mode', 'MinPit', 'MaxPit', 'TotalSil', 'TotalPit', 'TotalChr']
+	printnames_notes = [ 'mode', 'Note', 'Sil', 'Pit', 'Chr']
+	printnames = printnames_notes 
+
+	""" per dir """
+	formats = {'mode': "%12s" , 
+		'truth': "%s",
+		'osil': "%s", 'esil': "%s", 
+		'opit': "%s", 'epit': "%s", 'echr': "%s",
+    'Note': "%s", 'Sil': "%s", 'Chr': "%s", 'Pit': "%s",
+		'TotalPit': "%s", 'TotalSil': "%s", 'TotalChr': "%s",
+		'MinPit': "%s", 'MaxPit': "%s",
+		'Msil': "%s", 'Mpit': "%s", 'Mchr': "%s"}
+
+	def dir_eval(self):
+		""" evaluate statistical data over the directory """
+		v = self.v
+		v['mode']      = self.params.pitchmode
+
+	def file_exec(self,input,output):
+		filetask = self.task(input,params=self.params)
+		computed_data = filetask.compute_all()
+ 		osil, esil, opit, epit, echr = filetask.eval(computed_data,tol=0.5)
+		self.v['truth'].append(int(filetask.truth))
+		assert opit > 0
+		
+		self.v['osil'].append(osil)
+		self.v['esil'].append(esil)
+		self.v['opit'].append(opit)
+		self.v['epit'].append(epit)
+		self.v['echr'].append(echr)
+
+		self.v['Msil'].append(esil/float(osil)*100.)
+		self.v['Mpit'].append(epit/float(opit)*100.)
+		self.v['Mchr'].append(echr/float(opit)*100.)
+		#print results#, computed_data
+		#print input, results, results - float(input.split('.')[-2])
+			
+	def run_bench(self,modes=['schmitt'],multiplot=0):
+		from os.path import basename
+		self.modes = modes
+		self.pretty_titles()
+		d = []
+		for mode in self.modes:
+			self.params.pitchmode = mode
+			self.dir_exec()
+			self.dir_eval()
+			truth   = [i for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
+			allOsil = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
+			allEsil = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
+			allOpit = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
+			allEpit = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
+			allEchr = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
+			allMsil = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
+			allMpit = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
+			allMchr = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
+			for i in range(len(self.v['truth'])):
+				allOsil[self.v['truth'][i]-min(self.v['truth'])] += self.v['osil'][i]
+				allEsil[self.v['truth'][i]-min(self.v['truth'])] += self.v['esil'][i]
+				allOpit[self.v['truth'][i]-min(self.v['truth'])] += self.v['opit'][i]
+				allEpit[self.v['truth'][i]-min(self.v['truth'])] += self.v['epit'][i]
+				allEchr[self.v['truth'][i]-min(self.v['truth'])] += self.v['echr'][i]
+			for i in range(len(truth)):
+				allOsil[i] = max(1,allOsil[i])
+				allOpit[i] = max(1,allOpit[i])
+				allMsil[i] = allEsil[i]/float(allOsil[i])*100.
+				allMpit[i] = allEpit[i]/float(allOpit[i])*100.
+				allMchr[i] = allEchr[i]/float(allOpit[i])*100.
+				self.v['Sil'], self.v['Pit'], self.v['Chr'] = allMsil[i], allMpit[i], allMchr[i]
+				self.v['Note'] = truth[i]
+				#self.printnames = self.printnames_notes
+				self.pretty_print()
+			self.v['TotalSil'] = sum(allMsil)/len(truth)
+			self.v['TotalPit'] = sum(allMpit)/len(truth)
+			self.v['TotalChr'] = sum(allMchr)/len(truth)
+			self.v['MinPit'] = min(truth) 
+			self.v['MaxPit'] = max(truth) 
+			#self.printnames = self.printnames_total
+			#self.pretty_print()
+
+			plot = []
+			self.plotpitchtessiture(plot,
+				truth, 
+				allMpit,
+				plottitle="%s %s" % (self.v['mode'],self.params.bufsize),
+				plotmode='lines')
+			"""
+			self.plotpitchtessiture(plot,
+				truth, 
+				allMchr,
+				plottitle="%s %s" % (self.v['mode'],"%12"),
+				plotmode='lines')
+			self.plotpitchtessiture(plot,
+				truth, 
+				allMsil,
+				plottitle="%s %s" % (self.v['mode'],"sil"),
+				plotmode='lines')
+			"""
+			title = basename(self.datadir)
+			if multiplot:
+				d.append(plot)
+			else:
+				d += plot
+		outplot = "_-_".join(('pitchtessiture',title))
+		self.xmin = min(self.v['truth']) #20.
+		self.xmax = max(self.v['truth'])
+		for ext in ('ps','png','svg'): #,''):
+			self.plotplotpitchtessiture(d,
+				plottitle="".join(['Performance against MIDI Note number (',
+					title,
+					", %s" % len(self.sndlist), " samples)"]),
+				outplot=outplot,
+				extension=ext,multiplot=multiplot)
+		#d.append('beta = .25,orig(x) title \"-2 octave\"')
+		#d.append('beta = .50,orig(x) title \"-1 octave\"')
+		#d.append('beta = 1.0,orig(x) title \"original\"')
+		#d.append('beta = 2.0,orig(x) title \"+1 octave\"')
+
+	"""
+	Plot functions 
+	"""
+
+	def plotpitchtessiture(self,d,lx,ly,plottitle="",plotmode='linespoints'):
+		import Gnuplot, Gnuplot.funcutils
+		d.append(Gnuplot.Data(lx, ly, with=plotmode, title="%s" % (plottitle) ))
+
+	def plotplotpitchtessiture(self,d,plottitle='',outplot=0,extension='',multiplot=1):
+		from aubio.gnuplot import gnuplot_create
+		g = gnuplot_create(outplot=outplot,extension=extension) 
+		#g.title(plottitle)
+		#g('orig(x) = beta*x')
+		g.title(plottitle)
+		g('set yrange [50:100]')
+		# erase axis
+		g('set xrange [%f:%f]' % (self.xmin,self.xmax)) #(self.xmax - (self.xmax-self.xmin)*5./4.,self.xmax))
+		#g.plot(*d)
+		g('set border 3')
+		g('set xtics nomirror')
+		g('set ytics nomirror')
+		g('set key bottom')
+		if multiplot:
+			g('set multiplot')
+			for i in range(len(d)):
+				# plot onset detection functions
+				g('set size   1,%f' % ( 1.0/float(len(d)) ) )
+				g('set origin 0,%f' % ( 1.0*float(len(d)-i-1)/float(len(d)) ) )
+				#g.ylabel('%Correct detections')
+				g('set xrange [%f:%f]' % (self.xmin,self.xmax)) #(self.xmax - (self.xmax-self.xmin)*5./4.,self.xmax))
+				g.plot(*d[i])
+				g('unset title')
+			g('unset multiplot')
+		else:
+			g.plot(*d)
+
+
+if __name__ == "__main__":
+	import sys
+	if len(sys.argv) > 1: datapath = sys.argv[1]
+	else: print "error: a path is required"; sys.exit(1)
+	if len(sys.argv) > 2:
+		for each in sys.argv[3:-1]: print each
+	modes = ['schmitt', 'yin', 'yinfft', 'mcomb', 'fcomb']
+	#modes = ['mcomb']
+
+	params = taskparams()
+	params.bufsize = 2048 # 4096 
+	params.hopsize = 256
+	params.silence = -60.
+	params.pitchsmooth = 0 
+	params.pitchmax = 20000
+	params.pitchmin = 20
+	params.pitchyinfft = 0.95
+	benchpitch = benchpitch(datapath,params=params)
+	benchpitch.task = taskpitch
+
+	#benchpitch.titles  = [ 'mode', 'thres', 'avg', 'avgdist' ]
+	#benchpitch.formats = ["%12s" , "| %6s", "| %6s", "| %6s", "| %6s", "| %6s" ]
+	try:
+		benchpitch.run_bench(modes=modes)
+	except KeyboardInterrupt:
+		print "Interrupted by user"
+		sys.exit(1)
+
+	sys.exit(0)
Index: tests/python/bench/pitch/bench-pitch-plot-isolated
===================================================================
--- tests/python/bench/pitch/bench-pitch-plot-isolated	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/python/bench/pitch/bench-pitch-plot-isolated	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,63 @@
+#! /usr/bin/python
+
+if __name__ == '__main__':
+  import sys, Gnuplot
+  from aubio.gnuplot import gnuplot_create
+  from aubio.txtfile import read_datafile
+  from aubio.plot.keyboard import draw_keyboard
+  lines = []
+  titles = []
+  for file in range(len(sys.argv)-1):
+    l = read_datafile(sys.argv[file+1])
+    notes, score = [],[]
+    for i in range(len(l)):
+      notes.append(l[i][0])
+      score.append(l[i][2])
+    lines.append(Gnuplot.Data(notes,score,
+      with='linespoints',
+      title=sys.argv[file+1].split('.')[-1]))
+    titles.append(sys.argv[file+1].split('.')[-1])
+  blacks,whites = draw_keyboard(firstnote = notes[0], lastnote = notes[-1], 
+    y0= 40, y1 = 50)
+
+  g = gnuplot_create(sys.argv[file+1].split('.')[-3],'ps')
+  #g = gnuplot_create('','')
+  #g = gnuplot_create('/tmp/test','eps')
+  g('set yrange [40:100]')
+  #g('set xrange [%f:%f]' % (notes[0],notes[-1]+60))
+  g('set size 0.5')
+  g('set key outside')
+
+  g('set border 3')
+  g('set xtics nomirror')
+  g('set ytics nomirror')
+  multiplot = 1
+  oplots = lines
+  g('set size 1,2')
+  if multiplot:
+    height = 2.
+    g('set lmargin 10')
+    #g('set rmargin 15')
+    g('set multiplot')
+    g('set yrange [50:100]')
+    g('set xrange [%f:%f]' % (notes[0],notes[-1]))
+    g('set xtics %f,12' % notes[0])
+    g('set nokey')
+    for i in range(len(oplots)):
+      g.ylabel(titles[i])
+      g('set size %f,%f' % (1.,height*.85/float(len(oplots))))
+      g('set origin 0,%f' % (height*(.15+.85*float(len(oplots)-i-1)/float(len(oplots)))))
+      g.plot(oplots[i])
+    g('set title "Raw pitch accuracy (%) against midi note numbers"')
+    g('set noxtics')
+    g('set noytics')
+    g('set size %f,%f' % (1.,.15*height))
+    g('set origin 0,%f' % 0)
+    g('set yrange [40:50]')
+    g('set xrange [%f:%f]' % (notes[0],notes[-1]))
+    g.xlabel('')
+    g.ylabel('')
+    g.plot(whites,blacks)
+    g('unset multiplot')
+  else:
+    g.plot(whites,blacks,*lines)
Index: tests/python/bench/tempo/demo-tempo
===================================================================
--- tests/python/bench/tempo/demo-tempo	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/python/bench/tempo/demo-tempo	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,313 @@
+#! /usr/bin/python
+
+""" this file was written by Paul Brossier 
+  it is released under the GNU/GPL license.
+"""
+
+import sys,time
+from aubio.task import taskbeat,taskparams
+from aubio.aubioclass import fvec, aubio_autocorr
+from aubio.gnuplot import gnuplot_create, gnuplot_addargs
+from aubio.aubiowrapper import *
+from math import exp,log
+
+usage = "usage: %s [options] -i soundfile" % sys.argv[0]
+
+def parse_args():
+        from optparse import OptionParser
+        parser = OptionParser(usage=usage)
+        parser.add_option("-i","--input",
+                          action="store", dest="filename", 
+                          help="input sound file")
+        parser.add_option("-n","--printframe",
+                          action="store", dest="printframe", default=-1, 
+                          help="make a plot of the n_th frame")
+        gnuplot_addargs(parser)
+        (options, args) = parser.parse_args()
+        if not options.filename: 
+                 print "no file name given\n", usage
+                 sys.exit(1)
+        return options, args
+
+def plotdata(x,y,plottitle="",**keyw):
+	import Gnuplot
+	return Gnuplot.Data(x, y, title="%s" % plottitle,**keyw)
+
+options, args = parse_args()
+filename = options.filename
+xsize = float(options.xsize)
+ysize = float(options.ysize)
+
+printframe = int(options.printframe)
+
+if options.outplot and printframe > 0: 
+  extension = options.outplot.split('.')[-1] 
+  outplot = '.'.join(options.outplot.split('.')[:-1])
+else: 
+  extension = ''
+  outplot = None
+f = gnuplot_create(outplot=outplot,extension=extension,options=options)
+
+params = taskparams()
+params.onsetmode = 'specdiff'
+task = taskbeat(filename,params=params)
+
+hopsize = params.hopsize
+bufsize = params.bufsize
+btstep = task.btstep
+winlen = task.btwinlen
+laglen = winlen/4
+step = winlen/4
+
+timesig = 0
+maxnumelem = 4
+gp = 0
+counter = 0
+flagconst = 0
+constthresh = 3.901
+g_var      = 3.901
+rp = 0
+rp1 = 0
+rp2 = 0
+g_mu = 0
+
+rayparam = 48/512.*winlen
+
+#t     = [i for i in range(hopsize)]
+#tlong = [i for i in range(hopsize*(btstep-1))]
+#tall  = [i for i in range(hopsize*btstep)]
+#a     = [0 for i in range(hopsize*btstep)]
+dfx = [i for i in range(winlen)]
+dfframe = [0 for i in range(winlen)]
+dfrev = [0 for i in range(winlen)]
+acframe = [0 for i in range(winlen)]
+
+localacf = [0 for i in range(winlen)]
+inds = [0 for i in range(maxnumelem)]
+
+acx = [i for i in range(laglen)]
+acfout  = [0 for i in range(laglen)]
+
+phwv  = [0 for i in range(2*laglen)]
+phwvx = [i for i in range(2*laglen)]
+
+dfwvnorm = exp(log(2.0)*(winlen+2.)/rayparam);
+dfwv = [exp(log(2.)*(i+1.)/rayparam)/dfwvnorm for i in range(winlen)]
+
+gwv = [exp(-.5*(j+1.-g_mu)**2/g_var**2) for j in range(laglen)]
+rwv = [(i+1.)/rayparam**2 * exp(-(i+1.)**2 / (2.*rayparam)**2)
+        for i in range(0,laglen)] 
+acf = fvec(winlen,1)
+
+nrframe = 0
+while (task.readsize == params.hopsize):
+  task()
+  #print task.pos2
+  #a[:-hopsize] = [i for i in a[-(btstep-1)*hopsize:]]
+  #a[-hopsize:] = [task.myvec.get(i,0) for i in t]
+
+  #g('set xrange [%f:%f]' % (t[0],t[-1]))
+  #time.sleep(.2)
+  if task.pos2==btstep-1:
+    nrframe += 1
+    dfframe = [task.dfframe.get(i,0) for i in range(winlen)]
+    if printframe == nrframe or printframe == -1:
+      d  = [[plotdata(range(-winlen,0),dfframe,plottitle="onset detection", with='lines')]]
+    # start beattracking_do
+    for i in range(winlen):
+      dfrev[winlen-1-i] = 0.
+      dfrev[winlen-1-i] = dfframe[i]*dfwv[i]
+    aubio_autocorr(task.dfframe(),acf()); 
+    acframe = [acf.get(i,0) for i in range(winlen)]
+    if not timesig:
+      numelem = 4
+    else:
+      numelem = timesig
+
+    old = 0
+    acfout = [0 for i in range(winlen/4)]
+    for i in range(1,laglen-1):
+      for a in range(1,numelem+1):
+        for b in range (1-a,a):
+          acfout[i] += acframe[a*(i+1)+b-1] * 1./(2.*a-1.)*rwv[i]
+          if old < acfout[i]:
+            old = acfout[i]
+            maxi = i
+    rp = max(maxi,1);
+
+    if printframe == nrframe or printframe == -1:
+      rwvs = [rwv[i]*max(acframe) for i in range(len(rwv))]
+      d += [[plotdata(acx,acfout,plottitle="comb filterbank", with='lines', axes='x1y1'),
+          plotdata([rp,rp],[1.2*old,min(acfout)],plottitle="period", with='impulses', axes='x1y1'),
+          plotdata(acx,rwvs,plottitle="L_w", with='lines', axes='x1y1')]]
+
+    # getperiod
+    inds = [0 for i in range(maxnumelem)]
+    localacf = [0 for i in range(winlen)]
+    period = 0
+    for a in range(1,4+1):
+      for b in range(1-a,a):
+        localacf[a*rp+b-1] = acframe[a*rp+b-1]
+    for i in range(numelem):
+      maxindex = 0
+      maxval = 0.0
+      for j in range(rp*(i+1)+i):
+        if localacf[j] > maxval:
+          maxval = localacf[j]
+          maxind = j
+        localacf[j] = 0
+      inds[i] = maxind
+    for i in range(numelem):
+      period += inds[i]/(i+1.)
+    period = period/numelem
+    #print "period", period
+
+    # checkstate 
+    if gp:
+      # context dependant model
+      acfout = [0 for i in range(winlen/4)]
+      old = 0
+      for i in range(laglen-1):
+        for a in range(timesig):
+          for b in range(1-a,a):
+            acfout[i] += acframe[a*(i+1)+b-1] * gwv[i]
+        if old < acfout[i]:
+          old = acfout[i]
+          maxi = i
+      gp = maxi
+    else:
+      # general model
+      gp = 0
+    #print "gp", gp
+    if printframe == nrframe or printframe == -1:
+      gwvs = [gwv[i]*max(acfout) for i in range(len(gwv))]
+      d += [[plotdata(acx,acfout,plottitle="comb filterbank", with='lines', axes='x1y1'),
+          plotdata(gp,old,plottitle="period", with='impulses', axes='x1y1'),
+          plotdata(acx,gwvs,plottitle="L_{gw}", with='lines', axes='x1y1')]]
+
+    if counter == 0:
+      # initial step
+      if abs(gp-rp) > 2.*constthresh:
+        flagstep = 1
+        counter  = 3
+      else:
+        flagstep = 0
+    #print "flagstep", flagstep
+    #print "rp2,rp1,rp", rp2,rp1,rp
+    acfw = [dfframe[i]*dfwv[i] for i in range(winlen)]
+
+    if counter == 1 and flagstep == 1:
+      # "3rd frame after flagstep set"
+      if abs(2.*rp-rp1- rp2) < constthresh:
+        flagconst = 1
+        counter = 0
+      else:
+        flagconst = 0
+        counter = 2
+    elif counter > 0:
+      counter -= 1
+
+    rp2 = rp1; rp1 = rp
+
+    if flagconst:
+      # "first run of new hypothesis"
+      gp = rp
+      g_mu = gp
+      timesig = 4 #FIXME
+      gwv = [exp(-.5*(j+1.-g_mu)**2/g_var**2) for j in range(laglen)]
+      flagconst = 0
+      bp = gp
+      phwv = [1 for i in range(2*laglen)]
+    elif timesig:
+      # "contex dependant"
+      bp = gp
+      if step > lastbeat:
+        phwv = [exp(-.5*(1.+j-step+lastbeat)**2/(bp/8.)) for j in range(2*laglen)]
+      else:
+        print "NOT using phase weighting"
+        phwv = [1 for i in range(2*laglen)]
+    else:
+      # "initial state"
+      bp = rp
+      phwv = [1 for i in range(2*laglen)]
+
+    while bp < 25:
+      print "WARNING, doubling the beat period"
+      bp *= 2
+
+    # 
+    phout = [0. for i in range(winlen)]
+
+    kmax = int(winlen/float(bp));
+
+    old = 0
+    for i in range(bp):
+      phout[i] = 0.
+      for k in range(kmax):
+        phout[i] += dfrev[i+bp*k] * phwv[i]
+      if phout[i] > old:
+        old = phout[i]
+        maxi = i
+    maxindex = maxi 
+    if (maxindex == winlen - 1): maxindex = 0
+    phase = 1 + maxindex
+    i = 1
+    beat = bp - phase
+    beats= []
+    if beat >= 0: beats.append(beat)
+    while beat+bp < step: 
+      beat += bp
+      beats.append(beat)
+    lastbeat = beat
+    #print beats,
+    #print "the lastbeat is", lastbeat
+
+    # plot all this
+    if printframe == nrframe or printframe == -1:
+      phwvs = [phwv[i]*max(phout) for i in range(len(phwv))]
+      d += [[plotdata(range(-laglen,0),phwvs[laglen:0:-1],plottitle="A_{gw}", with='lines',axes='x1y1'),
+          plotdata(range(-laglen,0),phout[laglen:0:-1],plottitle="df", with='lines'),
+          plotdata(-phase,old,plottitle="phase", with='impulses', axes='x1y1'),
+          plotdata([i for i in beats],[old for i in beats],plottitle="predicted", with='impulses')
+          ]]
+    #d += [[plotdata(dfx,dfwv,plottitle="phase weighting", with='lines', axes='x1y2'),
+    #    plotdata(dfx,dfrev,plottitle="df reverse", with='lines', axes='x1y1')]]
+    #d += [[plotdata(dfx,phout,plottitle="phase", with='lines', axes='x1y2')]]
+    #d += [[plotdata(dfx,dfwv,plottitle="phase weighting", with='lines', axes='x1y2'),
+    #    plotdata(dfx,dfrev,plottitle="df reverse", with='lines', axes='x1y1')]]
+    #d += [[plotdata(dfx,phout,plottitle="phase", with='lines', axes='x1y2')]]
+
+      f('set lmargin 4')
+      f('set rmargin 4')
+      f('set size %f,%f' % (1.0*xsize,1.0*ysize) )
+      f('set key spacing 1.3')
+      f('set multiplot')
+
+      f('set size %f,%f' % (1.0*xsize,0.33*ysize) )
+      f('set orig %f,%f' % (0.0*xsize,0.66*ysize) )
+      f('set xrange [%f:%f]' % (-winlen,0) )
+      f.title('Onset detection function')
+      f.xlabel('time (df samples)')
+      f.plot(*d[0])
+      f('set size %f,%f' % (0.5*xsize,0.33*ysize) )
+      f('set orig %f,%f' % (0.0*xsize,0.33*ysize) )
+      f('set xrange [%f:%f]' % (0,laglen) )
+      f.title('Period detection: Rayleygh weighting')
+      f.xlabel('lag (df samples)')
+      f.plot(*d[1])
+      f('set size %f,%f' % (0.5*xsize,0.33*ysize) )
+      f('set orig %f,%f' % (0.5*xsize,0.33*ysize) )
+      f('set xrange [%f:%f]' % (0,laglen) )
+      f.title('Period detection: Gaussian weighting')
+      f.xlabel('lag (df samples)')
+      f.plot(*d[2])
+      f('set size %f,%f' % (1.0*xsize,0.33*ysize) )
+      f('set orig %f,%f' % (0.0*xsize,0.00*ysize) )
+      f('set xrange [%f:%f]' % (-laglen,laglen) )
+      f.title('Phase detection and predicted beats')
+      f.xlabel('time (df samples)')
+      f.plot(*d[3])
+      f('set nomultiplot')
+    if printframe == -1: a = sys.stdin.read()
+    elif 0 < printframe and printframe < nrframe:
+      break
Index: tests/python/bench/tempo/demo-tempo-acf
===================================================================
--- tests/python/bench/tempo/demo-tempo-acf	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/python/bench/tempo/demo-tempo-acf	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,157 @@
+#! /usr/bin/python
+
+""" this file was written by Paul Brossier 
+  it is released under the GNU/GPL license.
+"""
+
+import sys,time
+from aubio.task import taskbeat,taskparams
+from aubio.aubioclass import fvec, aubio_autocorr
+from aubio.gnuplot import gnuplot_create, gnuplot_addargs
+from aubio.aubiowrapper import *
+from math import exp,log
+
+usage = "usage: %s [options] -i soundfile" % sys.argv[0]
+
+def parse_args():
+        from optparse import OptionParser
+        parser = OptionParser(usage=usage)
+        parser.add_option("-i","--input",
+                          action="store", dest="filename", 
+                          help="input sound file")
+        parser.add_option("-n","--printframe",
+                          action="store", dest="printframe", default=-1, 
+                          help="make a plot of the n_th frame")
+        gnuplot_addargs(parser)
+        (options, args) = parser.parse_args()
+        if not options.filename: 
+                 print "no file name given\n", usage
+                 sys.exit(1)
+        return options, args
+
+def plotdata(x,y,plottitle="",**keyw):
+	import Gnuplot
+	return Gnuplot.Data(x, y, title="%s" % plottitle,**keyw)
+
+options, args = parse_args()
+filename = options.filename
+xsize = float(options.xsize)
+ysize = float(options.ysize)
+
+printframe = int(options.printframe)
+
+if options.outplot and printframe > 0: 
+  extension = options.outplot.split('.')[-1] 
+  outplot = '.'.join(options.outplot.split('.')[:-1])
+else: 
+  extension = ''
+  outplot = None
+f = gnuplot_create(outplot,extension,options)
+
+params = taskparams()
+params.onsetmode = 'specdiff'
+task = taskbeat(filename,params=params)
+
+hopsize = params.hopsize
+bufsize = params.bufsize
+btstep = task.btstep
+winlen = task.btwinlen
+laglen = winlen/4
+step = winlen/4
+
+timesig = 0
+maxnumelem = 4
+gp = 0
+counter = 0
+flagconst = 0
+constthresh = 3.901
+g_var      = 3.901
+rp = 0
+rp1 = 0
+rp2 = 0
+g_mu = 0
+
+rayparam = 48/512.*winlen
+
+t     = [i for i in range(hopsize)]
+#tlong = [i for i in range(hopsize*(btstep-1))]
+#tall  = [i for i in range(hopsize*btstep)]
+sig    = [0 for i in range(hopsize*btstep*4)]
+dfx = [i for i in range(winlen)]
+dfframe = [0 for i in range(winlen)]
+dfrev = [0 for i in range(winlen)]
+acframe = [0 for i in range(winlen/2)]
+
+localacf = [0 for i in range(winlen)]
+inds = [0 for i in range(maxnumelem)]
+
+acx = [i for i in range(laglen)]
+acfout  = [0 for i in range(laglen)]
+
+phwv  = [0 for i in range(2*laglen)]
+phwvx = [i for i in range(2*laglen)]
+
+dfwvnorm = exp(log(2.0)*(winlen+2.)/rayparam);
+dfwv = [exp(log(2.)*(i+1.)/rayparam)/dfwvnorm for i in range(winlen)]
+
+gwv = [exp(-.5*(j+1.-g_mu)**2/g_var**2) for j in range(laglen)]
+rwv = [(i+1.)/rayparam**2 * exp(-(i+1.)**2 / (2.*rayparam)**2)
+        for i in range(0,laglen)] 
+acf = fvec(winlen,1)
+
+nrframe = 0
+while (task.readsize == params.hopsize):
+  task()
+  #print task.pos2
+  sig[:-hopsize] = [i for i in sig[-(btstep*4-1)*hopsize:]]
+  sig[-hopsize:] = [task.myvec.get(i,0) for i in t]
+
+  #g('set xrange [%f:%f]' % (t[0],t[-1]))
+  #time.sleep(.2)
+  if task.pos2==btstep-1:
+    nrframe += 1
+    dfframe = [task.dfframe.get(i,0) for i in range(winlen)]
+    # start beattracking_do
+    for i in range(winlen):
+      dfrev[winlen-1-i] = 0.
+      dfrev[winlen-1-i] = dfframe[i]*dfwv[i]
+    aubio_autocorr(task.dfframe(),acf()); 
+    acframe = [acf.get(i,0) for i in range(winlen/2)]
+    if printframe == nrframe or printframe == -1:
+      d  = [[plotdata(range(0,btstep*hopsize*4,4),sig[0:-1:4],plottitle="input signal", with='lines')]]
+      d  += [[plotdata(range(-winlen,0),dfframe,plottitle="onset detection", with='lines')]]
+      d  += [[plotdata(range(winlen/2),acframe,plottitle="autocorrelation", with='lines')]]
+
+    # plot all this
+    if printframe == nrframe or printframe == -1:
+
+      f('set lmargin 4')
+      f('set rmargin 4')
+      f('set size %f,%f' % (1.0*xsize,1.0*ysize) )
+      f('set key spacing 1.3')
+      f('set multiplot')
+
+      f('set size %f,%f' % (1.0*xsize,0.33*ysize) )
+      f('set orig %f,%f' % (0.0*xsize,0.66*ysize) )
+      f('set xrange [%f:%f]' % (0,btstep*hopsize*4) )
+      f('set yrange [%f:%f]' % (-1.2*max(sig),1.2*max(sig)) )
+      f.title('Input signal')
+      f.xlabel('time (samples)')
+      f.plot(*d[0])
+      f('set size %f,%f' % (1.0*xsize,0.33*ysize) )
+      f('set orig %f,%f' % (0.0*xsize,0.33*ysize) )
+      f('set xrange [%f:%f]' % (-winlen,0) )
+      f('set autoscale y')
+      f.title('Onset detection function')
+      f.xlabel('time (df samples)')
+      f.plot(*d[1])
+      f('set size %f,%f' % (1.0*xsize,0.33*ysize) )
+      f('set orig %f,%f' % (0.0*xsize,0.00*ysize) )
+      f('set xrange [%f:%f]' % (0,winlen/2) )
+      f.title('Autocorrelation')
+      f.xlabel('lag (df samples)')
+      f.plot(*d[2])
+      f('set nomultiplot')
+    if printframe == -1: a = sys.stdin.read()
+    elif 0 < printframe and printframe < nrframe:
+      break
Index: tests/python/cvec.py
===================================================================
--- tests/python/cvec.py	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/python/cvec.py	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,51 @@
+import unittest
+
+from aubio.aubiowrapper import *
+
+buf_size = 2048
+channels = 3
+
+class cvec_test_case(unittest.TestCase):
+
+  def setUp(self):
+    self.vector = new_cvec(buf_size, channels)
+
+  def tearDown(self):
+    del_cvec(self.vector)
+
+  def test_cvec(self):
+    """ create and delete cvec """
+    pass
+
+  def test_cvec_read_norm(self):
+    """ check new cvec norm elements are set to 0. """
+    for index in range(buf_size/2+1):
+      for channel in range(channels):
+        self.assertEqual(cvec_read_norm(self.vector,channel,index),0.)
+
+  def test_cvec_read_phas(self):
+    """ check new cvec phas elements are set to 0. """
+    for index in range(buf_size/2+1):
+      for channel in range(channels):
+        self.assertEqual(cvec_read_phas(self.vector,channel,index),0.)
+
+  def test_cvec_write_norm(self):
+    """ check new cvec norm elements are set with cvec_write_norm """
+    for index in range(buf_size/2+1):
+      for channel in range(channels):
+        cvec_write_norm(self.vector,1.,channel,index)
+    for index in range(buf_size/2+1):
+      for channel in range(channels):
+        self.assertEqual(cvec_read_norm(self.vector,channel,index),1.)
+
+  def test_cvec_write_phas(self):
+    """ check new cvec phas elements are set with cvec_write_phas """
+    for index in range(buf_size/2+1):
+      for channel in range(channels):
+        cvec_write_phas(self.vector,1.,channel,index)
+    for index in range(buf_size/2+1):
+      for channel in range(channels):
+        self.assertEqual(cvec_read_phas(self.vector,channel,index),1.)
+
+if __name__ == '__main__':
+  unittest.main()
Index: tests/python/fvec.py
===================================================================
--- tests/python/fvec.py	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/python/fvec.py	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,36 @@
+import unittest
+
+from aubio.aubiowrapper import *
+
+buf_size = 2048
+channels = 3
+
+class fvec_test_case(unittest.TestCase):
+
+  def setUp(self):
+    self.vector = new_fvec(buf_size, channels)
+
+  def tearDown(self):
+    del_fvec(self.vector)
+
+  def test_fvec(self):
+    """ create and delete fvec """
+    pass
+
+  def test_fvec_read_sample(self):
+    """ check new fvec elements are set to 0. """
+    for index in range(buf_size):
+      for channel in range(channels):
+        self.assertEqual(fvec_read_sample(self.vector,channel,index),0.)
+
+  def test_fvec_write_sample(self):
+    """ check new fvec elements are set with fvec_write_sample """
+    for index in range(buf_size):
+      for channel in range(channels):
+        fvec_write_sample(self.vector,1.,channel,index)
+    for index in range(buf_size):
+      for channel in range(channels):
+        self.assertEqual(fvec_read_sample(self.vector,channel,index),1.)
+
+if __name__ == '__main__':
+  unittest.main()
Index: tests/python/run_all_tests
===================================================================
--- tests/python/run_all_tests	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/python/run_all_tests	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,17 @@
+#! /usr/bin/python
+
+# add ${src}/python and ${src}/python/aubio/.libs to python path
+# so the script is runnable from a compiled source tree.
+import sys, os
+
+cur_dir = os.path.dirname(sys.argv[0])
+sys.path.append(os.path.join(cur_dir,'..','..','python'))
+sys.path.append(os.path.join(cur_dir,'..','..','python','aubio','.libs'))
+
+import unittest
+
+modules_to_test = ['aubiomodule', 'fvec', 'cvec']
+
+if __name__ == '__main__':
+  for module in modules_to_test: exec('from %s import *' % module)
+  unittest.main()
Index: tests/src/Makefile.am
===================================================================
--- tests/src/Makefile.am	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/Makefile.am	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,36 @@
+AM_CFLAGS = -I$(top_srcdir)/src
+AM_LDFLAGS = -L$(top_builddir)/src -laubio @FFTWLIB_LIBS@
+
+test_phasevoc_jack_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/ext @JACK_CFLAGS@
+test_phasevoc_jack_LDADD  = $(AM_LDFLAGS) -laubioext -L$(top_builddir)/ext @JACK_LIBS@ 
+
+bin_PROGRAMS = \
+	test-fft \
+	test-mfft \
+	test-hist \
+	test-scale \
+	test-sample \
+	test-window \
+	test-filter \
+	test-biquad \
+	test-resample \
+	test-peakpick \
+	test-phasevoc \
+	test-phasevoc-jack \
+	test-onsetdetection \
+	test-pitchyin \
+	test-pitchyinfft \
+	test-pitchschmitt \
+	test-pitchfcomb \
+	test-pitchmcomb \
+	test-pitchdetection \
+	test-beattracking \
+	test-onset \
+	test-tempo \
+	test-tss
+
+run-tests: $(bin_PROGRAMS)
+	@for i in $(bin_PROGRAMS); do echo $$i; ((time ./$$i 2>&1 > /dev/null) 2>&1; echo $$?); done
+
+run-valgrind-tests: $(bin_PROGRAMS)
+	@for i in $(bin_PROGRAMS); do echo $$i; valgrind .libs/lt-$$i 2>&1 | grep ERROR\ SUMMARY -A4; echo $$?; done
Index: tests/src/test-beattracking.c
===================================================================
--- tests/src/test-beattracking.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-beattracking.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,39 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t channels   = 1;                          /* number of channel */
+        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
+        fvec_t * out      = new_fvec (win_s/4, channels);     /* input buffer */
+  
+        /* allocate fft and other memory space */
+        aubio_beattracking_t * tempo  = new_aubio_beattracking(win_s, channels);
+
+        uint_t i = 0;
+
+        smpl_t curtempo, curtempoconf;
+
+        while (i < 10) {
+          aubio_beattracking_do(tempo,in,out);
+          curtempo = aubio_beattracking_get_bpm(tempo);
+          if (curtempo != 0.) {
+            fprintf(stdout,"%f\n",curtempo);
+            return 1;
+          }
+          curtempoconf = aubio_beattracking_get_confidence(tempo);
+          if (curtempoconf != 0.) {
+            fprintf(stdout,"%f\n",curtempo);
+            return 1;
+          }
+          i++;
+        };
+
+        del_aubio_beattracking(tempo);
+        del_fvec(in);
+        del_fvec(out);
+        aubio_cleanup();
+
+        return 0;
+}
+
Index: tests/src/test-biquad.c
===================================================================
--- tests/src/test-biquad.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-biquad.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,16 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t channels   = 1;                          /* number of channel */
+        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
+        aubio_biquad_t * o = new_aubio_biquad(0.3,0.2,0.1,0.2,0.3);
+
+        aubio_biquad_do_filtfilt(o,in,in);
+        aubio_biquad_do(o,in);
+
+        del_aubio_biquad(o);
+        del_fvec(in);
+        return 0;
+}
Index: tests/src/test-fft.c
===================================================================
--- tests/src/test-fft.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-fft.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,58 @@
+#include <stdlib.h>
+#include <math.h>
+#include <complex.h>
+#include <aubio.h>
+
+#define NEW_ARRAY(_t,_n)		(_t*)malloc((_n)*sizeof(_t))
+
+
+int main(){
+        uint_t i,j;
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t channels   = 1;                          /* number of channel */
+        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
+        cvec_t * fftgrain = new_cvec (win_s, channels); /* fft norm and phase */
+        fvec_t * out      = new_fvec (win_s, channels); /* output buffer */
+  
+        /* allocate fft and other memory space */
+        aubio_fft_t * fft      = new_aubio_fft(win_s);      /* fft interface */
+        smpl_t * w             = NEW_ARRAY(smpl_t,win_s); /* window */
+        /* complex spectral data */
+        fft_data_t ** spec     = NEW_ARRAY(fft_data_t*,channels); 
+        for (i=0; i < channels; i++)
+                spec[i] = NEW_ARRAY(fft_data_t,win_s);
+        /* initialize the window (see mathutils.c) */
+        aubio_window(w,win_s,aubio_win_hanningz);
+  
+        /* fill input with some data */
+        in->data[0][win_s/2] = 1;
+  
+        /* execute stft */
+        for (i=0; i < channels; i++) {
+                aubio_fft_do (fft,in->data[i],spec[i],win_s);
+                /* put norm and phase into fftgrain */
+                aubio_fft_getnorm(fftgrain->norm[i], spec[i], win_s/2+1);
+                aubio_fft_getphas(fftgrain->phas[i], spec[i], win_s/2+1);
+        }
+  
+        /* execute inverse fourier transform */
+        for (i=0; i < channels; i++) {
+                for (j=0; j<win_s/2+1; j++) {
+                        spec[i][j]  = cexp(I*aubio_unwrap2pi(fftgrain->phas[i][j]));
+                        spec[i][j] *= fftgrain->norm[i][j];
+                }
+                aubio_fft_rdo(fft,spec[i],out->data[i],win_s);
+        }
+
+        del_fvec(in);
+        del_fvec(out);
+        del_cvec(fftgrain);
+        free(w);
+        del_aubio_fft(fft);
+        for (i=0; i < channels; i++)
+                free(spec[i]);
+        free(spec); 
+        aubio_cleanup();
+        return 0;
+}
Index: tests/src/test-filter.c
===================================================================
--- tests/src/test-filter.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-filter.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,23 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t channels   = 1;                          /* number of channel */
+        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
+        fvec_t * out      = new_fvec (win_s, channels);     /* input buffer */
+  
+        /* allocate fft and other memory space */
+        aubio_filter_t * o = new_aubio_cdsgn_filter(44100);
+
+        aubio_filter_do(o,in);
+        aubio_filter_do_outplace(o,in,out);
+        aubio_filter_do_filtfilt(o,in,out);
+
+        del_aubio_filter(o);
+        del_fvec(in);
+        del_fvec(out);
+        aubio_cleanup();
+
+        return 0;
+}
Index: tests/src/test-hist.c
===================================================================
--- tests/src/test-hist.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-hist.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,38 @@
+#include <aubio.h>
+#include <stdlib.h>
+
+void print_array(fvec_t *f);
+void print_array(fvec_t *f){
+  uint i,j;
+  for (i=0;i<f->channels;i++){
+    for (j=0;j<f->length;j++){
+      printf("%f, ", f->data[i][j]); 
+    }
+    printf(";\n"); 
+  }
+}
+
+int main( int argc, char** argv )
+{
+  uint_t length;
+  for (length = 1; length < 10; length ++ ) {
+    fvec_t *t = new_fvec(length,5);
+    aubio_hist_t *o = new_aubio_hist(0, 1, length, 5);
+    aubio_window(t->data[0],t->length,aubio_win_hanning);
+    aubio_window(t->data[1],t->length,aubio_win_hanningz);
+    aubio_window(t->data[2],t->length,aubio_win_blackman);
+    aubio_window(t->data[3],t->length,aubio_win_blackman_harris);
+    aubio_window(t->data[4],t->length,aubio_win_hamming);
+    print_array(t);
+    aubio_hist_do(o,t);
+    print_array(t);
+    aubio_hist_do_notnull(o,t);
+    print_array(t);
+    aubio_hist_dyn_notnull(o,t);
+    print_array(t);
+    del_aubio_hist(o);
+    del_fvec(t);
+  }
+  return 0;
+}
+
Index: tests/src/test-mfft.c
===================================================================
--- tests/src/test-mfft.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-mfft.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,28 @@
+
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 4096;                       /* window size        */
+        uint_t channels   = 100;                        /* number of channels */
+        fvec_t * in       = new_fvec (win_s, channels); /* input buffer       */
+        cvec_t * fftgrain = new_cvec (win_s, channels); /* fft norm and phase */
+        fvec_t * out      = new_fvec (win_s, channels); /* output buffer      */
+        /* allocate fft and other memory space */
+        aubio_mfft_t * fft = new_aubio_mfft(win_s,channels);
+        /* fill input with some data */
+        //printf("initialised\n");
+        /* execute stft */
+        aubio_mfft_do (fft,in,fftgrain);
+        //printf("computed forward\n");
+        /* execute inverse fourier transform */
+        aubio_mfft_rdo(fft,fftgrain,out);
+        //printf("computed backard\n");
+        del_aubio_mfft(fft);
+        del_fvec(in);
+        del_cvec(fftgrain);
+        del_fvec(out);
+        //printf("memory freed\n");
+        aubio_cleanup();
+        return 0;
+}
Index: tests/src/test-onset.c
===================================================================
--- tests/src/test-onset.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-onset.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,23 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t channels   = 1;                          /* number of channel */
+        fvec_t * in       = new_fvec (win_s/4, channels); /* input buffer */
+        fvec_t * out      = new_fvec (2, channels);     /* input buffer */
+        aubio_onset_t * onset  = new_aubio_onset(aubio_onset_complex, win_s, win_s/4, channels);
+        uint_t i = 0;
+
+        while (i < 10) {
+          aubio_onset(onset,in,out);
+          i++;
+        };
+
+        del_aubio_onset(onset);
+        del_fvec(in);
+        del_fvec(out);
+        aubio_cleanup();
+
+        return 0;
+}
Index: tests/src/test-onsetdetection.c
===================================================================
--- tests/src/test-onsetdetection.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-onsetdetection.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,54 @@
+
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t channels   = 1;                          /* number of channel */
+        cvec_t * in       = new_cvec (win_s, channels); /* input buffer */
+        fvec_t * out      = new_fvec (1, channels);     /* input buffer */
+  
+        /* allocate fft and other memory space */
+        aubio_onsetdetection_t * o = 
+          new_aubio_onsetdetection(aubio_onset_energy, win_s, channels);
+        aubio_onsetdetection(o,in,out);
+        aubio_onsetdetection_energy(o,in,out);
+        del_aubio_onsetdetection(o);
+
+        o = new_aubio_onsetdetection(aubio_onset_specdiff, win_s, channels);
+        aubio_onsetdetection(o,in,out);
+        aubio_onsetdetection_specdiff(o,in,out);
+        del_aubio_onsetdetection(o);
+
+        o = new_aubio_onsetdetection(aubio_onset_hfc, win_s, channels);
+        aubio_onsetdetection(o,in,out);
+        aubio_onsetdetection_hfc(o,in,out);
+        del_aubio_onsetdetection(o);
+
+        o = new_aubio_onsetdetection(aubio_onset_complex, win_s, channels);
+        aubio_onsetdetection(o,in,out);
+        aubio_onsetdetection_complex(o,in,out);
+        del_aubio_onsetdetection(o);
+
+        o = new_aubio_onsetdetection(aubio_onset_phase, win_s, channels);
+        aubio_onsetdetection(o,in,out);
+        aubio_onsetdetection_phase(o,in,out);
+        del_aubio_onsetdetection(o);
+
+        o = new_aubio_onsetdetection(aubio_onset_kl, win_s, channels);
+        aubio_onsetdetection(o,in,out);
+        aubio_onsetdetection_kl(o,in,out);
+        del_aubio_onsetdetection(o);
+
+        o = new_aubio_onsetdetection(aubio_onset_mkl, win_s, channels);
+        aubio_onsetdetection(o,in,out);
+        aubio_onsetdetection_mkl(o,in,out);
+        del_aubio_onsetdetection(o);
+
+        del_cvec(in);
+        del_fvec(out);
+        aubio_cleanup();
+
+        return 0;
+}
+
Index: tests/src/test-peakpick.c
===================================================================
--- tests/src/test-peakpick.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-peakpick.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,19 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t channels   = 1;                          /* number of channel */
+        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
+        aubio_pickpeak_t * o = new_aubio_peakpicker(0.3);
+
+        aubio_peakpick_pimrt(in,o);
+        aubio_peakpick_pimrt(in,o);
+        aubio_peakpick_pimrt(in,o);
+        aubio_peakpick_pimrt(in,o);
+
+        del_aubio_peakpicker(o);
+        del_fvec(in);
+        return 0;
+}
+
Index: tests/src/test-phasevoc-jack.c
===================================================================
--- tests/src/test-phasevoc-jack.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-phasevoc-jack.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,84 @@
+/* test sample for phase vocoder 
+ *
+ * this program should start correctly using JACK_START_SERVER=true and
+ * reconstruct each audio input frame perfectly on the corresponding input with
+ * a delay equal to the window size, hop_s.
+ */
+
+#include <unistd.h>  /* pause() or sleep() */
+#include <aubio.h>
+#include <aubioext.h>
+
+uint_t win_s    = 32; /* window size                       */
+uint_t hop_s    = 8;  /* hop size                          */
+uint_t channels = 4;  /* number of channels                */
+uint_t pos      = 0;  /* frames%dspblocksize for jack loop */
+
+fvec_t * in;
+cvec_t * fftgrain;
+fvec_t * out;
+
+aubio_pvoc_t * pv;
+
+#ifdef JACK_SUPPORT
+aubio_jack_t * jack_setup;
+#endif
+
+int aubio_process(float **input, float **output, int nframes);
+
+int main(){
+        /* allocate some memory */
+        in       = new_fvec (hop_s, channels); /* input buffer       */
+        fftgrain = new_cvec (win_s, channels); /* fft norm and phase */
+        out      = new_fvec (hop_s, channels); /* output buffer      */
+        /* allocate fft and other memory space */
+        pv = new_aubio_pvoc(win_s,hop_s,channels);
+        /* fill input with some data */
+        printf("initialised\n");
+        /* execute stft */
+        aubio_pvoc_do (pv,in,fftgrain);
+        printf("computed forward\n");
+        /* execute inverse fourier transform */
+        aubio_pvoc_rdo(pv,fftgrain,out);
+        printf("computed backard\n");
+
+#ifdef JACK_SUPPORT
+        jack_setup  = new_aubio_jack(channels, channels,
+                        (aubio_process_func_t)aubio_process);
+        aubio_jack_activate(jack_setup);
+        sleep(10); //pause(); /* enter main jack loop */
+        aubio_jack_close(jack_setup);
+#endif
+        
+        del_aubio_pvoc(pv);
+        del_cvec(fftgrain);
+        del_fvec(in);
+        del_fvec(out);
+        aubio_cleanup();
+        printf("memory freed\n");
+        return 0;
+}
+
+int aubio_process(float **input, float **output, int nframes) {
+  uint_t i;       /*channels*/
+  uint_t j;       /*frames*/
+  for (j=0;j<(unsigned)nframes;j++) {
+    for (i=0;i<channels;i++) {
+      /* write input to datanew */
+      fvec_write_sample(in, input[i][j], i, pos);
+      /* put synthnew in output */
+      output[i][j] = fvec_read_sample(out, i, pos);
+    }
+    /*time for fft*/
+    if (pos == hop_s-1) {
+      /* block loop */
+      aubio_pvoc_do (pv,in, fftgrain);
+      //for (i=0;i<fftgrain->length;i++) fftgrain->phas[0][i] *= 2.; 
+      //for (i=0;i<fftgrain->length;i++) fftgrain->phas[0][i] = 0.; 
+      aubio_pvoc_rdo(pv,fftgrain,out);
+      pos = -1;
+    }
+    pos++;
+  }
+  return 0;
+}
Index: tests/src/test-phasevoc.c
===================================================================
--- tests/src/test-phasevoc.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-phasevoc.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,30 @@
+/* test sample for phase vocoder */
+
+#include <aubio.h>
+
+int main(){
+        uint_t win_s    = 1024; /* window size                       */
+        uint_t hop_s    = 256;  /* hop size                          */
+        uint_t channels = 4;  /* number of channels                */
+        /* allocate some memory */
+        fvec_t * in       = new_fvec (hop_s, channels); /* input buffer       */
+        cvec_t * fftgrain = new_cvec (win_s, channels); /* fft norm and phase */
+        fvec_t * out      = new_fvec (hop_s, channels); /* output buffer      */
+        /* allocate fft and other memory space */
+        aubio_pvoc_t * pv = new_aubio_pvoc(win_s,hop_s,channels);
+        /* fill input with some data */
+        printf("initialised\n");
+        /* execute stft */
+        aubio_pvoc_do (pv,in,fftgrain);
+        printf("computed forward\n");
+        /* execute inverse fourier transform */
+        aubio_pvoc_rdo(pv,fftgrain,out);
+        printf("computed backard\n");
+        del_aubio_pvoc(pv);
+        del_fvec(in);
+        del_cvec(fftgrain);
+        del_fvec(out);
+        aubio_cleanup();
+        printf("memory freed\n");
+        return 0;
+}
Index: tests/src/test-pitchdetection.c
===================================================================
--- tests/src/test-pitchdetection.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-pitchdetection.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,27 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t hop_s      = win_s/4;                    /* hop size */
+        uint_t samplerate = 44100;                      /* samplerate */
+        uint_t channels   = 1;                          /* number of channel */
+        aubio_pitchdetection_mode mode = aubio_pitchm_freq;
+        aubio_pitchdetection_type type = aubio_pitch_yinfft;
+        fvec_t * in       = new_fvec (hop_s, channels); /* input buffer */
+        aubio_pitchdetection_t * o  = new_aubio_pitchdetection(
+          win_s, hop_s, channels, samplerate, type, mode
+          );
+        uint_t i = 0;
+
+        while (i < 1000) {
+          aubio_pitchdetection(o,in);
+          i++;
+        };
+
+        del_aubio_pitchdetection(o);
+        del_fvec(in);
+        aubio_cleanup();
+
+        return 0;
+}
Index: tests/src/test-pitchfcomb.c
===================================================================
--- tests/src/test-pitchfcomb.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-pitchfcomb.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,25 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t hop_s      = win_s/4;                    /* hop size */
+        uint_t samplerate = 44100;                      /* samplerate */
+        uint_t channels   = 1;                          /* number of channel */
+        fvec_t * in       = new_fvec (hop_s, channels); /* input buffer */
+        aubio_pitchfcomb_t * o  = new_aubio_pitchfcomb (
+          win_s, hop_s, samplerate
+          );
+        uint_t i = 0;
+
+        while (i < 1000) {
+          aubio_pitchfcomb_detect(o,in);
+          i++;
+        };
+
+        del_aubio_pitchfcomb(o);
+        del_fvec(in);
+        aubio_cleanup();
+
+        return 0;
+}
Index: tests/src/test-pitchmcomb.c
===================================================================
--- tests/src/test-pitchmcomb.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-pitchmcomb.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,24 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t hop_s      = win_s/4;                    /* hop size */
+        uint_t samplerate = 44100;
+        uint_t channels   = 1;                          /* number of channel */
+        cvec_t * in       = new_cvec (win_s, channels); /* input buffer */
+        aubio_pitchmcomb_t * o  = new_aubio_pitchmcomb(
+          win_s, hop_s, channels, samplerate );
+        uint_t i = 0;
+
+        while (i < 1000) {
+          aubio_pitchmcomb_detect (o,in);
+          i++;
+        };
+
+        del_aubio_pitchmcomb(o);
+        del_cvec(in);
+        aubio_cleanup();
+
+        return 0;
+}
Index: tests/src/test-pitchschmitt.c
===================================================================
--- tests/src/test-pitchschmitt.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-pitchschmitt.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,23 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t samplerate = 44100;                          /* number of channel */
+        fvec_t * in       = new_fvec (win_s, 1); /* input buffer */
+        aubio_pitchschmitt_t * o  = new_aubio_pitchschmitt(
+          win_s, samplerate );
+        uint_t i = 0;
+
+        while (i < 1000) {
+          aubio_pitchschmitt_detect (o,in);
+          i++;
+        };
+
+        del_aubio_pitchschmitt(o);
+        del_fvec(in);
+        aubio_cleanup();
+
+        return 0;
+}
+
Index: tests/src/test-pitchyin.c
===================================================================
--- tests/src/test-pitchyin.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-pitchyin.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,24 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t channels   = 1;                          /* number of channel */
+        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
+        fvec_t * out      = new_fvec (win_s/2, channels); /* input buffer */
+        uint_t i = 0;
+
+        while (i < 10) {
+          aubio_pitchyin_diff   (in,out);
+          aubio_pitchyin_getcum (out);
+          aubio_pitchyin_getpitch (out);
+          aubio_pitchyin_getpitchfast (in,out,0.2);
+          i++;
+        };
+
+        del_fvec(in);
+        del_fvec(out);
+        aubio_cleanup();
+
+        return 0;
+}
Index: tests/src/test-pitchyinfft.c
===================================================================
--- tests/src/test-pitchyinfft.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-pitchyinfft.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,22 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t channels   = 1;                          /* number of channel */
+        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
+        aubio_pitchyinfft_t * o  = new_aubio_pitchyinfft(win_s);
+        uint_t i = 0;
+
+        while (i < 10) {
+          aubio_pitchyinfft_detect (o,in,0.2);
+          i++;
+        };
+
+        del_aubio_pitchyinfft(o);
+        del_fvec(in);
+        aubio_cleanup();
+
+        return 0;
+}
+
Index: tests/src/test-resample.c
===================================================================
--- tests/src/test-resample.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-resample.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,23 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t channels   = 1;                          /* number of channel */
+        smpl_t ratio      = 0.5;
+        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
+        fvec_t * out      = new_fvec ((uint_t)(win_s*ratio), channels);     /* input buffer */
+        aubio_resampler_t * o  = new_aubio_resampler(0.5, 0);
+        uint_t i = 0;
+
+        while (i < 100) {
+          aubio_resampler_process(o,in,out);
+          i++;
+        };
+
+        del_aubio_resampler(o);
+        del_fvec(in);
+        del_fvec(out);
+
+        return 0;
+}
Index: tests/src/test-sample.c
===================================================================
--- tests/src/test-sample.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-sample.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,14 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t channels   = 1;                          /* number of channel */
+        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
+        cvec_t * sp       = new_cvec (win_s, channels); /* input buffer */
+        del_fvec(in);
+        del_cvec(sp);
+
+        return 0;
+}
+
Index: tests/src/test-scale.c
===================================================================
--- tests/src/test-scale.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-scale.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,21 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t channels   = 1;                          /* number of channel */
+        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
+        aubio_scale_t * o = new_aubio_scale(0,1,2,3);
+        aubio_scale_set(o,0,1,2,3);
+        uint_t i = 0;
+
+        while (i < 1000) {
+          aubio_scale_do(o,in);
+          i++;
+        };
+
+        del_aubio_scale(o);
+        del_fvec(in);
+
+        return 0;
+}
Index: tests/src/test-tempo.c
===================================================================
--- tests/src/test-tempo.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-tempo.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,35 @@
+#include <aubio.h>
+
+int main(){
+        /* allocate some memory */
+        uint_t win_s      = 1024;                       /* window size */
+        uint_t channels   = 1;                          /* number of channel */
+        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
+        fvec_t * out      = new_fvec (2, channels);     /* input buffer */
+        aubio_tempo_t * o  = new_aubio_tempo(aubio_onset_complex, win_s, win_s/4, channels);
+        uint_t i = 0;
+
+        smpl_t curtempo, curtempoconf;
+
+        while (i < 1000) {
+          aubio_tempo(o,in,out);
+          curtempo = aubio_tempo_get_bpm(o);
+          if (curtempo != 0.) {
+            fprintf(stdout,"%f\n",curtempo);
+            return 1;
+          }
+          curtempoconf = aubio_beattracking_get_confidence(o);
+          if (curtempoconf != 0.) {
+            fprintf(stdout,"%f\n",curtempo);
+            return 1;
+          }
+          i++;
+        };
+
+        del_aubio_tempo(o);
+        del_fvec(in);
+        del_fvec(out);
+        aubio_cleanup();
+
+        return 0;
+}
Index: tests/src/test-tss.c
===================================================================
--- tests/src/test-tss.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-tss.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,47 @@
+/* test sample for phase vocoder 
+ *
+ * this program should start correctly using JACK_START_SERVER=true and
+ * reconstruct each audio input frame perfectly on the corresponding input with
+ * a delay equal to the window size, hop_s.
+ */
+
+#include <aubio.h>
+
+int main(){
+	int i;
+        uint_t win_s    = 1024; /* window size                       */
+        uint_t hop_s    = 256;  /* hop size                          */
+        uint_t channels = 4;  /* number of channels                */
+        /* allocate some memory */
+        fvec_t * in       = new_fvec (hop_s, channels); /* input buffer       */
+        cvec_t * fftgrain = new_cvec (win_s, channels); /* fft norm and phase */
+        cvec_t * cstead   = new_cvec (win_s, channels); /* fft norm and phase */
+        cvec_t * ctrans   = new_cvec (win_s, channels); /* fft norm and phase */
+        fvec_t * stead    = new_fvec (hop_s, channels); /* output buffer      */
+        fvec_t * trans    = new_fvec (hop_s, channels); /* output buffer      */
+        /* allocate fft and other memory space */
+        aubio_pvoc_t * pv = new_aubio_pvoc (win_s,hop_s,channels);
+        aubio_pvoc_t * pvt = new_aubio_pvoc(win_s,hop_s,channels);
+        aubio_pvoc_t * pvs = new_aubio_pvoc(win_s,hop_s,channels);
+
+	aubio_tss_t *  tss = new_aubio_tss(0.01,3.,4.,win_s,hop_s,channels);
+        /* fill input with some data */
+        printf("initialised\n");
+        /* execute stft */
+	for (i = 0; i < 10; i++) {
+		aubio_pvoc_do (pv,in,fftgrain);
+		aubio_tss_do  (tss,fftgrain,ctrans,cstead);
+		aubio_pvoc_rdo(pvt,cstead,stead);
+		aubio_pvoc_rdo(pvs,ctrans,trans);
+	}
+        del_aubio_pvoc(pv);
+        del_fvec(in);
+        del_cvec(fftgrain);
+        del_cvec(cstead);
+        del_cvec(ctrans);
+        del_fvec(stead);
+        del_fvec(trans);
+        aubio_cleanup();
+        printf("memory freed\n");
+        return 0;
+}
Index: tests/src/test-window.c
===================================================================
--- tests/src/test-window.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
+++ tests/src/test-window.c	(revision de2a8af8ce5caf1a774185841fcdf7870039881a)
@@ -0,0 +1,37 @@
+#include <aubio.h>
+#include <stdlib.h>
+
+void print_array(fvec_t *f);
+void print_array(fvec_t *f){
+  uint i,j;
+  for (i=0;i<f->channels;i++)
+  {
+    for (j=0;j<f->length;j++)
+    {
+      printf("%1.3e, ", f->data[i][j]); 
+    }
+    printf(";\n"); 
+  }
+}
+
+int main( int argc, char** argv )
+{
+  uint_t length;
+  for (length = 2; length <= 5; length++)
+  {
+    fvec_t *t = new_fvec(length,9);
+    aubio_window(t->data[0],t->length,aubio_win_rectangle);
+    aubio_window(t->data[1],t->length,aubio_win_hamming);
+    aubio_window(t->data[2],t->length,aubio_win_hanning);
+    aubio_window(t->data[3],t->length,aubio_win_hanningz);
+    aubio_window(t->data[4],t->length,aubio_win_blackman);
+    aubio_window(t->data[5],t->length,aubio_win_blackman_harris);
+    aubio_window(t->data[6],t->length,aubio_win_gaussian);
+    aubio_window(t->data[7],t->length,aubio_win_welch);
+    aubio_window(t->data[8],t->length,aubio_win_parzen);
+    print_array(t);
+    del_fvec(t);
+  }
+  return 0;
+}
+
