Ignore:
Timestamp:
Mar 6, 2013, 5:26:49 PM (11 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
b583c099
Parents:
7606d23
Message:

ext/aubiomodule.c: more ufuncs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/ext/aubiomodule.c

    r7606d23 r4a67c12  
    3939}
    4040
    41 static char Py_unwrap2pi_doc[] = "unwrap phase value to [-pi, pi]";
    42 
    43 static PyObject *
    44 Py_unwrap2pi (PyObject * self, PyObject * args)
    45 {
    46   smpl_t input;
    47   smpl_t output;
    48 
    49   if (!PyArg_ParseTuple (args, "|f", &input)) {
    50     return NULL;
    51   }
    52 
    53   output = aubio_unwrap2pi (input);
    54 
    55   return (PyObject *)PyFloat_FromDouble (output);
    56 }
    57 
    5841static char Py_bintomidi_doc[] = "convert bin to midi";
    5942
     
    120103
    121104  output = aubio_freqtobin (input, samplerate, fftsize);
    122 
    123   return (PyObject *)PyFloat_FromDouble (output);
    124 }
    125 
    126 static char Py_freqtomidi_doc[] = "convert freq to midi";
    127 
    128 static PyObject *
    129 Py_freqtomidi (PyObject * self, PyObject * args)
    130 {
    131   smpl_t input;
    132   smpl_t output;
    133 
    134   if (!PyArg_ParseTuple (args, "|f", &input)) {
    135     return NULL;
    136   }
    137 
    138   output = aubio_freqtomidi (input);
    139 
    140   return (PyObject *)PyFloat_FromDouble (output);
    141 }
    142 
    143 static char Py_miditofreq_doc[] = "convert midi to freq";
    144 
    145 static PyObject *
    146 Py_miditofreq (PyObject * self, PyObject * args)
    147 {
    148   smpl_t input;
    149   smpl_t output;
    150 
    151   if (!PyArg_ParseTuple (args, "|f", &input)) {
    152     return NULL;
    153   }
    154 
    155   output = aubio_miditofreq (input);
    156105
    157106  return (PyObject *)PyFloat_FromDouble (output);
     
    225174
    226175static PyMethodDef aubio_methods[] = {
    227   //{"unwrap2pi", Py_unwrap2pi, METH_VARARGS, Py_unwrap2pi_doc},
    228176  {"bintomidi", Py_bintomidi, METH_VARARGS, Py_bintomidi_doc},
    229177  {"miditobin", Py_miditobin, METH_VARARGS, Py_miditobin_doc},
    230178  {"bintofreq", Py_bintofreq, METH_VARARGS, Py_bintofreq_doc},
    231179  {"freqtobin", Py_freqtobin, METH_VARARGS, Py_freqtobin_doc},
    232   {"miditofreq", Py_miditofreq, METH_VARARGS, Py_miditofreq_doc},
    233   {"freqtomidi", Py_freqtomidi, METH_VARARGS, Py_freqtomidi_doc},
    234180  {"alpha_norm", Py_alpha_norm, METH_VARARGS, Py_alpha_norm_doc},
    235181  {"zero_crossing_rate", Py_zero_crossing_rate, METH_VARARGS, Py_zero_crossing_rate_doc},
Note: See TracChangeset for help on using the changeset viewer.