Ignore:
Timestamp:
Sep 15, 2018, 2:57:36 PM (6 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
Children:
87e181d
Parents:
6f3dfc0
Message:

python/ext/py-musicutils.*: add shift(fvec) and ishift(fvec)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/ext/py-musicutils.c

    r6f3dfc0 rb532275  
    134134  return level_detection;
    135135}
     136
     137PyObject *
     138Py_aubio_shift(PyObject *self, PyObject *args)
     139{
     140  PyObject *input;
     141  fvec_t vec;
     142
     143  if (!PyArg_ParseTuple (args, "O:shift", &input)) {
     144    return NULL;
     145  }
     146
     147  if (input == NULL) {
     148    return NULL;
     149  }
     150
     151  if (!PyAubio_ArrayToCFvec(input, &vec)) {
     152    return NULL;
     153  }
     154
     155  fvec_shift(&vec);
     156
     157  //Py_RETURN_NONE;
     158  return (PyObject *) PyAubio_CFvecToArray(&vec);
     159}
     160
     161PyObject *
     162Py_aubio_ishift(PyObject *self, PyObject *args)
     163{
     164  PyObject *input;
     165  fvec_t vec;
     166
     167  if (!PyArg_ParseTuple (args, "O:shift", &input)) {
     168    return NULL;
     169  }
     170
     171  if (input == NULL) {
     172    return NULL;
     173  }
     174
     175  if (!PyAubio_ArrayToCFvec(input, &vec)) {
     176    return NULL;
     177  }
     178
     179  fvec_ishift(&vec);
     180
     181  //Py_RETURN_NONE;
     182  return (PyObject *) PyAubio_CFvecToArray(&vec);
     183}
Note: See TracChangeset for help on using the changeset viewer.