2 #include <structmember.h>
4 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
6 // define numpy unique symbols for aubio
7 #define PY_ARRAY_UNIQUE_SYMBOL PYAUBIO_ARRAY_API
8 #define PY_UFUNC_UNIQUE_SYMBOL PYAUBIO_UFUNC_API
10 // only import array and ufunc from main module
11 #ifndef PY_AUBIO_MODULE_MAIN
12 #define NO_IMPORT_ARRAY
14 #include <numpy/arrayobject.h>
15 #ifndef PY_AUBIO_MODULE_UFUNC
16 #define NO_IMPORT_UFUNC
18 #include <numpy/ufuncobject.h>
21 //#include <numpy/npy_3kcompat.h>
24 #define AUBIO_UNSTABLE 1
25 #ifdef USE_LOCAL_AUBIO
28 #include "aubio/aubio.h"
31 #define Py_default_vector_length 1024
33 #define Py_aubio_default_samplerate 44100
36 #warning "double mode needs love"
37 #define AUBIO_NPY_SMPL NPY_DOUBLE
38 #define AUBIO_NPY_SMPL_STR "float64"
39 #define AUBIO_NPY_SMPL_CHR "d"
41 #define AUBIO_NPY_SMPL NPY_FLOAT
42 #define AUBIO_NPY_SMPL_STR "float32"
43 #define AUBIO_NPY_SMPL_CHR "f"
46 // compat with Python < 2.6
48 #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
51 // special python type for cvec
58 extern PyTypeObject Py_cvecType;
60 // defined in aubio-proxy.c
61 extern PyObject *PyAubio_CFvecToArray (fvec_t * self);
62 extern int PyAubio_ArrayToCFvec (PyObject * self, fvec_t *out);
64 extern PyObject * PyAubio_CCvecToPyCvec (cvec_t * self, Py_cvec *out);
65 extern int PyAubio_ArrayToCCvec (PyObject *input, cvec_t *i);
67 extern PyObject *PyAubio_CFmatToArray (fmat_t * self);
68 extern int PyAubio_ArrayToCFmat (PyObject *input, fmat_t *out);
70 // hand written wrappers
71 extern PyTypeObject Py_filterType;
73 extern PyTypeObject Py_filterbankType;
75 extern PyTypeObject Py_fftType;
77 extern PyTypeObject Py_pvocType;
79 extern PyTypeObject Py_sourceType;
81 extern PyTypeObject Py_sinkType;