Index: .travis.yml
===================================================================
--- .travis.yml	(revision fa5d8add56f38a464e156e98e0c23e4f2cc4b9c5)
+++ .travis.yml	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
@@ -54,9 +54,9 @@
       os: osx
       compiler: clang
-      env: ARCH=x86_64 WAFOPTS=--enable-fat
+      env: ARCH=x86_64 WAFOPTS="--enable-fat --disable-sndfile --disable-samplerate --disable-rubberband"
     - language: C
       os: osx
       compiler: clang
-      env: ARCH=i386 WAFOPTS=--enable-fat
+      env: ARCH=i386 WAFOPTS="--enable-fat --disable-sndfile --disable-samplerate --disable-rubberband"
 
 addons:
@@ -69,4 +69,5 @@
     - libasound2-dev
     - libfftw3-dev
+    - librubberband-dev
     - sox
 
@@ -75,5 +76,5 @@
      if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
        brew update
-       brew install sox
+       brew install sox libsamplerate libsndfile rubberband
        export PATH="$HOME/Library/Python/2.7/bin/:$PATH"
      fi;
Index: python/demos/demo_pitchshift.py
===================================================================
--- python/demos/demo_pitchshift.py	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
+++ python/demos/demo_pitchshift.py	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
@@ -0,0 +1,52 @@
+#! /usr/bin/env python
+
+import sys
+import aubio
+
+if __name__ == '__main__':
+    if len(sys.argv) < 3:
+        print('usage: %s <inputfile> <outputfile> [transpose] [samplerate] [hop_size] [mode]' % sys.argv[0])
+        print('available modes: default, crispness:0, crispness:1, ... crispness:6')
+        sys.exit(1)
+    if len(sys.argv) > 3: transpose = float(sys.argv[3])
+    else: transpose = 12.
+    if len(sys.argv) > 4: samplerate = int(sys.argv[4])
+    else: samplerate = 0
+    if len(sys.argv) > 5: hop_size = int(sys.argv[5])
+    else: hop_size = 64
+    if len(sys.argv) > 6: mode = sys.argv[6]
+    else: mode = "default"
+
+    source_read = aubio.source(sys.argv[1], samplerate, hop_size)
+    if samplerate == 0: samplerate = source_read.samplerate
+    sink_out = aubio.sink(sys.argv[2], samplerate)
+
+    pitchshifter = aubio.pitchshift(mode, 1., hop_size, samplerate)
+    if transpose: pitchshifter.set_transpose(transpose)
+
+    total_frames, read = 0, hop_size
+    transpose_range = 23.9
+    while read:
+        vec, read = source_read()
+        # transpose the samples
+        out = pitchshifter(vec)
+        # position in the file (between 0. and 1.)
+        percent_read = total_frames / float(source_read.duration)
+        # variable transpose rate (in semitones)
+        transpose = 2 * transpose_range * percent_read - transpose_range
+        # set transpose rate
+        pitchshifter.set_transpose(transpose)
+        # print the transposition
+        #print pitchshifter.get_transpose()
+        # write the output
+        sink_out(out, read)
+        total_frames += read
+
+    # end of file, print some results
+    outstr = "wrote %.2fs" % (total_frames / float(samplerate))
+    outstr += " (%d frames in" % total_frames
+    outstr += " %d blocks" % (total_frames // source_read.hop_size)
+    outstr += " at %dHz)" % source_read.samplerate
+    outstr += " from " + source_read.uri
+    outstr += " to " + sink_out.uri
+    print(outstr)
Index: python/lib/gen_code.py
===================================================================
--- python/lib/gen_code.py	(revision fa5d8add56f38a464e156e98e0c23e4f2cc4b9c5)
+++ python/lib/gen_code.py	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
@@ -20,4 +20,5 @@
     'method': '"default"',
     'uri': '"none"',
+    'pitchscale': '1.',
     }
 
@@ -83,4 +84,5 @@
         'filterbank': 'self->n_filters',
         'tss': 'self->buf_size',
+        'pitchshift': 'self->hop_size',
         }
 
@@ -95,4 +97,5 @@
         'wavetable': 'self->hop_size',
         'tss': 'self->buf_size / 2 + 1',
+        'pitchshift': 'self->hop_size',
         }
 
@@ -266,4 +269,6 @@
         if p['type'] == 'char_t*':
             return self.check_valid_char(p)
+        if p['type'] == 'smpl_t':
+            return self.check_valid_smpl(p)
         else:
             print ("ERROR, no idea how to check %s for validity" % p['type'])
