Changeset d47ad546 for examples


Ignore:
Timestamp:
Sep 17, 2018, 1:47:22 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:
8ba682a
Parents:
8c4918a (diff), f7771c6 (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 'jack-midi-buffer-fix' of https://github.com/cyclopsian/aubio into fix/jack-midi-buffer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/utils.c

    r8c4918a rd47ad546  
    7676
    7777#if HAVE_JACK
     78#define MAX_MIDI_EVENTS 128
    7879aubio_jack_t *jack_setup;
    7980jack_midi_event_t ev;
     81jack_midi_data_t midi_data[MAX_MIDI_EVENTS * 3];
     82size_t midi_event_count = 0;
    8083#endif /* HAVE_JACK */
    8184
     
    129132void examples_common_del (void)
    130133{
    131 #ifdef HAVE_JACK
    132   if (ev.buffer) free(ev.buffer);
    133 #endif
    134134  del_fvec (ibuf);
    135135  del_fvec (obuf);
     
    148148#ifdef HAVE_JACK
    149149    ev.size = 3;
    150     ev.buffer = malloc (3 * sizeof (jack_midi_data_t));
    151150    ev.time = 0; // send it now
    152151    debug ("Jack activation ...\n");
     
    194193#ifdef HAVE_JACK
    195194  if (usejack) {
     195    ev.buffer = midi_data + midi_event_count++ * 3;
     196    if (midi_event_count >= MAX_MIDI_EVENTS) {
     197      midi_event_count = 0;
     198    }
    196199    ev.buffer[2] = velo;
    197200    ev.buffer[1] = pitch;
Note: See TracChangeset for help on using the changeset viewer.