Garth Hjelte <garth <at> chickensys.com>
2014-09-26 19:40:03 GMT
In the API:
>The synthesizer can load any number of SoundFonts. The loaded SoundFonts are treated as a stack, where
each new loaded SoundFont is placed at the top of the stack. When selecting presets by bank and program
numbers, SoundFonts are searched beginning at the top of the stack. In the case where there are presets in
different SoundFonts with identical bank and program numbers, the preset from the most recently loaded
SoundFont is used. The fluid_synth_program_select() can be used for unambiguously selecting a preset
or bank offsets could be applied to each SoundFont with fluid_synth_set_bank_offset(), to try and
ensure that each preset has unique bank and program numbers.
I just want to make sure I got this right. I want to use multiple SoundFonts, but I'm not in a position to dicker
around with the BankNum setting in the SoundFonts I create, they'll always be set to 0.
So this is where fluid_synth_set_bank_offset() comes in handy, right? For each SF loaded I'd do something
fluid_synth_set_bank_offset(synth, sfont_id[MySoundFontIndex], MySoundFontIndex);
So then to switch to a new soundfont for NoteOn, I do this:
fluid_synth_program_select(synth, MIDIChannel, BankNum, PresetNum);
Then every fluid_synth_noteon() call, the Preset that's played is the SoundFont represented by the
BankNum, and the PresetNum in that Bank, right?
In other words I'm switching SoundFont's by switching BankNum's, without hardchanging the BankNum in the
SF's. All SF's that I use (I create them from scratch on the fly) will have one Bank with BankNum=0.
(Perhaps there's other ways of toggling between SF's, I just thought this may be the best way for me. Any
suggestions are welcome.)
But is this correct; is this how fluid_synth_set_bank_offset works?