summaryrefslogtreecommitdiff
path: root/libs/plugins
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-10-05 15:01:12 +0200
committerRobin Gareus <robin@gareus.org>2016-10-05 15:01:12 +0200
commit6821f54817e03a55f100f422b6c0bba4328c8fb8 (patch)
tree5caa915a0e0edd3e3811dafee626e0e7559ad0cd /libs/plugins
parent22f342c8d89d2e865dc0a397c83855ffa9310072 (diff)
add debug info to a-fluidsynth
Diffstat (limited to 'libs/plugins')
-rw-r--r--libs/plugins/a-fluidsynth.lv2/a-fluidsynth.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.c b/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.c
index 1af651be3f..4dcfa9347f 100644
--- a/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.c
+++ b/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.c
@@ -135,13 +135,34 @@ load_sf2 (AFluidSynth* self, const char* fn)
return false;
}
+ // Dump Program
+ // TODO consider lv2_log_note()
+#ifndef NDEBUG
+ printf (" ---- a-fluid synth ----\n");
+ printf ("SoundFont %s\n", fn);
+#endif
int chn;
fluid_preset_t preset;
sfont->iteration_start (sfont);
- for (chn = 0; sfont->iteration_next (sfont, &preset) && chn < 15; ++chn) {
- fluid_synth_program_select (self->synth, chn, synth_id,
- preset.get_banknum (&preset), preset.get_num (&preset));
+ for (chn = 0; sfont->iteration_next (sfont, &preset); ++chn) {
+#ifndef NDEBUG
+ printf ("Bank %3d Prog: %3d '%s'\n",
+ preset.get_banknum (&preset),
+ preset.get_num (&preset),
+ preset.get_name (&preset));
+#endif
+ if (chn < 16) {
+ fluid_synth_program_select (self->synth, chn, synth_id,
+ preset.get_banknum (&preset), preset.get_num (&preset));
+ } else {
+#ifdef NDEBUG
+ break;
+#endif
+ }
}
+#ifndef NDEBUG
+ printf (" ---- ------------- ----\n");
+#endif
if (chn == 0) {
return false;
@@ -255,6 +276,9 @@ instantiate (const LV2_Descriptor* descriptor,
fluid_settings_setnum (self->settings, "synth.sample-rate", rate);
fluid_settings_setint (self->settings, "synth.parallel-render", 1);
fluid_settings_setint (self->settings, "synth.threadsafe-api", 0);
+#ifndef NDEBUG // THIS IS NOT REALTIME SAFE (!)
+ fluid_settings_setint (self->settings, "synth.verbose", 1);
+#endif
self->synth = new_fluid_synth (self->settings);