BASS MIDI

MIDIINPROC callback


User defined callback function to receive MIDI data.

void CALLBACK MidiInProc(
    DWORD device,
    double time,
    const BYTE *buffer,
    DWORD length,
    void *user
);

Parameters

deviceThe MIDI input device that the data is from.
timeTimestamp, in seconds since BASS_MIDI_InStart was called.
bufferPointer to the MIDI data.
lengthThe amount of data in bytes.
userThe user instance data given when BASS_MIDI_InInit was called.

Example

A callback function that forwards the received data to a MIDI stream.
stream=BASS_MIDI_StreamCreate(16, 0, 0); // create a MIDI stream to play the MIDI data

...

void CALLBACK MidiInProc(DWORD device, double time, const BYTE *buffer, DWORD length, void *user)
{
    BASS_MIDI_StreamEvents(stream, BASS_MIDI_EVENTS_RAW, buffer, length); // forward the data to the MIDI stream
}

See also

BASS_MIDI_InInit