Changeset 088760e for examples/utils.c
- Timestamp:
- Oct 31, 2018, 10:26:52 PM (5 years ago)
- Branches:
- feature/constantq
- Children:
- c03d191
- Parents:
- 45c2c5c (diff), 7a54b37 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/utils.c
r45c2c5c r088760e 55 55 // more general stuff 56 56 smpl_t silence_threshold = -90.; 57 smpl_t release_drop = 10.; 57 58 uint_t mix_input = 0; 58 59 … … 63 64 aubio_source_t *this_source = NULL; 64 65 aubio_sink_t *this_sink = NULL; 65 fvec_t *i buf;66 fvec_t *o buf;66 fvec_t *input_buffer; 67 fvec_t *output_buffer; 67 68 68 69 smpl_t miditap_note = 69.; … … 76 77 77 78 #if HAVE_JACK 79 #define MAX_MIDI_EVENTS 128 80 #define MAX_MIDI_EVENT_SIZE 3 78 81 aubio_jack_t *jack_setup; 79 82 jack_midi_event_t ev; 83 jack_midi_data_t midi_data[MAX_MIDI_EVENTS * MAX_MIDI_EVENT_SIZE]; 84 size_t midi_event_count = 0; 80 85 #endif /* HAVE_JACK */ 81 86 … … 122 127 #endif /* HAVE_JACK */ 123 128 } 124 i buf= new_fvec (hop_size);125 o buf= new_fvec (hop_size);129 input_buffer = new_fvec (hop_size); 130 output_buffer = new_fvec (hop_size); 126 131 127 132 } … … 129 134 void examples_common_del (void) 130 135 { 131 #ifdef HAVE_JACK 132 if (ev.buffer) free(ev.buffer); 133 #endif 134 del_fvec (ibuf); 135 del_fvec (obuf); 136 del_fvec (input_buffer); 137 del_fvec (output_buffer); 136 138 aubio_cleanup (); 137 139 fflush(stderr); … … 147 149 148 150 #ifdef HAVE_JACK 149 ev.size = 3; 150 ev.buffer = malloc (3 * sizeof (jack_midi_data_t)); 151 ev.size = MAX_MIDI_EVENT_SIZE; 151 152 ev.time = 0; // send it now 152 153 debug ("Jack activation ...\n"); … … 166 167 167 168 do { 168 aubio_source_do (this_source, i buf, &read);169 process_func (i buf, obuf);169 aubio_source_do (this_source, input_buffer, &read); 170 process_func (input_buffer, output_buffer); 170 171 // print to console if verbose or no output given 171 172 if (verbose || sink_uri == NULL) { … … 173 174 } 174 175 if (this_sink) { 175 aubio_sink_do (this_sink, o buf, hop_size);176 aubio_sink_do (this_sink, output_buffer, hop_size); 176 177 } 177 178 blocks++; … … 194 195 #ifdef HAVE_JACK 195 196 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 } 196 201 ev.buffer[2] = velo; 197 202 ev.buffer[1] = pitch;
Note: See TracChangeset
for help on using the changeset viewer.