midiInStart

Syntax

WORD midiInStart(hMidiIn)

This function starts MIDI input on the specified MIDI input device.

Parameters

HMIDIIN hMidiIn

Specifies a handle to the MIDI input device.

Return Value

Returns zero if the function was successful. Otherwise, it returns an error number. Possible error returns are:

MMSYSERR_INVALHANDLE

Specified device handle is invalid.

Comments

This function resets the timestamps to zero; timestamp values for subsequently received messages are relative to the time this function was called.

All messages other than system exclusive messages are sent directly to the client when received. System exclusive messages are placed in the buffers supplied by midiInAddBuffer; if there are no buffers in the queue, the data is thrown away without notification to the client, and input continues.

Buffers are returned to the client when full, when a complete system exclusive message has been received, or when midiInReset is called. The dwBytesRecorded field in the header will contain the actual length of data received.

Calling this function when input is already started has no effect, and the function returns zero.

See Also

midiInStop, midiInReset