Struct MidiFontEx
Used with StreamSetFonts(Int32, MidiFontEx[], Int32) and StreamGetFonts(Int32, MidiFontEx[], Int32) to set and retrieve soundfont configurations.
Namespace: System.Dynamic.ExpandoObject
Assembly: ManagedBass.Midi.dll
Syntax
public struct MidiFontEx
Remarks
This is an extended version of the MidiFont 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 SoundFontPreset and SoundFontBank 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 StreamEvent(Int32, Int32, MidiEventType, Int32).
When using all presets from all banks in a soundfont, the DestinationBank member is a base number that is added to the soundfont's banks. For example, if DestinationBank = 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 (DestinationPreset and DestinationBank are -1) will still only apply to the single bank LSB specified by DestinationBankLSB.
Fields
DestinationBank
Destination bank number, or a base bank number when using all presets from all banks. This determines what Bank event value(s) the soundfont is used for.
Declaration
public int DestinationBank
Field Value
Int32
|
DestinationBankLSB
Destination bank number LSB. This is the BankLSB event value that the soundfont is used for.
Declaration
public int DestinationBankLSB
Field Value
Int32
|
DestinationPreset
Destination preset/program number... 0-65535, -1 = all presets. This determines what Program event value(s) the soundfont is used for.
Declaration
public int DestinationPreset
Field Value
Int32
|
Handle
Soundfont handle, previously inititialized with FontInit(String, FontInitFlags).
Declaration
public int Handle
Field Value
Int32
|
SoundFontBank
Soundfont bank number... 0-128, -1 = use all banks.
Declaration
public int SoundFontBank
Field Value
Int32
|
SoundFontPreset
Soundfont preset number... 0-127, -1 = use all presets.
Declaration
public int SoundFontPreset
Field Value
Int32
|