@@ -286,4 +291,13 @@
     self->{name} = {defval};
     if ({name} != NULL) {{
+        self->{name} = {name};
+    }}
+""".format(defval = aubiodefvalue[name], name = name)
+
+    def check_valid_smpl(self, p):
+        name = p['name']
+        return """
+    self->{name} = {defval};
+    if ({name} != 0.) {{
         self->{name} = {name};
     }}
Index: python/lib/moresetuptools.py
===================================================================
--- python/lib/moresetuptools.py	(revision fa5d8add56f38a464e156e98e0c23e4f2cc4b9c5)
+++ python/lib/moresetuptools.py	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
@@ -74,4 +74,5 @@
                 'jack',
                 'sndfile', 'samplerate',
+                'rubberband',
                 #'fftw3f',
                ]
@@ -88,4 +89,6 @@
     if 'samplerate' in ext.libraries:
         ext.define_macros += [('HAVE_SAMPLERATE', 1)]
+    if 'rubberband' in ext.libraries:
+        ext.define_macros += [('HAVE_RUBBERBAND', 1)]
     if 'fftw3f' in ext.libraries:
         ext.define_macros += [('HAVE_FFTW3F', 1)]
Index: python/tests/test_pitchshift.py
===================================================================
--- python/tests/test_pitchshift.py	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
+++ python/tests/test_pitchshift.py	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
@@ -0,0 +1,96 @@
+#! /usr/bin/env python
+
+from numpy.testing import TestCase
+from nose2.tools import params
+import numpy as np
+import aubio
+
+class aubio_pitchshift(TestCase):
+
+    def setUp(self):
+        try:
+            self.o = aubio.pitchshift(hop_size = 128)
+        except RuntimeError as e:
+            self.skipTest("creating aubio.pitchshift failed (recompile with rubberband?)")
+
+    def test_default_creation(self):
+        self.assertEqual(self.o.get_pitchscale(), 1)
+        self.assertEqual(self.o.get_transpose(), 0)
+
+    def test_on_zeros(self):
+        test_length = self.o.hop_size * 100
+        read = 0
+        # test on zeros
+        vec = aubio.fvec(self.o.hop_size)
+        transpose_range = 24
+        while read < test_length:
+            # transpose the samples
+            out = self.o(vec)
+            self.assertTrue((out == 0).all())
+            # position in the file (between 0. and 1.)
+            percent_read = read / float(test_length)
+            # variable transpose rate (in semitones)
+            transpose = 2 * transpose_range * percent_read - transpose_range
+            # set transpose rate
+            self.o.set_transpose(transpose)
+            read += len(vec)
+
+    def test_on_ones(self):
+        test_length = self.o.hop_size * 100
+        read = 0
+        # test on zeros
+        vec = aubio.fvec(self.o.hop_size) + 1
+        transpose_range = 1.24
+        while read < test_length:
+            # transpose the samples
+            out = self.o(vec)
+            # position in the file (between 0. and 1.)
+            percent_read = read / float(test_length)
+            # variable transpose rate (in semitones)
+            transpose = 2 * transpose_range * percent_read - transpose_range
+            # set transpose rate
+            self.o.set_transpose(transpose)
+            read += len(vec)
+
+    def test_transpose_too_high(self):
+        with self.assertRaises(ValueError):
+            self.o.set_transpose(24.3)
+
+    def test_transpose_too_low(self):
+        with self.assertRaises(ValueError):
+            self.o.set_transpose(-24.3)
+
+
+class aubio_pitchshift_testruns(TestCase):
+
+    @params(
+            ("default",     1.2,  128,  44100),
+            ("crispness:0", 0.43,  64,   8000),
+            ("crispness:3", 0.53, 256,   8000),
+            ("crispness:3", 1.53, 512,   8000),
+            ("crispness:6", 2.3, 4096, 192000),
+            )
+    def test_run_with_params(self, mode, pitchscale, hop_size, samplerate):
+        try:
+            self.o = aubio.pitchshift(mode, pitchscale, hop_size, samplerate)
+        except RuntimeError as e:
+            self.skipTest("creating aubio.pitchshift failed (recompile with rubberband?)")
+        test_length = self.o.hop_size * 50
+        read = 0
+        # test on random
+        vec = np.random.rand(self.o.hop_size).astype(aubio.float_type)
+        transpose_range = self.o.get_transpose()
+        while read < test_length:
+            # transpose the samples
+            out = self.o(vec)
+            # position in the file (between 0. and 1.)
+            percent_read = read / float(test_length)
+            # variable transpose rate (in semitones)
+            transpose =  transpose_range - 2 * transpose_range * percent_read
+            # set transpose rate
+            self.o.set_transpose(transpose)
+            read += len(vec)
+
+if __name__ == '__main__':
+    from nose2 import main
+    main()
Index: src/aubio.h
===================================================================
--- src/aubio.h	(revision fa5d8add56f38a464e156e98e0c23e4f2cc4b9c5)
+++ src/aubio.h	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
@@ -208,4 +208,5 @@
 #include "pitch/pitchspecacf.h"
 #include "tempo/beattracking.h"
