Changeset 6a50b9e
- Timestamp:
- Mar 3, 2013, 10:20:30 PM (12 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 6514bb6
- Parents:
- 68d0492
- Location:
- python
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/aubiomodule.c
r68d0492 r6a50b9e 38 38 39 39 return result; 40 } 41 42 static char Py_bintomidi_doc[] = "convert bin to midi"; 43 44 static PyObject * 45 Py_bintomidi (PyObject * self, PyObject * args) 46 { 47 smpl_t input, samplerate, fftsize; 48 smpl_t output; 49 50 if (!PyArg_ParseTuple (args, "|fff", &input, &samplerate, &fftsize)) { 51 return NULL; 52 } 53 54 output = aubio_bintomidi (input, samplerate, fftsize); 55 56 return (PyObject *)PyFloat_FromDouble (output); 57 } 58 59 static char Py_miditobin_doc[] = "convert midi to bin"; 60 61 static PyObject * 62 Py_miditobin (PyObject * self, PyObject * args) 63 { 64 smpl_t input, samplerate, fftsize; 65 smpl_t output; 66 67 if (!PyArg_ParseTuple (args, "|fff", &input, &samplerate, &fftsize)) { 68 return NULL; 69 } 70 71 output = aubio_miditobin (input, samplerate, fftsize); 72 73 return (PyObject *)PyFloat_FromDouble (output); 74 } 75 76 static char Py_bintofreq_doc[] = "convert bin to freq"; 77 78 static PyObject * 79 Py_bintofreq (PyObject * self, PyObject * args) 80 { 81 smpl_t input, samplerate, fftsize; 82 smpl_t output; 83 84 if (!PyArg_ParseTuple (args, "|fff", &input, &samplerate, &fftsize)) { 85 return NULL; 86 } 87 88 output = aubio_bintofreq (input, samplerate, fftsize); 89 90 return (PyObject *)PyFloat_FromDouble (output); 91 } 92 93 static char Py_freqtobin_doc[] = "convert freq to bin"; 94 95 static PyObject * 96 Py_freqtobin (PyObject * self, PyObject * args) 97 { 98 smpl_t input, samplerate, fftsize; 99 smpl_t output; 100 101 if (!PyArg_ParseTuple (args, "|fff", &input, &samplerate, &fftsize)) { 102 return NULL; 103 } 104 105 output = aubio_freqtobin (input, samplerate, fftsize); 106 107 return (PyObject *)PyFloat_FromDouble (output); 108 } 109 110 static char Py_freqtomidi_doc[] = "convert freq to midi"; 111 112 static PyObject * 113 Py_freqtomidi (PyObject * self, PyObject * args) 114 { 115 smpl_t input; 116 smpl_t output; 117 118 if (!PyArg_ParseTuple (args, "|f", &input)) { 119 return NULL; 120 } 121 122 output = aubio_freqtomidi (input); 123 124 return (PyObject *)PyFloat_FromDouble (output); 125 } 126 127 static char Py_miditofreq_doc[] = "convert midi to freq"; 128 129 static PyObject * 130 Py_miditofreq (PyObject * self, PyObject * args) 131 { 132 smpl_t input; 133 smpl_t output; 134 135 if (!PyArg_ParseTuple (args, "|f", &input)) { 136 return NULL; 137 } 138 139 output = aubio_miditofreq (input); 140 141 return (PyObject *)PyFloat_FromDouble (output); 40 142 } 41 143 … … 107 209 108 210 static PyMethodDef aubio_methods[] = { 211 {"bintomidi", Py_bintomidi, METH_VARARGS, Py_bintomidi_doc}, 212 {"miditobin", Py_miditobin, METH_VARARGS, Py_miditobin_doc}, 213 {"bintofreq", Py_bintofreq, METH_VARARGS, Py_bintofreq_doc}, 214 {"freqtobin", Py_freqtobin, METH_VARARGS, Py_freqtobin_doc}, 215 {"miditofreq", Py_miditofreq, METH_VARARGS, Py_miditofreq_doc}, 216 {"freqtomidi", Py_freqtomidi, METH_VARARGS, Py_freqtomidi_doc}, 109 217 {"alpha_norm", Py_alpha_norm, METH_VARARGS, Py_alpha_norm_doc}, 110 {"zero_crossing_rate", Py_zero_crossing_rate, METH_VARARGS, 111 Py_zero_crossing_rate_doc}, 218 {"zero_crossing_rate", Py_zero_crossing_rate, METH_VARARGS, Py_zero_crossing_rate_doc}, 112 219 {"min_removal", Py_min_removal, METH_VARARGS, Py_min_removal_doc}, 113 220 {NULL, NULL} /* Sentinel */
Note: See TracChangeset
for help on using the changeset viewer.