Changeset 21234ee for python


Ignore:
Timestamp:
Dec 18, 2013, 8:07:27 AM (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:
6465d7f
Parents:
1573b16 (diff), c3c6305 (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' of aubio.org:/git/aubio/aubio into develop

Location:
python
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • python/demos/demo_bpm_extract.py

    • Property mode changed from 100644 to 100755
  • python/demos/demo_mel-energy.py

    r1573b16 r21234ee  
    6262        ax.yaxis.set_visible(False)
    6363        ax.axis(xmax = all_desc_times[-1], xmin = all_desc_times[0])
    64         ax.annotate('band %d' % i, xy=(-10, 10),  xycoords='axes points',
     64        ax.annotate('band %d' % i, xy=(-10, 0),  xycoords='axes points',
    6565                horizontalalignment='right', verticalalignment='bottom',
     66                size = 'xx-small',
    6667                )
    6768    set_xlabels_sample2time( ax, all_desc_times[-1], samplerate)
  • python/demos/demo_pitch.py

    r1573b16 r21234ee  
    5757
    5858fig = plt.figure()
     59
    5960ax1 = fig.add_subplot(311)
    6061ax1 = get_waveform_plot(filename, samplerate = samplerate, block_size = hop_s, ax = ax1)
    61 ax1.set_xticklabels([])
     62plt.setp(ax1.get_xticklabels(), visible = False)
     63ax1.set_xlabel('')
    6264
    6365def array_from_text_file(filename, dtype = 'float'):
     
    8890#ax2.axis( ymin = 0.9 * cleaned_pitches.min(), ymax = 1.1 * cleaned_pitches.max() )
    8991#ax2.axis( ymin = 55, ymax = 70 )
    90 ax2.set_xticklabels([])
     92plt.setp(ax2.get_xticklabels(), visible = False)
     93ax2.set_ylabel('f0 (Hz)')
    9194
    9295# plot confidence
     
    97100ax3.plot(times, [tolerance]*len(confidences))
    98101ax3.axis( xmin = times[0], xmax = times[-1])
     102ax3.set_ylabel('condidence')
     103set_xlabels_sample2time(ax3, times[-1], samplerate)
    99104plt.show()
    100 set_xlabels_sample2time(ax3, times[-1], samplerate)
    101 #plt.savefig(os.path.basename(filename) + '.png', dpi=200)
     105#plt.savefig(os.path.basename(filename) + '.svg')
  • python/demos/demo_specdesc.py

    r1573b16 r21234ee  
    7272        ax.yaxis.set_visible(False)
    7373        ax.axis(xmax = all_desc_times[-1], xmin = all_desc_times[0])
    74         ax.annotate(method, xy=(-10, 10),  xycoords='axes points',
     74        ax.annotate(method, xy=(-10, 0),  xycoords='axes points',
    7575                horizontalalignment='right', verticalalignment='bottom',
    7676                )
  • python/ext/aubio-types.h

    r1573b16 r21234ee  
    6969extern PyTypeObject Py_pvocType;
    7070
     71extern PyTypeObject Py_sourceType;
     72
  • python/ext/aubiomodule.c

    r1573b16 r21234ee  
    199199      || (PyType_Ready (&Py_fftType) < 0)
    200200      || (PyType_Ready (&Py_pvocType) < 0)
     201      || (PyType_Ready (&Py_sourceType) < 0)
    201202      // generated objects
    202203      || (generated_types_ready() < 0 )
     
    227228  Py_INCREF (&Py_pvocType);
    228229  PyModule_AddObject (m, "pvoc", (PyObject *) & Py_pvocType);
     230  Py_INCREF (&Py_sourceType);
     231  PyModule_AddObject (m, "source", (PyObject *) & Py_sourceType);
    229232
    230233  // add generated objects
  • python/ext/aubioproxy.c

    r1573b16 r21234ee  
    3636    // no need to really allocate fvec, just its struct member
    3737    vec = (fvec_t *)malloc(sizeof(fvec_t));
    38     vec->length = PyArray_SIZE ((PyArrayObject *)array);
     38    long length = PyArray_SIZE ((PyArrayObject *)array);
     39    if (length > 0) {
     40      vec->length = (uint_t)length;
     41    } else {
     42      PyErr_SetString (PyExc_ValueError, "input array size should be greater than 0");
     43      goto fail;
     44    }
    3945    vec->data = (smpl_t *) PyArray_GETPTR1 ((PyArrayObject *)array, 0);
    4046
     
    131137    // no need to really allocate fvec, just its struct member
    132138    mat = (fmat_t *)malloc(sizeof(fmat_t));
    133     mat->length = PyArray_DIM ((PyArrayObject *)array, 1);
    134     mat->height = PyArray_DIM ((PyArrayObject *)array, 0);
     139    long length = PyArray_DIM ((PyArrayObject *)array, 1);
     140    if (length > 0) {
     141      mat->length = (uint_t)length;
     142    } else {
     143      PyErr_SetString (PyExc_ValueError, "input array dimension 1 should be greater than 0");
     144      goto fail;
     145    }
     146    long height = PyArray_DIM ((PyArrayObject *)array, 0);
     147    if (height > 0) {
     148      mat->height = (uint_t)height;
     149    } else {
     150      PyErr_SetString (PyExc_ValueError, "input array dimension 0 should be greater than 0");
     151      goto fail;
     152    }
    135153    mat->data = (smpl_t **)malloc(sizeof(smpl_t*) * mat->height);
    136154    for (i=0; i< mat->height; i++) {
  • python/ext/py-fft.c

    r1573b16 r21234ee  
    2525
    2626  self->win_s = Py_default_vector_length;
    27 
    28   if (self == NULL) {
    29     return NULL;
    30   }
    3127
    3228  if (win_s > 0) {
  • python/lib/gen_pyobject.py

    r1573b16 r21234ee  
    240240
    241241  self->%(pname)s = %(defval)s;
    242   if (%(pname)s > 0) {
     242  if ((sint_t)%(pname)s > 0) {
    243243    self->%(pname)s = %(pname)s;
    244   } else if (%(pname)s < 0) {
     244  } else if ((sint_t)%(pname)s < 0) {
    245245    PyErr_SetString (PyExc_ValueError,
    246246        "can not use negative value for %(pname)s");
  • python/lib/generator.py

    r1573b16 r21234ee  
    5757      'sink_apple_audio',
    5858      'sink_sndfile',
     59      'source',
    5960      'source_apple_audio',
    6061      'source_sndfile',
  • python/setup.py

    r1573b16 r21234ee  
    5454    "ext/py-fft.c",
    5555    "ext/py-phasevoc.c",
     56    "ext/py-source.c",
    5657    # generated files
    5758    ] + generated_object_files,
Note: See TracChangeset for help on using the changeset viewer.