BASS.NET API for the Un4seen BASS Audio LibraryMIDIINPROC DelegateBASS.NET API for the Un4seen BASS Audio Library
User defined callback delegate to receive MIDI data (to be used with BASS_MIDI_InInit(Int32, MIDIINPROC, IntPtr)).

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

public delegate void MIDIINPROC(
	int device,
	double time,
	IntPtr buffer,
	int length,
	IntPtr user
)

Parameters

device
Type: SystemInt32
The MIDI input device that the data is from.
time
Type: SystemDouble
Timestamp, in seconds since BASS_MIDI_InStart(Int32) was called.
buffer
Type: SystemIntPtr
Pointer to the MIDI data.
length
Type: SystemInt32
The amount of data in bytes.
user
Type: SystemIntPtr
The user instance data given when BASS_MIDI_InInit(Int32, MIDIINPROC, IntPtr) was called.
Examples

VB
Private _midiProc As MIDIINPROC
Private _midiStream As Integer
...
' create a MIDI input callback delegate
_midiProc = New MIDIINPROC(AddressOf MyMidiInProc)
BassMidi.BASS_MIDI_InInit(0, _midiProc, IntPtr.Zero);
...
' create a MIDI input callback delegate
_midiStream = BassMidi.BASS_MIDI_StreamCreate(16, BASSFlag.BASS_DEFAULT, 44100)
...
Private Procedure MyMidiInProc(handle As Integer, buffer As IntPtr, length As Integer, user As IntPtr)
    ' forward the data to the MIDI stream
    BassMidi.BASS_MIDI_StreamEvents(_midiStream, BASSMIDIEventMode.BASS_MIDI_EVENTS_NONE, 0, buffer, length)
End Procedure
private MIDIINPROC _midiProc;
private int _midiStream;
...
// create a MIDI input callback delegate
_midiProc = new MIDIINPROC(MyMidiInProc);
BassMidi.BASS_MIDI_InInit(0, _midiProc, IntPtr.Zero);
...
// create a MIDI stream to play the MIDI data
_midiStream = BassMidi.BASS_MIDI_StreamCreate(16, BASSFlag.BASS_DEFAULT, 44100);
...
private void MyMidiInProc(int device, double time, IntPtr buffer, int length, IntPtr user)
{
    // forward the data to the MIDI stream
    BassMidi.BASS_MIDI_StreamEvents(_midiStream, BASSMIDIEventMode.BASS_MIDI_EVENTS_NONE, 0, buffer, length);
}
See Also

Reference