feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/applefworksfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 164980f was
164980f,
checked in by Paul Brossier <piem@piem.org>, 12 years ago
|
python/: move source files to ext/
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[7a6521d] | 1 | #include "Python.h" |
---|
[ae6e15c] | 2 | #include <structmember.h> |
---|
[7a6521d] | 3 | |
---|
[cd6fc5a] | 4 | //#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION |
---|
[7a6521d] | 5 | |
---|
| 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 |
---|
| 9 | |
---|
| 10 | // only import array and ufunc from main module |
---|
| 11 | #ifndef PY_AUBIO_MODULE_MAIN |
---|
| 12 | #define NO_IMPORT_ARRAY |
---|
| 13 | #define NO_IMPORT_UFUNC |
---|
| 14 | #endif |
---|
| 15 | |
---|
| 16 | // import aubio |
---|
| 17 | #include <numpy/ndarraytypes.h> |
---|
| 18 | #include <numpy/ufuncobject.h> |
---|
| 19 | #include <numpy/npy_3kcompat.h> |
---|
| 20 | |
---|
[7db3477] | 21 | #define AUBIO_UNSTABLE 1 |
---|
[ae6e15c] | 22 | #include <aubio.h> |
---|
| 23 | |
---|
[96fe713] | 24 | #define Py_default_vector_length 1024 |
---|
[9b23eb31] | 25 | |
---|
| 26 | #define Py_aubio_default_samplerate 44100 |
---|
[352fd5f] | 27 | |
---|
[615ac7d] | 28 | #if HAVE_AUBIO_DOUBLE |
---|
| 29 | #error "Ouch! Python interface for aubio has not been much tested yet." |
---|
| 30 | #define AUBIO_NPY_SMPL NPY_DOUBLE |
---|
[352fd5f] | 31 | #else |
---|
[615ac7d] | 32 | #define AUBIO_NPY_SMPL NPY_FLOAT |
---|
[352fd5f] | 33 | #endif |
---|
| 34 | |
---|
[03c3450] | 35 | // special python type for cvec |
---|
[96fe713] | 36 | typedef struct |
---|
| 37 | { |
---|
| 38 | PyObject_HEAD |
---|
[615ac7d] | 39 | cvec_t * o; |
---|
| 40 | uint_t length; |
---|
| 41 | uint_t channels; |
---|
| 42 | } Py_cvec; |
---|
[9b23eb31] | 43 | extern PyTypeObject Py_cvecType; |
---|
| 44 | |
---|
[03c3450] | 45 | // defined in aubio-proxy.c |
---|
| 46 | extern PyObject *PyAubio_CFvecToArray (fvec_t * self); |
---|
| 47 | extern fvec_t *PyAubio_ArrayToCFvec (PyObject * self); |
---|
| 48 | |
---|
| 49 | extern Py_cvec *PyAubio_CCvecToPyCvec (cvec_t * self); |
---|
| 50 | extern cvec_t *PyAubio_ArrayToCCvec (PyObject *input); |
---|
| 51 | |
---|
| 52 | extern PyObject *PyAubio_CFmatToArray (fmat_t * self); |
---|
| 53 | extern fmat_t *PyAubio_ArrayToCFmat (PyObject *input); |
---|
| 54 | |
---|
| 55 | // hand written wrappers |
---|
[9b23eb31] | 56 | extern PyTypeObject Py_filterType; |
---|
| 57 | |
---|
[615ac7d] | 58 | extern PyTypeObject Py_filterbankType; |
---|
[352fd5f] | 59 | |
---|
[615ac7d] | 60 | extern PyTypeObject Py_fftType; |
---|
| 61 | |
---|
| 62 | extern PyTypeObject Py_pvocType; |
---|
[03c3450] | 63 | |
---|
Note: See
TracBrowser
for help on using the repository browser.