Hi David,
2017-12-21 14:45 GMT+01:00 David Back <
address@hidden>:
>
> Yes it is working now, I have managed to get bank 1 selected and just as
> you prophesied I needed to use an offset of -1 to select it.
That is weird, because from looking at your code, I wouldn't have expected it to work.
> int Division::loadSoundFont(char* sfont, int reverb, int bank){
> int sfID = 0;
> int offset;
> offset = -bank;
> sfID = fluid_synth_sfload(synth, sfont, 1);
Here you load the soundfont and also reset all channels (because you passed 1 as the last parameter).
> fluid_settings_setint(settings, "synth.reverb.active", reverb); //***not convinced its working
Toggling reverb is completely independent of soundfont loading, it's a setting on the synth object itself. And the 'synth.reverb.active' setting is only examined when first creating the synth using new_fluid_synth. But you can enable or disable reverb with the fluid_synth_set_reverb_on function. But in any case, it has no logical connection to sound font loading, so it seems out of place in a loadSoundFont function IMHO.
> fluid_synth_set_bank_offset(synth, sfID, offset);
Only now do you set the bank offset, but you don't reset the channels again. The fact that you say it's working as intended seems to indicate that you do manual fluid_synth_program_change calls later on, in a different function. In that case, you could simply do what Tom suggested in the original thread: just use fluid_synth_bank_select before doing the program changes. No need to mess with bank offsets at all.
Cheers,
Marcus