BASS.NET API for the Un4seen BASS Audio Library

BassMidiBASS_MIDI_StreamGetPreset Method

BASS.NET API for the Un4seen BASS Audio Library
Retrieves the preset currently in use on a channel of a MIDI stream.

Namespace:  Un4seen.Bass.AddOn.Midi
Assembly:  Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax

[DllImportAttribute("bassmidi")]
public static bool BASS_MIDI_StreamGetPreset(
	int handle,
	int chan,
	BASS_MIDI_FONT font
)

Parameters

handle
Type: SystemInt32
The MIDI stream to retrieve the soundfont configuration of... 0 = get default soundfont configuration.
chan
Type: SystemInt32
The MIDI channel... 0 = channel 1.
font
Type: Un4seen.Bass.AddOn.MidiBASS_MIDI_FONT
Pointer to a structure to receive the preset information.

Return Value

Type: Boolean
If successful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

This function tells what preset from what soundfont is currently being used on a particular MIDI channel. That information can be used to get the preset's name from BASS_MIDI_FontGetPreset(Int32, Int32, Int32).

No preset information will be available for a MIDI channel until a note is played in that channel. The present and bank numbers will not necessarily match the channel's current MIDI_EVENT_PROGRAM and MIDI_EVENT_BANK event values, but rather what the MIDI stream's soundfont configuration maps those event values to.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not valid.
BASS_ERROR_ILLPARAMchan is not valid.
BASS_ERROR_NOTAVAILNo preset is currently in use on the specified MIDI channel.

See Also

Reference