Index: src/pitch/pitchfcomb.c
===================================================================
--- src/pitch/pitchfcomb.c	(revision 6fc103d0a4da457b93fec9313e308736b710127f)
+++ src/pitch/pitchfcomb.c	(revision 8040cca046cbd323278918c2fdea8c83f75abe44)
@@ -28,5 +28,5 @@
 
 typedef struct {
-  smpl_t freq;
+  smpl_t bin;
   smpl_t db;
 } aubio_fpeak_t;
@@ -41,16 +41,14 @@
   fvec_t * fftLastPhase;
   aubio_fft_t * fft;
-  //aubio_pvoc_t * pvoc;
 };
 
-aubio_pitchfcomb_t * new_aubio_pitchfcomb (uint_t bufsize, uint_t hopsize, uint_t samplerate)
+aubio_pitchfcomb_t * new_aubio_pitchfcomb (uint_t bufsize, uint_t hopsize, uint_t channels)
 {
   aubio_pitchfcomb_t * p = AUBIO_NEW(aubio_pitchfcomb_t);
-  p->rate         = samplerate;
   p->fftSize      = bufsize;
   p->stepSize     = hopsize;
   p->winput       = new_fvec(bufsize,1);
   p->fftOut       = new_cvec(bufsize,1);
-  p->fftLastPhase = new_fvec(bufsize,1);
+  p->fftLastPhase = new_fvec(bufsize, channels);
   p->fft = new_aubio_fft(bufsize, 1);
   p->win = new_aubio_window(bufsize, aubio_win_hanning);
@@ -59,18 +57,19 @@
 
 /* input must be stepsize long */
-smpl_t aubio_pitchfcomb_do (aubio_pitchfcomb_t * p, fvec_t * input)
+void aubio_pitchfcomb_do (aubio_pitchfcomb_t * p, fvec_t * input, fvec_t * output)
 {
-  uint_t k, l, maxharm = 0;
-  smpl_t freqPerBin = p->rate/(smpl_t)p->fftSize,
-    phaseDifference = TWO_PI*(smpl_t)p->stepSize/(smpl_t)p->fftSize;
+  uint_t i, k, l, maxharm = 0;
+  smpl_t phaseDifference = TWO_PI*(smpl_t)p->stepSize/(smpl_t)p->fftSize;
   aubio_fpeak_t peaks[MAX_PEAKS];
+
+  for (i = 0; i < input->channels; i++) {
 
   for (k=0; k<MAX_PEAKS; k++) {
     peaks[k].db = -200.;
-    peaks[k].freq = 0.;
+    peaks[k].bin = 0.;
   }
 
   for (k=0; k < input->length; k++){
-    p->winput->data[0][k] = p->win->data[0][k] * input->data[0][k];
+    p->winput->data[0][k] = p->win->data[0][k] * input->data[i][k];
   }
   aubio_fft_do(p->fft,p->winput,p->fftOut);
@@ -80,9 +79,9 @@
       magnitude = 20.*LOG10(2.*p->fftOut->norm[0][k]/(smpl_t)p->fftSize),
       phase     = p->fftOut->phas[0][k],
-      tmp, freq;
+      tmp, bin;
 
     /* compute phase difference */
-    tmp = phase - p->fftLastPhase->data[0][k];
-    p->fftLastPhase->data[0][k] = phase;
+    tmp = phase - p->fftLastPhase->data[i][k];
+    p->fftLastPhase->data[i][k] = phase;
 
     /* subtract expected phase difference */
@@ -95,10 +94,10 @@
     tmp = p->fftSize/(smpl_t)p->stepSize*tmp/(TWO_PI);
 
-    /* compute the k-th partials' true frequency */
-    freq = (smpl_t)k*freqPerBin + tmp*freqPerBin;
+    /* compute the k-th partials' true bin */
+    bin = (smpl_t)k + tmp;
 
-    if (freq > 0.0 && magnitude > peaks[0].db) { // && magnitude < 0) {
+    if (bin > 0.0 && magnitude > peaks[0].db) { // && magnitude < 0) {
       memmove(peaks+1, peaks, sizeof(aubio_fpeak_t)*(MAX_PEAKS-1));
-      peaks[0].freq = freq;
+      peaks[0].bin = bin;
       peaks[0].db = magnitude;
     }
@@ -106,9 +105,9 @@
 
   k = 0;
-  for (l=1; l<MAX_PEAKS && peaks[l].freq > 0.0; l++) {
+  for (l=1; l<MAX_PEAKS && peaks[l].bin > 0.0; l++) {
     sint_t harmonic;
     for (harmonic=5; harmonic>1; harmonic--) {
-      if (peaks[0].freq / peaks[l].freq < harmonic+.02 &&
-          peaks[0].freq / peaks[l].freq > harmonic-.02) {
+      if (peaks[0].bin / peaks[l].bin < harmonic+.02 &&
+          peaks[0].bin / peaks[l].bin > harmonic-.02) {
         if (harmonic > (sint_t)maxharm &&
             peaks[0].db < peaks[l].db/2) {
@@ -119,7 +118,8 @@
     }
   }
+  output->data[i][0] = peaks[k].bin;
   /* quick hack to clean output a bit */
-  if (peaks[k].freq > 5000.) return 0.;
-  return peaks[k].freq;
+  if (peaks[k].bin > 5000.) output->data[i][0] = 0.;
+  }
 }
 
Index: src/pitch/pitchfcomb.h
===================================================================
--- src/pitch/pitchfcomb.h	(revision 6fc103d0a4da457b93fec9313e308736b710127f)
+++ src/pitch/pitchfcomb.h	(revision 8040cca046cbd323278918c2fdea8c83f75abe44)
@@ -46,15 +46,16 @@
   \param p pitch detection object as returned by new_aubio_pitchfcomb
   \param input input signal window (length as specified at creation time) 
+  \param output pitch candidates in bins
  
 */
-smpl_t aubio_pitchfcomb_do (aubio_pitchfcomb_t *p, fvec_t * input);
+void aubio_pitchfcomb_do (aubio_pitchfcomb_t *p, fvec_t * input, fvec_t * output);
 /** creation of the pitch detection object
  
   \param bufsize size of the input buffer to analyse 
   \param hopsize step size between two consecutive analysis instant 
-  \param samplerate sampling rate of the signal 
+  \param channels number of channels to detect pitch on
  
 */
-aubio_pitchfcomb_t * new_aubio_pitchfcomb (uint_t bufsize, uint_t hopsize, uint_t samplerate);
+aubio_pitchfcomb_t * new_aubio_pitchfcomb (uint_t bufsize, uint_t hopsize, uint_t channels);
 /** deletion of the pitch detection object
  
Index: tests/src/test-pitchfcomb.c
===================================================================
--- tests/src/test-pitchfcomb.c	(revision 6fc103d0a4da457b93fec9313e308736b710127f)
+++ tests/src/test-pitchfcomb.c	(revision 8040cca046cbd323278918c2fdea8c83f75abe44)
@@ -5,14 +5,13 @@
         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 */
+        uint_t channels   = 3;                          /* number of channel */
         fvec_t * in       = new_fvec (hop_s, channels); /* input buffer */
+        fvec_t * out      = new_fvec (1, channels);
         aubio_pitchfcomb_t * o  = new_aubio_pitchfcomb (
-          win_s, hop_s, samplerate
-          );
+          win_s, hop_s, channels);
         uint_t i = 0;
 
-        while (i < 1000) {
-          aubio_pitchfcomb_do (o,in);
+        while (i < 2) {
+          aubio_pitchfcomb_do (o,in, out);
           i++;
         };
