2 #include <structmember.h>
4 #include "aubio-generated.h"
6 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
8 // define numpy unique symbols for aubio
9 #define PY_ARRAY_UNIQUE_SYMBOL PYAUBIO_ARRAY_API
10 #define PY_UFUNC_UNIQUE_SYMBOL PYAUBIO_UFUNC_API
12 // only import array and ufunc from main module
13 #ifndef PY_AUBIO_MODULE_MAIN
14 #define NO_IMPORT_ARRAY
16 #include <numpy/arrayobject.h>
17 #ifndef PY_AUBIO_MODULE_UFUNC
18 #define NO_IMPORT_UFUNC
20 #include <numpy/ufuncobject.h>
23 //#include <numpy/npy_3kcompat.h>
26 #define AUBIO_UNSTABLE 1
27 #ifdef USE_LOCAL_AUBIO
30 #include "aubio/aubio.h"
33 #define Py_default_vector_length 1024
35 #define Py_aubio_default_samplerate 44100
38 #warning "double mode needs love"
39 #define AUBIO_NPY_SMPL NPY_DOUBLE
40 #define AUBIO_NPY_SMPL_STR "float64"
41 #define AUBIO_NPY_SMPL_CHR "d"
43 #define AUBIO_NPY_SMPL NPY_FLOAT
44 #define AUBIO_NPY_SMPL_STR "float32"
45 #define AUBIO_NPY_SMPL_CHR "f"
48 // compat with Python < 2.6
50 #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
53 extern PyTypeObject Py_cvecType;
55 // defined in aubio-proxy.c
56 extern PyObject *PyAubio_CFvecToArray (fvec_t * self);
57 extern int PyAubio_ArrayToCFvec (PyObject * self, fvec_t *out);
59 extern PyObject * PyAubio_CCvecToPyCvec (cvec_t * self);
60 extern int PyAubio_PyCvecToCCvec (PyObject *input, cvec_t *i);
62 extern PyObject *PyAubio_CFmatToArray (fmat_t * self);
63 extern int PyAubio_ArrayToCFmat (PyObject *input, fmat_t *out);
65 // hand written wrappers
66 extern PyTypeObject Py_filterType;
68 extern PyTypeObject Py_filterbankType;
70 extern PyTypeObject Py_fftType;
72 extern PyTypeObject Py_pvocType;
74 extern PyTypeObject Py_sourceType;
76 extern PyTypeObject Py_sinkType;