Index: python/ext/aubiomodule.c
===================================================================
--- python/ext/aubiomodule.c	(revision bfe8256155757161c8d96033b2c000685a63e001)
+++ python/ext/aubiomodule.c	(revision b5bef11ddd1694ea7702e2d182769ca4605c91c0)
@@ -96,7 +96,7 @@
   }
 
-  vec = PyAubio_ArrayToCFvec (input);
-
-  if (vec == NULL) {
+  vec = (fvec_t *)malloc(sizeof(fvec_t));
+  if (!PyAubio_ArrayToCFvec(input, vec)) {
+    free(vec);
     return NULL;
   }
@@ -104,4 +104,5 @@
   // compute the function
   result = Py_BuildValue ("f", fvec_alpha_norm (vec, alpha));
+  free(vec);
   if (result == NULL) {
     return NULL;
@@ -186,7 +187,7 @@
   }
 
-  vec = PyAubio_ArrayToCFvec (input);
-
-  if (vec == NULL) {
+  vec = (fvec_t *)malloc(sizeof(fvec_t));
+  if (!PyAubio_ArrayToCFvec(input, vec)) {
+    free(vec);
     return NULL;
   }
@@ -194,4 +195,5 @@
   // compute the function
   result = Py_BuildValue ("f", aubio_zero_crossing_rate (vec));
+  free(vec);
   if (result == NULL) {
     return NULL;
@@ -215,7 +217,7 @@
   }
 
-  vec = PyAubio_ArrayToCFvec (input);
-
-  if (vec == NULL) {
+  vec = (fvec_t *)malloc(sizeof(fvec_t));
+  if (!PyAubio_ArrayToCFvec(input, vec)) {
+    free(vec);
     return NULL;
   }
Index: python/ext/py-fft.c
===================================================================
--- python/ext/py-fft.c	(revision bfe8256155757161c8d96033b2c000685a63e001)
+++ python/ext/py-fft.c	(revision b5bef11ddd1694ea7702e2d182769ca4605c91c0)
@@ -8,5 +8,8 @@
   aubio_fft_t * o;
   uint_t win_s;
+  fvec_t *vecin;
   cvec_t *out;
+  Py_cvec *py_out;
+  cvec_t *cvecin;
   fvec_t *rout;
 } Py_fft;
@@ -53,5 +56,11 @@
     return -1;
   }
+
+  self->cvecin = (cvec_t *)malloc(sizeof(cvec_t));
+  self->vecin = (fvec_t *)malloc(sizeof(fvec_t));
+
   self->out = new_cvec(self->win_s);
+  self->py_out = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType);
+  Py_XINCREF(self->py_out);
   self->rout = new_fvec(self->win_s);
 
@@ -62,15 +71,17 @@
 Py_fft_del (Py_fft *self, PyObject *unused)
 {
+  Py_XDECREF((PyObject*)(self->py_out));
   del_aubio_fft(self->o);
   del_cvec(self->out);
   del_fvec(self->rout);
+  free(self->cvecin);
+  free(self->vecin);
   Py_TYPE(self)->tp_free((PyObject *) self);
 }
 
-static PyObject * 
+static PyObject *
 Py_fft_do(Py_fft * self, PyObject * args)
 {
   PyObject *input;
-  fvec_t *vec;
 
   if (!PyArg_ParseTuple (args, "O", &input)) {
@@ -78,13 +89,18 @@
   }
 
-  vec = PyAubio_ArrayToCFvec (input);
-
-  if (vec == NULL) {
+  if (!PyAubio_ArrayToCFvec(input, self->vecin)) {
     return NULL;
   }
 
   // compute the function
-  aubio_fft_do (((Py_fft *)self)->o, vec, self->out);
-  return (PyObject *)PyAubio_CCvecToPyCvec(self->out);
+  aubio_fft_do (((Py_fft *)self)->o, self->vecin, self->out);
+#if 0
+  Py_cvec * py_out = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType);
+  PyObject* output = PyAubio_CCvecToPyCvec(self->out, py_out);
+  return output;
+#else
+  // convert cvec to py_cvec, incrementing refcount to keep a copy
+  return PyAubio_CCvecToPyCvec(self->out, self->py_out);
+#endif
 }
 
@@ -95,9 +111,8 @@
 };
 
