Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/utils.c

    rce54752 ra07fdb4  
    5555// more general stuff
    5656smpl_t silence_threshold = -90.;
     57smpl_t release_drop = 10.;
    5758uint_t mix_input = 0;
    5859
     
    7677
    7778#if HAVE_JACK
     79#define MAX_MIDI_EVENTS 128
     80#define MAX_MIDI_EVENT_SIZE 3
    7881aubio_jack_t *jack_setup;
    7982jack_midi_event_t ev;
     83jack_midi_data_t midi_data[MAX_MIDI_EVENTS * MAX_MIDI_EVENT_SIZE];
     84size_t midi_event_count = 0;
    8085#endif /* HAVE_JACK */
    8186
     
    129134void examples_common_del (void)
    130135{
    131 #ifdef HAVE_JACK
    132   if (ev.buffer) free(ev.buffer);
    133 #endif
    134136  del_fvec (ibuf);
    135137  del_fvec (obuf);
     
    147149
    148150#ifdef HAVE_JACK
    149     ev.size = 3;
    150     ev.buffer = malloc (3 * sizeof (jack_midi_data_t));
     151    ev.size = MAX_MIDI_EVENT_SIZE;
    151152    ev.time = 0; // send it now
    152153    debug ("Jack activation ...\n");
     
    194195#ifdef HAVE_JACK
    195196  if (usejack) {
     197    ev.buffer = midi_data + midi_event_count++ * MAX_MIDI_EVENT_SIZE;
     198    if (midi_event_count >= MAX_MIDI_EVENTS) {
     199      midi_event_count = 0;
     200    }
    196201    ev.buffer[2] = velo;
    197202    ev.buffer[1] = pitch;
Note: See TracChangeset for help on using the changeset viewer.