BASS.NET API for the Un4seen BASS Audio LibraryBassMidiBASS_MIDI_StreamGetEvent Method BASS.NET API for the Un4seen BASS Audio Library
Retrieves the current value of an event in a MIDI stream channel.

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

public static int BASS_MIDI_StreamGetEvent(
	int handle,
	int chan,
	BASSMIDIEvent eventtype


Type: SystemInt32
The MIDI stream to retrieve the event from (as returned by BASS_MIDI_StreamCreate(Int32, BASSFlag, Int32)).
Type: SystemInt32
The MIDI channel to get the event value from... 0 = channel 1.
Type: Un4seen.Bass.AddOn.MidiBASSMIDIEvent
The event value to retrieve (see BASSMIDIEvent for details on the available event types and their values). With the MIDI_EVENT_NOTE, MIDI_EVENT_KEYPRES, MIDI_EVENT_SCALETUNING and drum key (MIDI_EVENT_DRUM_CUTOFF/etc) events, the HIWORD - use MAKELONG(event,key) - can be used to specify which key/note to get the value from. Special MIDI_EVENT_NOTES and MIDI_EVENT_VOICES events are also available to check how many keys are pressed and how many voices are active, respectively.

Return Value

Type: Int32
The event parameter (see BASSMIDIEvent for details) if successful - else -1 (use BASS_ErrorGetCode to get the error code).

The MIDI_EVENT_NOTE event value will be 1 if the specified key is pressed and 0 if not. The MIDI_EVENT_NOTES event can be used to check how many keys in total are pressed in the specified channel. If a key is simultaneously pressed multiple times, it will still only be counted once.

SYNCs can be used to be informed of when event values change.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not valid.
BASS_ERROR_ILLPARAMOne of the other parameters is invalid.

See Also