Ignore:
Timestamp:
Jun 22, 2016, 1:00:10 PM (8 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:
4b9443c4
Parents:
60fc05b (diff), 6769586 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into notes

File:
1 edited

Legend:

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

    r60fc05b rf264b17  
    99
    1010  if (!PyArg_ParseTuple (args, "|sI", &wintype, &winlen)) {
    11     PyErr_SetString (PyExc_ValueError, "failed parsing arguments");
    1211    return NULL;
    1312  }
     
    2625{
    2726  PyObject *input;
    28   fvec_t *vec;
     27  fvec_t vec;
    2928  PyObject *level_lin;
    3029
    3130  if (!PyArg_ParseTuple (args, "O:level_lin", &input)) {
    32     PyErr_SetString (PyExc_ValueError, "failed parsing arguments");
    3331    return NULL;
    3432  }
     
    3836  }
    3937
    40   vec = PyAubio_ArrayToCFvec (input);
    41   if (vec == NULL) {
     38  if (!PyAubio_ArrayToCFvec(input, &vec)) {
    4239    return NULL;
    4340  }
    4441
    45   level_lin = Py_BuildValue("f", aubio_level_lin(vec));
     42  level_lin = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_level_lin(&vec));
    4643  if (level_lin == NULL) {
    4744    PyErr_SetString (PyExc_ValueError, "failed computing level_lin");
     
    5653{
    5754  PyObject *input;
    58   fvec_t *vec;
     55  fvec_t vec;
    5956  PyObject *db_spl;
    6057
    6158  if (!PyArg_ParseTuple (args, "O:db_spl", &input)) {
    62     PyErr_SetString (PyExc_ValueError, "failed parsing arguments");
    6359    return NULL;
    6460  }
     
    6864  }
    6965
    70   vec = PyAubio_ArrayToCFvec (input);
    71   if (vec == NULL) {
     66  if (!PyAubio_ArrayToCFvec(input, &vec)) {
    7267    return NULL;
    7368  }
    7469
    75   db_spl = Py_BuildValue("f", aubio_db_spl(vec));
     70  db_spl = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_db_spl(&vec));
    7671  if (db_spl == NULL) {
    7772    PyErr_SetString (PyExc_ValueError, "failed computing db_spl");
     
    8681{
    8782  PyObject *input;
    88   fvec_t *vec;
     83  fvec_t vec;
    8984  PyObject *silence_detection;
    9085  smpl_t threshold;
    9186
    92   if (!PyArg_ParseTuple (args, "Of:silence_detection", &input, &threshold)) {
    93     PyErr_SetString (PyExc_ValueError, "failed parsing arguments");
     87  if (!PyArg_ParseTuple (args, "O" AUBIO_NPY_SMPL_CHR ":silence_detection", &input, &threshold)) {
    9488    return NULL;
    9589  }
     
    9993  }
    10094
    101   vec = PyAubio_ArrayToCFvec (input);
    102   if (vec == NULL) {
     95  if (!PyAubio_ArrayToCFvec(input, &vec)) {
    10396    return NULL;
    10497  }
    10598
    106   silence_detection = Py_BuildValue("I", aubio_silence_detection(vec, threshold));
     99  silence_detection = Py_BuildValue("I", aubio_silence_detection(&vec, threshold));
    107100  if (silence_detection == NULL) {
    108101    PyErr_SetString (PyExc_ValueError, "failed computing silence_detection");
     
    117110{
    118111  PyObject *input;
    119   fvec_t *vec;
     112  fvec_t vec;
    120113  PyObject *level_detection;
    121114  smpl_t threshold;
    122115
    123   if (!PyArg_ParseTuple (args, "Of:level_detection", &input, &threshold)) {
    124     PyErr_SetString (PyExc_ValueError, "failed parsing arguments");
     116  if (!PyArg_ParseTuple (args, "O" AUBIO_NPY_SMPL_CHR ":level_detection", &input, &threshold)) {
    125117    return NULL;
    126118  }
     
    130122  }
    131123
    132   vec = PyAubio_ArrayToCFvec (input);
    133   if (vec == NULL) {
     124  if (!PyAubio_ArrayToCFvec(input, &vec)) {
    134125    return NULL;
    135126  }
    136127
    137   level_detection = Py_BuildValue("f", aubio_level_detection(vec, threshold));
     128  level_detection = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_level_detection(&vec, threshold));
    138129  if (level_detection == NULL) {
    139130    PyErr_SetString (PyExc_ValueError, "failed computing level_detection");
Note: See TracChangeset for help on using the changeset viewer.