Preloads presets from a soundfont.
BOOL BASS_MIDI_FontLoad( HSOUNDFONT handle, int preset, int bank );
|The soundfont handle.
|Preset number to load... -1 = all presets.
|Bank number to load... -1 = all banks.
|handle is not valid.
|A supporting BASS add-on to decode the SF2 samples is not loaded.
|An SFZ sample has an unknown file format. A BASS add-on may be needed to handle it.
|The soundfont does not contain the requested preset.
|There is insufficient memory.
This function will fail (BASS_ERROR_FILEFORM) if an SFZ sample's format is unrecognised but will not fail if a sample is missing, as that may be used to silence other regions in the SFZ file.
When preloading samples to render a MIDI file stream, it is more efficient to use BASS_MIDI_StreamLoadSamples to preload the specific samples that the MIDI stream will use rather than preloading the entire soundfont.
Samples that are preloaded by this function are not affected by automatic compacting via the BASS_CONFIG_MIDI_COMPACT option, but can be compacted/unloaded manually with BASS_MIDI_FontCompact and BASS_MIDI_FontUnload.
It is possible to only partially preload presets to save time and memory with BASS_MIDI_FontLoadEx.