-static PyObject * 
+static PyObject *
 Py_fft_rdo(Py_fft * self, PyObject * args)
 {
   PyObject *input;
-  cvec_t *vec;
 
   if (!PyArg_ParseTuple (args, "O", &input)) {
@@ -105,13 +120,11 @@
   }
 
-  vec = PyAubio_ArrayToCCvec (input);
-
-  if (vec == NULL) {
+  if (!PyAubio_ArrayToCCvec (input, self->cvecin) ) {
     return NULL;
   }
 
   // compute the function
-  aubio_fft_rdo (((Py_fft *)self)->o, vec, self->rout);
-  return (PyObject *)PyAubio_CFvecToArray(self->rout);
+  aubio_fft_rdo (self->o, self->cvecin, self->rout);
+  return PyAubio_CFvecToArray(self->rout);
 }
 
Index: python/ext/py-filter.c
===================================================================
--- python/ext/py-filter.c	(revision bfe8256155757161c8d96033b2c000685a63e001)
+++ python/ext/py-filter.c	(revision b5bef11ddd1694ea7702e2d182769ca4605c91c0)
@@ -6,4 +6,5 @@
   aubio_filter_t * o;
   uint_t order;
+  fvec_t *vec;
   fvec_t *out;
 } Py_filter;
@@ -50,4 +51,5 @@
   }
   self->out = new_fvec(Py_default_vector_length);
+  self->vec = (fvec_t *)malloc(sizeof(fvec_t));
   return 0;
 }
@@ -58,4 +60,5 @@
   del_fvec(self->out);
   del_aubio_filter (self->o);
+  free(self->vec);
   Py_TYPE(self)->tp_free ((PyObject *) self);
 }
@@ -65,5 +68,4 @@
 {
   PyObject *input;
-  fvec_t *vec;
 
   if (!PyArg_ParseTuple (args, "O:digital_filter.do", &input)) {
@@ -75,17 +77,15 @@
   }
 
-  vec = PyAubio_ArrayToCFvec (input);
-
-  if (vec == NULL) {
+  if (!PyAubio_ArrayToCFvec(input, self->vec)) {
     return NULL;
   }
 
   // reallocate the output if needed
-  if (vec->length != self->out->length) {
+  if (self->vec->length != self->out->length) {
     del_fvec(self->out);
-    self->out = new_fvec(vec->length);
+    self->out = new_fvec(self->vec->length);
   }
   // compute the function
-  aubio_filter_do_outplace (self->o, vec, self->out);
+  aubio_filter_do_outplace (self->o, self->vec, self->out);
   return PyAubio_CFvecToArray(self->out);
 }
Index: python/ext/py-filterbank.c
===================================================================
--- python/ext/py-filterbank.c	(revision bfe8256155757161c8d96033b2c000685a63e001)
+++ python/ext/py-filterbank.c	(revision b5bef11ddd1694ea7702e2d182769ca4605c91c0)
@@ -9,5 +9,8 @@
   uint_t n_filters;
   uint_t win_s;
+  cvec_t *vec;
   fvec_t *out;
+  fvec_t *freqs;
+  fmat_t *coeffs;
 } Py_filterbank;
 
@@ -64,4 +67,12 @@
   self->out = new_fvec(self->n_filters);
 
+  self->vec = (cvec_t *)malloc(sizeof(cvec_t));
+
+  self->freqs = (fvec_t *)malloc(sizeof(fvec_t));
+
+  self->coeffs = (fmat_t *)malloc(sizeof(fmat_t));
+  self->coeffs->data = (smpl_t **)malloc(sizeof(smpl_t*) * self->n_filters);
+  self->coeffs->height = self->n_filters;
+
   return 0;
 }
@@ -72,4 +83,8 @@
   del_aubio_filterbank(self->o);
   del_fvec(self->out);
+  free(self->vec);
+  free(self->freqs);
+  free(self->coeffs->data);
+  free(self->coeffs);
   Py_TYPE(self)->tp_free((PyObject *) self);
 }
