BASS_MIDI_FONTEX structure
Used with BASS_MIDI_StreamSetFonts and BASS_MIDI_StreamGetFonts to set and retrieve soundfont configurations.
typedef struct { HSOUNDFONT font; int spreset; int sbank; int dpreset; int dbank; int dbanklsb; } BASS_MIDI_FONTEX;
Members
font | Soundfont handle, previously initialized with BASS_MIDI_FontInit. |
spreset | Soundfont preset number... 0-127, -1 = use all presets. |
sbank | Soundfont bank number... 0-128, -1 = use all banks. |
dpreset | Destination preset/program number... 0-65535, -1 = all presets. This determines what MIDI_EVENT_PROGRAM event value(s) the soundfont is used for. |
dbank | Destination bank number, or a base bank number when using all presets from all banks. This determines what MIDI_EVENT_BANK event value(s) the soundfont is used for. |
dbanklsb | Destination bank number LSB. This is the MIDI_EVENT_BANK_LSB event value that the soundfont is used for. |
Remarks
This is an extended version of the BASS_MIDI_FONT structure that allows more flexible mapping of soundfont presets to MIDI programs, including access to the bank LSB (eg. MIDI controller 32).When using an individual preset from a soundfont, BASSMIDI will first look for the exact spreset and sbank match, but if that is not present, the first preset from the soundfont will be used. This is useful for single preset soundfonts. Individual presets can be assigned to program numbers beyond the standard 127 limit, up to 65535, which can then be accessed via BASS_MIDI_StreamEvent.
When using all presets from all banks in a soundfont, the dbank member is a base number that is added to the soundfont's banks. For example, if dbank = 1 then the soundfont's bank 0 becomes bank 1, etc. Negative base numbers are allowed, to lower a soundfont's bank numbers.
The bank LSB raises the maximum number of melodic banks from 128 to 16384 (128 x 128), but the SF2 soundfont format only supports 128 banks, so a soundfont that is set to be used on all banks (dpreset and dbank are -1) will still only apply to the single bank LSB specified by dbanklsb.