From 6f8c4863e5c74c3434f6d4c6aeb8e46b6f1bfbad Mon Sep 17 00:00:00 2001 From: pepper Date: Sat, 31 Jan 2015 15:02:26 -0800 Subject: final cleanup --- src/ladspa_run_synth.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/ladspa_run_synth.c') diff --git a/src/ladspa_run_synth.c b/src/ladspa_run_synth.c index 92f0782..26416a9 100644 --- a/src/ladspa_run_synth.c +++ b/src/ladspa_run_synth.c @@ -1,6 +1,6 @@ #include "dssi-render.h" #include "midi/midi_loader.h" - +#define DEBUG 0 /* Instead of creating an alsa midi input, we fill in two events * note-on and note-off */ inline int @@ -13,11 +13,15 @@ void ladspa_run_sample_callback(event_table_t *event_table, void *userdata){ nframes = event_table->nframes_since_last; nframes = nframes > 0 ? nframes : 1; //is it nframes that has the negative value? or event_table length? well they are both size_t, can't be negative. i guess need to add prints to see what's going on - printf("nframes: 0x%x\n", nframes); - printf("outs: 0x%x\n", outs); + if(DEBUG){ + printf("nframes: 0x%x\n", nframes); + printf("outs: 0x%x\n", outs); + } for (int i = 0; i < outs; i++) { pluginOutputBuffers[i] = (float *)realloc(pluginOutputBuffers[i], nframes * sizeof(float)); - printf("i: 0x%x buff: 0x%x\n", i, pluginOutputBuffers[i]); + if (DEBUG){ + printf("i: 0x%x buff: 0x%x\n", i, pluginOutputBuffers[i]); + } memset(pluginOutputBuffers[i], 0, nframes * sizeof(float)); } connect_ports(); @@ -111,9 +115,10 @@ void ladspa_run_sample_callback(event_table_t *event_table, void *userdata){ fprintf(stderr, "%s: %s\n", my_name, sf_strerror(outfile)); return; } - fprintf(stdout, "%s: Wrote %d frames to %s\n", - my_name, items_written, output_file); - + if(DEBUG){ + fprintf(stdout, "%s: Wrote %d frames to %s\n", + my_name, items_written, output_file); + } } -- cgit v1.2.3-70-g09d2