Index: examples/aubiomfcc.c
===================================================================
--- examples/aubiomfcc.c	(revision 40a05d3d6d7d3415e021d6a5ef39dc00bdfa43e8)
+++ examples/aubiomfcc.c	(revision 066433db7ff0966faf04a301b8562d0fd0dfd16e)
@@ -33,15 +33,12 @@
 
 static int aubio_process(smpl_t **input, smpl_t **output, int nframes) {
-  unsigned int i;       /*channels*/
   unsigned int j;       /*frames*/
   
   for (j=0;j<(unsigned)nframes;j++) {
     if(usejack) {
-      for (i=0;i<channels;i++) {
-        /* write input to datanew */
-        fvec_write_sample(ibuf, input[i][j], i, pos);
-        /* put synthnew in output */
-        output[i][j] = fvec_read_sample(obuf, i, pos);
-      }
+      /* write input to datanew */
+      fvec_write_sample(ibuf, input[0][j], pos);
+      /* put synthnew in output */
+      output[0][j] = fvec_read_sample(obuf, pos);
     }
     /*time for fft*/
@@ -50,5 +47,5 @@
       
       //compute mag spectrum
-      aubio_pvoc_do (pv,ibuf, fftgrain);
+      aubio_pvoc_do (pv, ibuf, fftgrain);
      
       //compute mfccs
@@ -72,5 +69,5 @@
         outmsg("%f\t",frames*overlap_size/(float)samplerate);
         for (coef_cnt = 0; coef_cnt < n_coefs; coef_cnt++) {
-            outmsg("%f ", fvec_read_sample (mfcc_out, 0, coef_cnt) );
+            outmsg("%f ", fvec_read_sample (mfcc_out, coef_cnt) );
         }
         outmsg("\n");
@@ -86,12 +83,12 @@
 
   /* phase vocoder */
-  pv = new_aubio_pvoc (buffer_size, overlap_size, channels);
+  pv = new_aubio_pvoc (buffer_size, overlap_size);
 
-  fftgrain = new_cvec (buffer_size, channels);
+  fftgrain = new_cvec (buffer_size);
 
   //populating the filter
   mfcc = new_aubio_mfcc(buffer_size, n_filters, n_coefs, samplerate);
   
-  mfcc_out = new_fvec(n_coefs,channels);
+  mfcc_out = new_fvec(n_coefs);
   
   //process
Index: examples/aubionotes.c
===================================================================
--- examples/aubionotes.c	(revision 40a05d3d6d7d3415e021d6a5ef39dc00bdfa43e8)
+++ examples/aubionotes.c	(revision 066433db7ff0966faf04a301b8562d0fd0dfd16e)
@@ -19,5 +19,5 @@
 */
 
-#define AUBIO_UNSTABLE 1 // for fvec_median_channel
+#define AUBIO_UNSTABLE 1 // for fvec_median
 
 #include "utils.h"
@@ -50,14 +50,11 @@
 
 static int aubio_process(smpl_t **input, smpl_t **output, int nframes) {
-  unsigned int i;       /*channels*/
   unsigned int j;       /*frames*/
   for (j=0;j<(unsigned)nframes;j++) {
     if(usejack) {
-      for (i=0;i<channels;i++) {
-        /* write input to datanew */
-        fvec_write_sample(ibuf, input[i][j], i, pos);
-        /* put synthnew in output */
-        output[i][j] = fvec_read_sample(obuf, i, pos);
-      }
+      /* write input to datanew */
+      fvec_write_sample(ibuf, input[0][j], pos);
+      /* put synthnew in output */
+      output[0][j] = fvec_read_sample(obuf, pos);
     }
     /*time for fft*/
@@ -67,5 +64,5 @@
       
       aubio_pitch_do (pitchdet, ibuf, pitch_obuf);
-      pitch = fvec_read_sample(pitch_obuf, 0, 0);
+      pitch = fvec_read_sample(pitch_obuf, 0);
       if(median){
               note_append(note_buffer, pitch);
@@ -74,5 +71,5 @@
       /* curlevel is negatif or 1 if silence */
       curlevel = aubio_level_detection(ibuf, silence);
-      if (fvec_read_sample(onset, 0, 0)) {
+      if (fvec_read_sample(onset, 0)) {
               /* test for silence */
               if (curlevel == 1.) {
@@ -92,5 +89,5 @@
 
                       for (pos = 0; pos < overlap_size; pos++){
-                              obuf->data[0][pos] = woodblock->data[0][pos];
+                              obuf->data[pos] = woodblock->data[pos];
                       }
               }
@@ -112,5 +109,5 @@
               } // if median
         for (pos = 0; pos < overlap_size; pos++)
-          obuf->data[0][pos] = 0.;
+          obuf->data[pos] = 0.;
       }
       /* end of block loop */
@@ -131,7 +128,7 @@
   uint_t i = 0;
   for (i = 0; i < note_buffer->length - 1; i++) {
-    note_buffer->data[0][i] = note_buffer->data[0][i + 1];
+    note_buffer->data[i] = note_buffer->data[i + 1];
   }
-  note_buffer->data[0][note_buffer->length - 1] = curnote;
+  note_buffer->data[note_buffer->length - 1] = curnote;
   return;
 }
@@ -142,7 +139,7 @@
   uint_t i;
   for (i = 0; i < note_buffer->length; i++) {
-    note_buffer2->data[0][i] = note_buffer->data[0][i];
+    note_buffer2->data[i] = note_buffer->data[i];
   }
-  return fvec_median_channel (note_buffer2, 0);
+  return fvec_median (note_buffer2);
 }
 
@@ -150,16 +147,15 @@
   examples_common_init(argc,argv);
 
-  o = new_aubio_onset (onset_mode, buffer_size, overlap_size, channels,
-          samplerate);
+  o = new_aubio_onset (onset_mode, buffer_size, overlap_size, samplerate);
   if (threshold != 0.) aubio_onset_set_threshold (o, threshold);
-  onset = new_fvec (1, channels);
+  onset = new_fvec (1);
 
   pitchdet = new_aubio_pitch (pitch_mode, buffer_size * 4,
-          overlap_size, channels, samplerate);
+          overlap_size, samplerate);
   aubio_pitch_set_tolerance (pitchdet, 0.7);
-  pitch_obuf = new_fvec (1, channels);
+  pitch_obuf = new_fvec (1);
   if (median) {
-      note_buffer = new_fvec (median, 1);
-      note_buffer2 = new_fvec (median, 1);
+      note_buffer = new_fvec (median);
+      note_buffer2 = new_fvec (median);
   }
 
Index: examples/aubioonset.c
===================================================================
--- examples/aubioonset.c	(revision 40a05d3d6d7d3415e021d6a5ef39dc00bdfa43e8)
+++ examples/aubioonset.c	(revision 066433db7ff0966faf04a301b8562d0fd0dfd16e)
@@ -31,16 +31,14 @@
   for (j=0;j<(unsigned)nframes;j++) {
     if(usejack) {
-      for (i=0;i<channels;i++) {
-        /* write input to datanew */
-        fvec_write_sample(ibuf, input[i][j], i, pos);
-        /* put synthnew in output */
-        output[i][j] = fvec_read_sample(obuf, i, pos);
-      }
+      /* write input to datanew */
+      fvec_write_sample(ibuf, input[0][j], pos);
+      /* put synthnew in output */
+      output[0][j] = fvec_read_sample(obuf, pos);
     }
     /*time for fft*/
-    if (pos == overlap_size-1) {         
+    if (pos == overlap_size-1) {
       /* block loop */
       aubio_onset_do (o, ibuf, onset);
-      if (fvec_read_sample(onset, 0, 0)) {
+      if ( fvec_read_sample(onset, 0) ) {
         fvec_copy (woodblock, obuf);
       } else {
@@ -55,18 +53,20 @@
 }
 
-static void process_print (void) {
-      /* output times in seconds, taking back some 
-       * delay to ensure the label is _before_ the
-       * actual onset */
-      if (!verbose && usejack) return;
-      smpl_t onset_found = fvec_read_sample(onset, 0, 0);
-      if (onset_found) {
-        if(frames >= 4) {
-          outmsg("%f\n",(frames - frames_delay + onset_found) 
-                  *overlap_size/(float)samplerate);
-        } else if (frames < frames_delay) {
-          outmsg("%f\n",0.);
-        }
-      }
+static void
+process_print (void)
+{
+  /* output times in seconds, taking back some delay to ensure the label is
+   * _before_ the actual onset */
+  if (!verbose && usejack)
+    return;
+  smpl_t onset_found = fvec_read_sample (onset, 0);
+  if (onset_found) {
+    if (frames >= 4) {
+      outmsg ("%f\n", (frames - frames_delay + onset_found)
+          * overlap_size / (float) samplerate);
+    } else if (frames < frames_delay) {
+      outmsg ("%f\n", 0.);
+    }
+  }
 }
 
@@ -75,8 +75,7 @@
   examples_common_init(argc,argv);
 
-  o = new_aubio_onset (onset_mode, buffer_size, overlap_size, channels,
-          samplerate);
+  o = new_aubio_onset (onset_mode, buffer_size, overlap_size, samplerate);
   if (threshold != 0.) aubio_onset_set_threshold (o, threshold);
-  onset = new_fvec (1, channels);
+  onset = new_fvec (1);
 
   examples_common_process(aubio_process,process_print);
Index: examples/aubiopitch.c
===================================================================
--- examples/aubiopitch.c	(revision 40a05d3d6d7d3415e021d6a5ef39dc00bdfa43e8)
+++ examples/aubiopitch.c	(revision 066433db7ff0966faf04a301b8562d0fd0dfd16e)
@@ -27,14 +27,11 @@
 
 static int aubio_process(smpl_t **input, smpl_t **output, int nframes) {
-  unsigned int i;       /*channels*/
   unsigned int j;       /*frames*/
   for (j=0;j<(unsigned)nframes;j++) {
     if(usejack) {
-      for (i=0;i<channels;i++) {
-        /* write input to datanew */
-        fvec_write_sample(ibuf, input[i][j], i, pos);
-        /* put synthnew in output */
-        output[i][j] = fvec_read_sample(obuf, i, pos);
-      }
+      /* write input to datanew */
+      fvec_write_sample(ibuf, input[0][j], pos);
+      /* put synthnew in output */
+      output[0][j] = fvec_read_sample(obuf, pos);
     }
     /*time for fft*/
@@ -42,5 +39,5 @@
       /* block loop */
       aubio_pitch_do (o, ibuf, pitch);
-      if (fvec_read_sample(pitch, 0, 0)) {
+      if (fvec_read_sample(pitch, 0)) {
         for (pos = 0; pos < overlap_size; pos++){
           // TODO, play sine at this freq
@@ -59,5 +56,5 @@
 static void process_print (void) {
       if (!verbose && usejack) return;
-      smpl_t pitch_found = fvec_read_sample(pitch, 0, 0);
+      smpl_t pitch_found = fvec_read_sample(pitch, 0);
       outmsg("%f %f\n",(frames) 
               *overlap_size/(float)samplerate, pitch_found);
@@ -67,7 +64,6 @@
   examples_common_init(argc,argv);
 
-  o = new_aubio_pitch (onset_mode, buffer_size, overlap_size, channels,
-          samplerate);
-  pitch = new_fvec (1, channels);
+  o = new_aubio_pitch (onset_mode, buffer_size, overlap_size, samplerate);
+  pitch = new_fvec (1);
 
   examples_common_process(aubio_process,process_print);
Index: examples/aubioquiet.c
===================================================================
--- examples/aubioquiet.c	(revision 40a05d3d6d7d3415e021d6a5ef39dc00bdfa43e8)
+++ examples/aubioquiet.c	(revision 066433db7ff0966faf04a301b8562d0fd0dfd16e)
@@ -26,14 +26,11 @@
 int aubio_process(smpl_t **input, smpl_t **output, int nframes);
 int aubio_process(smpl_t **input, smpl_t **output, int nframes) {
-  unsigned int i;       /*channels*/
   unsigned int j;       /*frames*/
   for (j=0;j<(unsigned)nframes;j++) {
     if(usejack) {
-      for (i=0;i<channels;i++) {
-        /* write input to datanew */
-        fvec_write_sample(ibuf, input[i][j], i, pos);
-        /* put synthnew in output */
-        output[i][j] = fvec_read_sample(obuf, i, pos);
-      }
+      /* write input to datanew */
+      fvec_write_sample(ibuf, input[0][j], pos);
+      /* put synthnew in output */
+      output[0][j] = fvec_read_sample(obuf, pos);
     }
     /*time for fft*/
@@ -41,10 +38,10 @@
       /* test for silence */
       if (aubio_silence_detection(ibuf, silence)==1) {
-	if (wassilence==1) issilence = 1;
-	else issilence = 2;
+        if (wassilence==1) issilence = 1;
+        else issilence = 2;
         wassilence=1;
       } else { 
-	if (wassilence<=0) issilence = 0;
-	else issilence = -1;
+        if (wassilence<=0) issilence = 0;
+        else issilence = -1;
         wassilence=0;
       }
Index: examples/aubiotrack.c
===================================================================
--- examples/aubiotrack.c	(revision 40a05d3d6d7d3415e021d6a5ef39dc00bdfa43e8)
+++ examples/aubiotrack.c	(revision 066433db7ff0966faf04a301b8562d0fd0dfd16e)
@@ -29,14 +29,11 @@
 
 static int aubio_process(smpl_t **input, smpl_t **output, int nframes) {
-  unsigned int i;       /*channels*/
   unsigned int j;       /*frames*/
   for (j=0;j<(unsigned)nframes;j++) {
     if(usejack) {
-      for (i=0;i<channels;i++) {
-        /* write input to datanew */
-        fvec_write_sample(ibuf, input[i][j], i, pos);
-        /* put synthnew in output */
-        output[i][j] = fvec_read_sample(obuf, i, pos);
-      }
+      /* write input to datanew */
+      fvec_write_sample(ibuf, input[0][j], pos);
+      /* put synthnew in output */
+      output[0][j] = fvec_read_sample(obuf, pos);
     }
     /*time for fft*/
@@ -44,6 +41,6 @@
       /* block loop */
       aubio_tempo_do (bt,ibuf,tempo_out);
-      istactus = fvec_read_sample (tempo_out, 0, 0);
-      isonset = fvec_read_sample (tempo_out, 0, 1);
+      istactus = fvec_read_sample (tempo_out, 0);
+      isonset = fvec_read_sample (tempo_out, 1);
       if (istactus > 0.) {
         fvec_copy (woodblock, obuf);
@@ -76,6 +73,6 @@
   examples_common_init(argc,argv);
 
-  tempo_out = new_fvec(2,channels);
-  bt = new_aubio_tempo(onset_mode,buffer_size,overlap_size,channels, samplerate);
+  tempo_out = new_fvec(2);
+  bt = new_aubio_tempo(onset_mode,buffer_size,overlap_size, samplerate);
   if (threshold != 0.) aubio_tempo_set_threshold (bt, threshold);
 
Index: examples/sndfileio.c
===================================================================
--- examples/sndfileio.c	(revision 40a05d3d6d7d3415e021d6a5ef39dc00bdfa43e8)
+++ examples/sndfileio.c	(revision 066433db7ff0966faf04a301b8562d0fd0dfd16e)
@@ -96,5 +96,5 @@
         aubio_sndfile_t * f = AUBIO_NEW(aubio_sndfile_t);
         f->samplerate    = fmodel->samplerate;
-        f->channels      = fmodel->channels;
+        f->channels      = 1; //fmodel->channels;
         f->format        = fmodel->format;
         aubio_sndfile_open_wo(f, outputname);
@@ -125,5 +125,5 @@
 /* read frames from file in data 
  *  return the number of frames actually read */
-int aubio_sndfile_read(aubio_sndfile_t * f, int frames, fvec_t * read) {
+int aubio_sndfile_read(aubio_sndfile_t * f, int frames, fvec_t ** read) {
         sf_count_t read_frames;
         int i,j, channels = f->channels;
@@ -150,5 +150,5 @@
         /* de-interleaving data  */
         for (i=0; i<channels; i++) {
-                pread = (smpl_t *)fvec_get_channel(read,i);
+                pread = (smpl_t *)fvec_get_data(read[i]);
                 for (j=0; j<aread; j++) {
                         pread[j] = (smpl_t)f->tmpdata[channels*j+i];
@@ -158,8 +158,47 @@
 }
 
+int
+aubio_sndfile_read_mono (aubio_sndfile_t * f, int frames, fvec_t * read)
+{
+  sf_count_t read_frames;
+  int i, j, channels = f->channels;
+  int nsamples = frames * channels;
+  int aread;
+  smpl_t *pread;
+
+  /* allocate data for de/interleaving reallocated when needed. */
+  if (nsamples >= f->size) {
+    AUBIO_ERR ("Maximum aubio_sndfile_read buffer size exceeded.");
+    return -1;
+    /*
+    AUBIO_FREE(f->tmpdata);
+    f->tmpdata = AUBIO_ARRAY(float,nsamples);
+    */
+  }
+  //f->size = nsamples;
+
+  /* do actual reading */
+  read_frames = sf_read_float (f->handle, f->tmpdata, nsamples);
+
+  aread = (int) FLOOR (read_frames / (float) channels);
+
+  /* de-interleaving data  */
+  pread = (smpl_t *) fvec_get_data (read);
+  for (i = 0; i < channels; i++) {
+    for (j = 0; j < aread; j++) {
+      pread[j] += (smpl_t) f->tmpdata[channels * j + i];
+    }
+  }
+  for (j = 0; j < aread; j++) {
+    pread[j] /= (smpl_t)channels;
+  }
+
+  return aread;
+}
+
 /* write 'frames' samples to file from data 
  *   return the number of frames actually written 
  */
-int aubio_sndfile_write(aubio_sndfile_t * f, int frames, fvec_t * write) {
+int aubio_sndfile_write(aubio_sndfile_t * f, int frames, fvec_t ** write) {
         sf_count_t written_frames = 0;
         int i, j,	channels = f->channels;
@@ -180,5 +219,5 @@
         /* interleaving data  */
         for (i=0; i<channels; i++) {
-                pwrite = (smpl_t *)fvec_get_channel(write,i);
+                pwrite = (smpl_t *)fvec_get_data(write[i]);
                 for (j=0; j<frames; j++) {
                         f->tmpdata[channels*j+i] = (float)pwrite[j];
Index: examples/sndfileio.h
===================================================================
--- examples/sndfileio.h	(revision 40a05d3d6d7d3415e021d6a5ef39dc00bdfa43e8)
+++ examples/sndfileio.h	(revision 066433db7ff0966faf04a301b8562d0fd0dfd16e)
@@ -49,9 +49,9 @@
  * Read frames data from file 
  */
-int aubio_sndfile_read(aubio_sndfile_t * file, int frames, fvec_t * read);
+int aubio_sndfile_read(aubio_sndfile_t * file, int frames, fvec_t ** read);
 /** 
  * Write data of length frames to file
  */
-int aubio_sndfile_write(aubio_sndfile_t * file, int frames, fvec_t * write);
+int aubio_sndfile_write(aubio_sndfile_t * file, int frames, fvec_t ** write);
 /**
  * Close file and delete file object
Index: examples/utils.c
===================================================================
--- examples/utils.c	(revision 40a05d3d6d7d3415e021d6a5ef39dc00bdfa43e8)
+++ examples/utils.c	(revision 066433db7ff0966faf04a301b8562d0fd0dfd16e)
@@ -61,5 +61,4 @@
 uint_t buffer_size = 512;       //1024;
 uint_t overlap_size = 256;      //512;
-uint_t channels = 1;
 uint_t samplerate = 44100;
 
@@ -217,5 +216,4 @@
     if (verbose)
       aubio_sndfile_info (file);
-    channels = aubio_sndfile_channels (file);
     samplerate = aubio_sndfile_samplerate (file);
     if (output_filename != NULL)
@@ -240,5 +238,5 @@
 #endif /* HAVE_LASH */
 
-  woodblock = new_fvec (overlap_size, channels);
+  woodblock = new_fvec (overlap_size);
   if (output_filename || usejack) {
     /* dummy assignement to keep egcs happy */
@@ -253,9 +251,9 @@
   if (onsetfile) {
     /* read the output sound once */
-    aubio_sndfile_read (onsetfile, overlap_size, woodblock);
-  }
-
-  ibuf = new_fvec (overlap_size, channels);
-  obuf = new_fvec (overlap_size, channels);
+    aubio_sndfile_read_mono (onsetfile, overlap_size, woodblock);
+  }
+
+  ibuf = new_fvec (overlap_size);
+  obuf = new_fvec (overlap_size);
 
 }
@@ -265,4 +263,5 @@
 examples_common_del (void)
 {
+  uint_t i;
   del_fvec (ibuf);
   del_fvec (obuf);
@@ -283,5 +282,5 @@
 #if HAVE_JACK
     debug ("Jack init ...\n");
-    jack_setup = new_aubio_jack (channels, channels,
+    jack_setup = new_aubio_jack (1, 1,
         0, 1, (aubio_process_func_t) process_func);
     debug ("Jack activation ...\n");
@@ -301,10 +300,10 @@
     frames = 0;
 
-    while ((signed) overlap_size == aubio_sndfile_read (file, overlap_size,
-            ibuf)) {
-      process_func (ibuf->data, obuf->data, overlap_size);
+    while ((signed) overlap_size ==
+        aubio_sndfile_read_mono (file, overlap_size, ibuf)) {
+      process_func (&ibuf->data, &obuf->data, overlap_size);
       print ();
       if (output_filename != NULL) {
-        aubio_sndfile_write (fileout, overlap_size, obuf);
+        aubio_sndfile_write (fileout, overlap_size, &obuf);
       }
       frames++;
@@ -328,5 +327,5 @@
   fvec_zeros(obuf);
   for (i = 0; (signed) i < frames_delay; i++) {
-    process_func (ibuf->data, obuf->data, overlap_size);
+    process_func (&ibuf->data, &obuf->data, overlap_size);
     print ();
   }
Index: examples/utils.h
===================================================================
--- examples/utils.h	(revision 40a05d3d6d7d3415e021d6a5ef39dc00bdfa43e8)
+++ examples/utils.h	(revision 066433db7ff0966faf04a301b8562d0fd0dfd16e)
@@ -74,5 +74,4 @@
 extern uint_t buffer_size;
 extern uint_t overlap_size;
-extern uint_t channels;
 extern uint_t samplerate;
 