@@ -79,5 +94,4 @@
 {
   PyObject *input;
-  cvec_t *vec;
 
   if (!PyArg_ParseTuple (args, "O", &input)) {
@@ -85,12 +99,10 @@
   }
 
-  vec = PyAubio_ArrayToCCvec (input);
-
-  if (vec == NULL) {
+  if (!PyAubio_ArrayToCCvec(input, self->vec)) {
     return NULL;
   }
 
   // compute the function
-  aubio_filterbank_do (self->o, vec, self->out);
+  aubio_filterbank_do (self->o, self->vec, self->out);
   return (PyObject *)PyAubio_CFvecToArray(self->out);
 }
@@ -111,5 +123,4 @@
   PyObject *input;
   uint_t samplerate;
-  fvec_t *freqs;
   if (!PyArg_ParseTuple (args, "OI", &input, &samplerate)) {
     return NULL;
@@ -120,12 +131,10 @@
   }
 
-  freqs = PyAubio_ArrayToCFvec (input);
-
-  if (freqs == NULL) {
+  if (!PyAubio_ArrayToCFvec(input, self->freqs)) {
     return NULL;
   }
 
   err = aubio_filterbank_set_triangle_bands (self->o,
-      freqs, samplerate);
+      self->freqs, samplerate);
   if (err > 0) {
     PyErr_SetString (PyExc_ValueError,
@@ -161,19 +170,13 @@
 
   PyObject *input;
-  fmat_t *coeffs;
-
   if (!PyArg_ParseTuple (args, "O", &input)) {
     return NULL;
   }
 
-  coeffs = PyAubio_ArrayToCFmat (input);
-
-  if (coeffs == NULL) {
-    PyErr_SetString (PyExc_ValueError,
-        "unable to parse input array");
-    return NULL;
-  }
-
-  err = aubio_filterbank_set_coeffs (self->o, coeffs);
+  if (!PyAubio_ArrayToCFmat(input, self->coeffs)) {
+    return NULL;
+  }
+
+  err = aubio_filterbank_set_coeffs (self->o, self->coeffs);
 
   if (err > 0) {
Index: python/ext/py-musicutils.c
===================================================================
--- python/ext/py-musicutils.c	(revision bfe8256155757161c8d96033b2c000685a63e001)
+++ python/ext/py-musicutils.c	(revision b5bef11ddd1694ea7702e2d182769ca4605c91c0)
@@ -38,10 +38,12 @@
   }
 
-  vec = PyAubio_ArrayToCFvec (input);
-  if (vec == NULL) {
+  vec = (fvec_t *)malloc(sizeof(fvec_t));
+  if (!PyAubio_ArrayToCFvec(input, vec)) {
+    free(vec);
     return NULL;
   }
 
   level_lin = Py_BuildValue("f", aubio_level_lin(vec));
+  free(vec);
   if (level_lin == NULL) {
     PyErr_SetString (PyExc_ValueError, "failed computing level_lin");
@@ -68,10 +70,12 @@
   }
 
-  vec = PyAubio_ArrayToCFvec (input);
-  if (vec == NULL) {
+  vec = (fvec_t *)malloc(sizeof(fvec_t));
+  if (!PyAubio_ArrayToCFvec(input, vec)) {
+    free(vec);
     return NULL;
   }
 
   db_spl = Py_BuildValue("f", aubio_db_spl(vec));
+  free(vec);
   if (db_spl == NULL) {
     PyErr_SetString (PyExc_ValueError, "failed computing db_spl");
@@ -99,10 +103,12 @@
   }
 
-  vec = PyAubio_ArrayToCFvec (input);
-  if (vec == NULL) {
+  vec = (fvec_t *)malloc(sizeof(fvec_t));
+  if (!PyAubio_ArrayToCFvec(input, vec)) {
+    free(vec);
     return NULL;
   }
 
   silence_detection = Py_BuildValue("I", aubio_silence_detection(vec, threshold));
+  free(vec);
   if (silence_detection == NULL) {
     PyErr_SetString (PyExc_ValueError, "failed computing silence_detection");
@@ -130,10 +136,12 @@
   }
 
-  vec = PyAubio_ArrayToCFvec (input);
-  if (vec == NULL) {
+  vec = (fvec_t *)malloc(sizeof(fvec_t));
+  if (!PyAubio_ArrayToCFvec(input, vec)) {
+    free(vec);
     return NULL;
   }
 
   level_detection = Py_BuildValue("f", aubio_level_detection(vec, threshold));
+  free(vec);
   if (level_detection == NULL) {
     PyErr_SetString (PyExc_ValueError, "failed computing level_detection");
Index: python/ext/py-phasevoc.c
===================================================================
--- python/ext/py-phasevoc.c	(revision bfe8256155757161c8d96033b2c000685a63e001)
+++ python/ext/py-phasevoc.c	(revision b5bef11ddd1694ea7702e2d182769ca4605c91c0)
@@ -9,5 +9,8 @@
   uint_t win_s;
   uint_t hop_s;
+  fvec_t *vecin;
   cvec_t *output;
+  Py_cvec *py_out;
+  cvec_t *cvecin;
   fvec_t *routput;
 } Py_pvoc;
@@ -69,5 +72,9 @@
   }
 
+  self->cvecin = (cvec_t *)malloc(sizeof(cvec_t));
+  self->vecin = (fvec_t *)malloc(sizeof(fvec_t));
+
   self->output = new_cvec(self->win_s);
+  self->py_out = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType);
   self->routput = new_fvec(self->hop_s);
 
@@ -82,13 +89,14 @@
   del_cvec(self->output);
   del_fvec(self->routput);
+  free(self->cvecin);
+  free(self->vecin);
   Py_TYPE(self)->tp_free((PyObject *) self);
 }
 
 
-static PyObject * 
+static PyObject *
 Py_pvoc_do(Py_pvoc * self, PyObject * args)
 {
   PyObject *input;
-  fvec_t *vec;
 
   if (!PyArg_ParseTuple (args, "O", &input)) {
@@ -96,13 +104,18 @@
   }
 
-  vec = PyAubio_ArrayToCFvec (input);
-
-  if (vec == NULL) {
+  if (!PyAubio_ArrayToCFvec (input, self->vecin)) {
     return NULL;
   }
 
   // compute the function
-  aubio_pvoc_do (self->o, vec, self->output);
-  return (PyObject *)PyAubio_CCvecToPyCvec(self->output);
+  aubio_pvoc_do (self->o, self->vecin, self->output);
+#if 0
+  Py_cvec * py_out = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType);
+  PyObject* output = PyAubio_CCvecToPyCvec(self->output, py_out);
+  return output;
+#else
+  // convert cvec to py_cvec, incrementing refcount to keep a copy
+  return PyAubio_CCvecToPyCvec(self->output, self->py_out);
+#endif
 }
 
@@ -119,18 +132,15 @@
 {
   PyObject *input;
-  cvec_t *vec;
   if (!PyArg_ParseTuple (args, "O", &input)) {
     return NULL;
   }
 
-  vec = PyAubio_ArrayToCCvec (input);
-
-  if (vec == NULL) {
+  if (!PyAubio_ArrayToCCvec (input, self->cvecin)) {
     return NULL;
   }
 
   // compute the function
-  aubio_pvoc_rdo (self->o, vec, self->routput);
-  return (PyObject *)PyAubio_CFvecToArray(self->routput);
+  aubio_pvoc_rdo (self->o, self->cvecin, self->routput);
+  return PyAubio_CFvecToArray(self->routput);
 }
 
Index: python/ext/py-sink.c
===================================================================
--- python/ext/py-sink.c	(revision bfe8256155757161c8d96033b2c000685a63e001)
+++ python/ext/py-sink.c	(revision b5bef11ddd1694ea7702e2d182769ca4605c91c0)
@@ -8,4 +8,6 @@
   uint_t samplerate;
   uint_t channels;
+  fvec_t *write_data;
+  fmat_t *mwrite_data;
 } Py_sink;
 
@@ -122,4 +124,8 @@
   self->channels = aubio_sink_get_channels ( self->o );
 
+  self->write_data = (fvec_t *)malloc(sizeof(fvec_t));
+  self->mwrite_data = (fmat_t *)malloc(sizeof(fmat_t));
+  self->mwrite_data->height = self->channels;
+  self->mwrite_data->data = (smpl_t **)malloc(sizeof(smpl_t*) * self->channels);
   return 0;
 }
@@ -129,4 +135,7 @@
 {
   del_aubio_sink(self->o);
+  free(self->write_data);
+  free(self->mwrite_data->data);
+  free(self->mwrite_data);
   Py_TYPE(self)->tp_free((PyObject *) self);
 }
@@ -140,5 +149,4 @@
 
   /* input vectors prototypes */
-  fvec_t* write_data;
   uint_t write;
 
@@ -148,18 +156,12 @@
   }
 
-
   /* input vectors parsing */
-  write_data = PyAubio_ArrayToCFvec (write_data_obj);
-
-  if (write_data == NULL) {
-    return NULL;
-  }
-
-
-
+  if (!PyAubio_ArrayToCFvec(write_data_obj, self->write_data)) {
+    return NULL;
+  }
 
 
   /* compute _do function */
-  aubio_sink_do (self->o, write_data, write);
+  aubio_sink_do (self->o, self->write_data, write);
 
   Py_RETURN_NONE;
@@ -174,5 +176,4 @@
 
   /* input vectors prototypes */
-  fmat_t * write_data;
   uint_t write;
 
@@ -184,16 +185,10 @@
 
   /* input vectors parsing */
-  write_data = PyAubio_ArrayToCFmat (write_data_obj);
-
-  if (write_data == NULL) {
-    return NULL;
-  }
-
-
-
-
+  if (!PyAubio_ArrayToCFmat(write_data_obj, self->mwrite_data)) {
+    return NULL;
+  }
 
   /* compute _do function */
-  aubio_sink_do_multi (self->o, write_data, write);
+  aubio_sink_do_multi (self->o, self->mwrite_data, write);
   Py_RETURN_NONE;
 }
