BASS.NET API for the Un4seen BASS Audio LibraryBassMidiBASS_MIDI_StreamGetMark Method (Int32, BASSMIDIMarker, Int32, BASS_MIDI_MARK)BASS.NET API for the Un4seen BASS Audio Library
Retrieves a marker from a MIDI stream.

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

public static bool BASS_MIDI_StreamGetMark(
	int handle,
	BASSMIDIMarker type,
	int index,


Type: SystemInt32
The MIDI stream to retrieve the marker from.
Type: Un4seen.Bass.AddOn.MidiBASSMIDIMarker
The type of marker to retrieve, one of the following (see BASSMIDIMarker):
BASS_MIDI_MARK_COPYCopyright notice events (MIDI meta event 2).
BASS_MIDI_MARK_CUECue events (MIDI meta event 07).
BASS_MIDI_MARK_INSTInstrument name events (MIDI meta event 4).
BASS_MIDI_MARK_KEYSIGKey signature events (MIDI meta event 89). The marker text is in the form of "a b", where a is the number of sharps (if positive) or flats (if negative), and b signifies major (if 0) or minor (if 1).
BASS_MIDI_MARK_LYRICLyric events (MIDI meta event 05).
BASS_MIDI_MARK_MARKERMarker events (MIDI meta event 06).
BASS_MIDI_MARK_TEXTText events (MIDI meta event 01).
BASS_MIDI_MARK_TIMESIGTime signature events (MIDI meta event 88). The marker text is in the form of "a/b c d", where a is the numerator, b is the denominator, c is the metronome pulse, and d is the number of 32nd notes per MIDI quarter-note.
BASS_MIDI_MARK_TRACKTrack name events (MIDI meta event 3).
BASS_MIDI_MARK_TICKFLAG: get position in ticks instead of bytes.
Type: SystemInt32
The marker to retrieve... 0 = the first.
Type: Un4seen.Bass.AddOn.MidiBASS_MIDI_MARK
Instance of the BASS_MIDI_MARK class to receive the marker details.

Return Value

Type: Boolean
on success, else is returned. Use BASS_ErrorGetCode to get the error code.

The markers are ordered chronologically.

BASS_SYNC_MIDI_xxx Syncs can be used to be informed of when markers are encountered during playback.

If a lyric marker text begins with a '/' (slash) character, that means a new line should be started. If the text begins with a '\' (backslash) character, the display should be cleared. Lyrics can sometimes be found in BASS_MIDI_MARK_TEXT instead of BASS_MIDI_MARK_LYRIC markers.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not valid.
BASS_ERROR_ILLTYPEtype is not valid.
BASS_ERROR_ILLPARAMindex is not valid.


List a MIDI stream's markers:
Dim mark As New BASS_MIDI_MARK()
Dim idx As Integer = 0
While BassMidi.BASS_MIDI_StreamGetMark(handle, BASSMIDIMarker.BASS_MIDI_MARK_MARKER, idx, mark)
  idx += 1
  Console.WriteLine("{0}.Marker: {1}", idx, mark)
End While
int idx = 0;
while (BassMidi.BASS_MIDI_StreamGetMark(handle, BASSMIDIMarker.BASS_MIDI_MARK_MARKER, idx, mark))
  Console.WriteLine("{0}.Marker: {1}", idx, mark);
See Also