BASS_MIDI_FONTEX2 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;
    int minchan;
    int numchan;
} BASS_MIDI_FONTEX2;

Members

fontSoundfont handle, previously initialized with BASS_MIDI_FontInit.
spresetSoundfont preset number... 0-127, -1 = use all presets.
sbankSoundfont bank number... 0-128, -1 = use all banks.
dpresetDestination preset/program number... 0-65535, -1 = all presets. This determines what MIDI_EVENT_PROGRAM event value(s) the soundfont is used for.
dbankDestination 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.
dbanklsbDestination bank number LSB. This is the MIDI_EVENT_BANK_LSB event value that the soundfont is used for.
minchanMinimum MIDI channel number... 0 = channel 1. This and numchan determine which MIDI channels the soundfont is used in.
numchanNumber of MIDI channels from minchan... 0 = unlimited.

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) and channel-specific config.

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.

See also

BASS_MIDI_FontInit, BASS_MIDI_StreamGetFonts, BASS_MIDI_StreamSetFonts