+#include "effects/pitchshift.h"
 #include "utils/scale.h"
 #include "utils/hist.h"
Index: src/effects/pitchshift.c
===================================================================
--- src/effects/pitchshift.c	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
+++ src/effects/pitchshift.c	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
@@ -0,0 +1,232 @@
+/*
+  Copyright (C) 2016 Paul Brossier <piem@aubio.org>
+
+  This file is part of aubio.
+
+  aubio is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  aubio is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with aubio.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "config.h"
+#include "aubio_priv.h"
+#include "fvec.h"
+#include "effects/pitchshift.h"
+
+#ifdef HAVE_RUBBERBAND
+
+#include "rubberband/rubberband-c.h"
+
+// check rubberband is 1.8.1, warn if 1.3
+#if !((RUBBERBAND_API_MAJOR_VERSION >= 2) && \
+    (RUBBERBAND_API_MINOR_VERSION >= 5))
+#warning RubberBandOptionDetectorSoft not available, \
+ please upgrade rubberband to version 1.8.1 or higher
+#define RubberBandOptionDetectorSoft 0x00000000
+#endif
+
+/** generic pitch shifting structure */
+struct _aubio_pitchshift_t
+{
+  uint_t samplerate;              /**< samplerate */
+  uint_t hopsize;                 /**< hop size */
+  smpl_t timeratio;               /**< time ratio */
+  smpl_t pitchscale;              /**< pitch scale */
+
+  RubberBandState rb;
+  RubberBandOptions rboptions;
+};
+
+aubio_pitchshift_t *
+new_aubio_pitchshift (const char_t * mode,
+    smpl_t pitchscale, uint_t hopsize, uint_t samplerate)
+{
+  aubio_pitchshift_t *p = AUBIO_NEW (aubio_pitchshift_t);
+  p->samplerate = samplerate;
+  p->hopsize = hopsize;
+  p->timeratio = 1.;
+  p->pitchscale = pitchscale;
+
+  p->rboptions = RubberBandOptionProcessRealTime;
+
+  if ( strcmp(mode,"crispness:0") == 0 ) {
+    p->rboptions |= RubberBandOptionTransientsSmooth;
+    p->rboptions |= RubberBandOptionWindowLong;
+    p->rboptions |= RubberBandOptionPhaseIndependent;
+  } else if ( strcmp(mode, "crispness:1") == 0 ) {
+    p->rboptions |= RubberBandOptionDetectorSoft;
+    p->rboptions |= RubberBandOptionTransientsSmooth;
+    p->rboptions |= RubberBandOptionWindowLong;
+    p->rboptions |= RubberBandOptionPhaseIndependent;
+  } else if ( strcmp(mode, "crispness:2") == 0 ) {
+    p->rboptions |= RubberBandOptionTransientsSmooth;
+    p->rboptions |= RubberBandOptionPhaseIndependent;
+  } else if ( strcmp(mode, "crispness:3") == 0 ) {
+    p->rboptions |= RubberBandOptionTransientsSmooth;
+  } else if ( strcmp(mode, "crispness:4") == 0 ) {
+    // same as "default"
+  } else if ( strcmp(mode, "crispness:5") == 0 ) {
+    p->rboptions |= RubberBandOptionTransientsCrisp;
+  } else if ( strcmp(mode, "crispness:6") == 0 ) {
+    p->rboptions |= RubberBandOptionTransientsCrisp;
+    p->rboptions |= RubberBandOptionWindowShort;
+    p->rboptions |= RubberBandOptionPhaseIndependent;
+  } else if ( strcmp(mode, "default") == 0 ) {
+    // nothing to do
+  } else {
+    AUBIO_ERR("pitchshift: unknown pitch shifting method %s\n", mode);
+    goto beach;
+  }
+  //AUBIO_MSG("pitchshift: using pitch shifting method %s\n", mode);
+
+  //p->rboptions |= RubberBandOptionTransientsCrisp;
+  //p->rboptions |= RubberBandOptionWindowStandard;
+  //p->rboptions |= RubberBandOptionSmoothingOff;
+  //p->rboptions |= RubberBandOptionFormantShifted;
+  //p->rboptions |= RubberBandOptionPitchHighConsistency;
+  p->rb = rubberband_new(samplerate, 1, p->rboptions, p->timeratio, p->pitchscale);
+  rubberband_set_max_process_size(p->rb, p->hopsize);
+  //rubberband_set_debug_level(p->rb, 10);
+
+#if 1
+  // warm up rubber band
+  unsigned int latency = MAX(p->hopsize, rubberband_get_latency(p->rb));
+  int available = rubberband_available(p->rb);
+  fvec_t *zeros = new_fvec(p->hopsize);
+  while (available <= (int)latency) {
+    rubberband_process(p->rb, (const float* const*)&(zeros->data), p->hopsize, 0);
+    available = rubberband_available(p->rb);
+  }
+  del_fvec(zeros);
+#endif
+
+  return p;
+
+beach:
+  del_aubio_pitchshift(p);
+  return NULL;
+}
+
+void
+del_aubio_pitchshift (aubio_pitchshift_t * p)
+{
+  if (p->rb) {
+    rubberband_delete(p->rb);
+  }
+  AUBIO_FREE (p);
+}
+
+uint_t aubio_pitchshift_get_latency (aubio_pitchshift_t * p) {
+  return rubberband_get_latency(p->rb);
+}
+
+uint_t
+aubio_pitchshift_set_pitchscale (aubio_pitchshift_t * p, smpl_t pitchscale)
+{
+  if (pitchscale >= 0.0625  && pitchscale <= 4.) {
+    p->pitchscale = pitchscale;
+    rubberband_set_pitch_scale(p->rb, p->pitchscale);
+    return AUBIO_OK;
+  } else {
+    AUBIO_ERR("pitchshift: could not set pitchscale to %.2f\n", pitchscale);
+    return AUBIO_FAIL;
+  }
+}
+
+smpl_t
+aubio_pitchshift_get_pitchscale (aubio_pitchshift_t * p)
+{
+  return p->pitchscale;
+}
+
+uint_t
+aubio_pitchshift_set_transpose(aubio_pitchshift_t * p, smpl_t transpose)
+{
+  if (transpose >= -24. && transpose <= 24.) {
+    smpl_t pitchscale = POW(2., transpose / 12.);
+    return aubio_pitchshift_set_pitchscale(p, pitchscale);
+  } else {
+    AUBIO_ERR("pitchshift: could not set transpose to %.2f\n", transpose);
+    return AUBIO_FAIL;
+  }
+}
+
+smpl_t
+aubio_pitchshift_get_transpose(aubio_pitchshift_t * p)
+{
+  return 12. * LOG(p->pitchscale) / LOG(2.0);
+}
+
+void
+aubio_pitchshift_do (aubio_pitchshift_t * p, const fvec_t * in, fvec_t * out)
+{
+  int output = 0;
+  rubberband_process(p->rb, (const float* const*)&(in->data), p->hopsize, output);
+  if (rubberband_available(p->rb) >= (int)p->hopsize) {
+    rubberband_retrieve(p->rb, (float* const*)&(out->data), p->hopsize);
+  } else {
+    AUBIO_WRN("pitchshift: catching up with zeros, only %d available, needed: %d, "
+        "current pitchscale: %f\n",
+        rubberband_available(p->rb), p->hopsize, p->pitchscale);
+    fvec_zeros(out);
+  }
+}
+
+#else
+
+// TODO fallback pitch shifting implementation
+
+struct _aubio_pitchshift_t
+{
+  void *dummy;
+};
+
+void aubio_pitchshift_do (aubio_pitchshift_t * o UNUSED, const fvec_t * in UNUSED,
+    fvec_t * out UNUSED) {
+}
+
+void del_aubio_pitchshift (aubio_pitchshift_t * o UNUSED) {
+}
+
+aubio_pitchshift_t *new_aubio_pitchshift (const char_t * method UNUSED,
+    smpl_t pitchscale UNUSED, uint_t hop_size UNUSED, uint_t samplerate UNUSED)
+{
+  AUBIO_ERR ("aubio was not compiled with rubberband\n");
+  return NULL;
+}
+
+uint_t aubio_pitchshift_set_pitchscale (aubio_pitchshift_t * o UNUSED, smpl_t pitchscale UNUSED)
+{
+  return AUBIO_FAIL;
+}
+
+smpl_t aubio_pitchshift_get_pitchscale (aubio_pitchshift_t * o UNUSED)
+{
+  return 1.;
+}
+
+uint_t aubio_pitchshift_set_transpose (aubio_pitchshift_t * o UNUSED, smpl_t transpose UNUSED) {
+  return AUBIO_FAIL;
+}
+
+smpl_t aubio_pitchshift_get_transpose (aubio_pitchshift_t * o UNUSED) {
+  return 0.;
+}
+
+uint_t aubio_pitchshift_get_latency (aubio_pitchshift_t * o UNUSED) {
+  return 0.;
+}
+
+// end of dummy implementation
+
+#endif /* HAVE_RUBBERBAND */
Index: src/effects/pitchshift.h
===================================================================
--- src/effects/pitchshift.h	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
+++ src/effects/pitchshift.h	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
@@ -0,0 +1,122 @@
+/*
+  Copyright (C) 2016 Paul Brossier <piem@aubio.org>
+
+  This file is part of aubio.
+
+  aubio is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  aubio is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with aubio.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef AUBIO_PITCHSHIFT_H
+#define AUBIO_PITCHSHIFT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** \file
+
+  Pitch shifting object
+
+  This file ...
+
+  \example effects/test-pitchshift.c
+
+*/
+
+/** pitch shifting object */
+typedef struct _aubio_pitchshift_t aubio_pitchshift_t;
+
+/** execute pitch shifting on an input signal frame
+
+  \param o pitch shifting object as returned by new_aubio_pitchshift()
+  \param in input signal of size [hop_size]
+  \param out output pitch candidates of size [1]
+
+*/
+void aubio_pitchshift_do (aubio_pitchshift_t * o, const fvec_t * in, fvec_t * out);
+
+/** deletion of the pitch shifting object
+
+  \param o pitch shifting object as returned by new_aubio_pitchshift()
+
+*/
+void del_aubio_pitchshift (aubio_pitchshift_t * o);
+
+/** creation of the pitch shifting object
+
+  \param method set pitch shifting algorithm ("default")
+  \param pitchscale initial pitch scaling factor
+  \param hop_size step size between two consecutive analysis instant
+  \param samplerate sampling rate of the signal
+
+  \return newly created ::aubio_pitchshift_t
+
+*/
+aubio_pitchshift_t *new_aubio_pitchshift (const char_t * method,
+    smpl_t pitchscale, uint_t hop_size, uint_t samplerate);
+
+/** get the latency of the pitch shifting object, in samples
+
+  \param o pitch shifting object as returned by ::new_aubio_pitchshift()
+
+  \return latency of the pitch shifting object in samples
+
+*/
+uint_t aubio_pitchshift_get_latency (aubio_pitchshift_t * o);
+
+/** set the pitch scale of the pitch shifting object
+
+  \param o pitch shifting object as returned by new_aubio_pitchshift()
+  \param pitchscale new pitch scale of the pitch shifting object
+
+  \return 0 if successfull, non-zero otherwise
+
+*/
+uint_t aubio_pitchshift_set_pitchscale (aubio_pitchshift_t * o, smpl_t pitchscale);
+
+/** get the pitchscale of the pitch shifting object
+
+  \param o pitch shifting object as returned by ::new_aubio_pitchshift()
+
+  \return pitchscale of the pitch shifting object
+
+*/
+smpl_t aubio_pitchshift_get_pitchscale (aubio_pitchshift_t * o);
+
+/** set the transposition of the pitch shifting object, in semitones
+
+  \param o pitch shifting object as returned by new_aubio_pitchshift()
+  \param transpose new pitch transposition of the pitch shifting object, expressed
+  in semitones (should be in the range [-24;+24])
+
+  \return 0 if successfull, non-zero otherwise
+
+*/
+uint_t aubio_pitchshift_set_transpose (aubio_pitchshift_t * o, smpl_t transpose);
+
+/** get the transposition of the pitch shifting object, in semitones
+
+  \param o pitch shifting object as returned by ::new_aubio_pitchshift()
+
+  \return transposition of the pitch shifting object, in semitones
+
+*/
+smpl_t aubio_pitchshift_get_transpose (aubio_pitchshift_t * o);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* AUBIO_PITCHSHIFT_H */
Index: src/wscript_build
===================================================================
--- src/wscript_build	(revision fa5d8add56f38a464e156e98e0c23e4f2cc4b9c5)
+++ src/wscript_build	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
@@ -6,4 +6,5 @@
 uselib += ['SAMPLERATE']
 uselib += ['SNDFILE']
