Applies a soundfont configuration to a MIDI stream, or sets the default soundfont configuration.
Namespace: Un4seen.Bass.AddOn.Midi
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.2
Syntax
[DllImportAttribute("bassmidi")] public static bool BASS_MIDI_StreamSetFonts( int handle, BASS_MIDI_FONT[] fonts, int count )
Parameters
- handle
- Type: SystemInt32
The MIDI stream to apply the soundfonts to... 0 = set default soundfont configuration. - fonts
- Type: Un4seen.Bass.AddOn.MidiBASS_MIDI_FONT
The pointer to an array of BASS_MIDI_FONT soundfonts to apply. - count
- Type: SystemInt32
The number of elements in the fonts array.
Return Value
Type: BooleanIf successful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks
Changing the default configuration only affects subsequently created MIDI streams. Existing streams that are using the previous default configuration will continue to use that previous configuration.
On Windows, the default default configuration will be to use the Creative 4MB (CT4MGM.SF2) or 2MB (CT2MGM.SF2) soundfont when present in the Windows system directory.
ERROR CODE | Description |
---|---|
BASS_ERROR_HANDLE | handle is not valid. |
BASS_ERROR_ILLPARAM | Something in the fonts array is invalid, check the soundfont handles. |
Examples
// first initialize the fonts int font1 = BassMidi.BASS_MIDI_FontInit("afont.sf2"); int font2 = BassMidi.BASS_MIDI_FontInit("bfont.sf2"); BASS_MIDI_FONT[] newfonts = { new BASS_MIDI_FONT(font1, -1, 0), new BASS_MIDI_FONT(font2, -1, 0) }; // now set them BassMidi.BASS_MIDI_StreamSetFonts(_stream, newfonts, newfonts.Length);
See Also