+uselib += ['RUBBERBAND']
 uselib += ['AVCODEC']
 uselib += ['AVFORMAT']
Index: tests/src/effects/test-pitchshift.c
===================================================================
--- tests/src/effects/test-pitchshift.c	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
+++ tests/src/effects/test-pitchshift.c	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
@@ -0,0 +1,76 @@
+#define AUBIO_UNSTABLE 1
+#include <aubio.h>
+#include "utils_tests.h"
+
+int main (int argc, char **argv)
+{
+  sint_t err = 0;
+
+  if (argc < 3) {
+    err = 2;
+    PRINT_ERR("not enough arguments\n");
+    PRINT_MSG("usage: %s <input_path> <output_path> [samplerate] [hop_size]\n", argv[0]);
+    return err;
+  }
+
+#ifdef HAVE_RUBBERBAND
+  uint_t samplerate = 0;
+  uint_t hop_size = 256;
+  smpl_t pitchscale = 1.;
+  uint_t n_frames = 0, read = 0;
+
+  char_t *source_path = argv[1];
+  char_t *sink_path = argv[2];
+
+  if ( argc >= 4 ) samplerate = atoi(argv[3]);
+  if ( argc >= 5 ) hop_size = atoi(argv[4]);
+  if ( argc >= 6 ) pitchscale = atof(argv[5]);
+  if ( argc >= 7 ) {
+    err = 2;
+    PRINT_ERR("too many arguments\n");
+    return err;
+  }
+
+  fvec_t *vec = new_fvec(hop_size);
+  fvec_t *out = new_fvec(hop_size);
+  if (!vec) { err = 1; goto beach_fvec; }
+
+  aubio_source_t *i = new_aubio_source(source_path, samplerate, hop_size);
+  if (!i) { err = 1; goto beach_source; }
+
+  if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(i);
+
+  aubio_sink_t *o = new_aubio_sink(sink_path, samplerate);
+  if (!o) { err = 1; goto beach_sink; }
+
+  aubio_pitchshift_t *ps = new_aubio_pitchshift("default", pitchscale, hop_size, samplerate);
+  //aubio_pitchshift_set_pitchscale(ps, pitchscale);
+
+  int k = 0;
+  do {
+    aubio_source_do(i, vec, &read);
+    aubio_pitchshift_set_transpose(ps, (float)(k-50) / 100.);
+    aubio_pitchshift_do(ps, vec, out);
+    aubio_sink_do(o, out, read);
+    k ++;
+    n_frames += read;
+  } while ( read == hop_size );
+
+  PRINT_MSG("read %d frames at %dHz (%d blocks) from %s written to %s\n",
+      n_frames, samplerate, n_frames / hop_size,
+      source_path, sink_path);
+
+  del_aubio_pitchshift(ps);
+  del_aubio_sink(o);
+beach_sink:
+  del_aubio_source(i);
+beach_source:
+  del_fvec(vec);
+  del_fvec(out);
+beach_fvec:
+#else /* HAVE_RUBBERBAND */
+  err = 3;
+  PRINT_ERR("aubio was not compiled with rubberband\n");
+#endif /* HAVE_RUBBERBAND */
+  return err;
+}
Index: wscript
===================================================================
--- wscript	(revision fa5d8add56f38a464e156e98e0c23e4f2cc4b9c5)
+++ wscript	(revision 8ba8bbeafd0abc42e7edf8735bf73180d92b59b3)
@@ -69,4 +69,7 @@
             help_str = 'compile with samplerate (auto)',
             help_disable_str = 'disable samplerate')
+    add_option_enable_disable(ctx, 'rubberband', default = None,
+            help_str = 'compile with rubberband (auto)',
+            help_disable_str = 'disable rubberband')
     add_option_enable_disable(ctx, 'memcpy', default = True,
             help_str = 'use memcpy hacks (default)',
@@ -260,4 +263,10 @@
                 mandatory = ctx.options.enable_samplerate)
 
+    # check for librubberband
+    if (ctx.options.enable_rubberband != False):
+        ctx.check_cfg(package = 'rubberband', atleast_version = '1.3',
+                args = '--cflags --libs',
+                mandatory = ctx.options.enable_rubberband)
+
     # check for jack
     if (ctx.options.enable_jack != False):
