I am using the Windows MIDI interface for communicating with my MIDI devices.
Everything works fine, also with system-exclusive messages as long as a SYSEX message is framed with 0xF0 <data> 0xF7.
Well, I have an old Sampler (AKAI S900) which uses SYSEX without the 0xF7 at the end (common sample dump). My problem is, when the Sampler sends this string (0xF0 <some data>), I do not get it, because the Win32 API seems to wait for the trailing 0xF7 at the end of the SYSEX message.
How can I tell the MIDI interface to tell me immediately when a byte is available on the MIDI input, and not only when a complete message is received?
Currently, my code looks like this:
midiInOpen(&device_in,
selected_midi_in_interface(DWORD_PTR)midi_in_callback,
0, CALLBACK_FUNCTION);
...
midiHdr_in.lpData = temp_input;
midiHdr_in.dwBufferLength = (DWORD)input_len;
midiHdr_in.dwFlags = 0;
midiInPrepareHeader(device_in, &midiHdr_in, sizeof(MIDIHDR));
...
midiInAddBuffer(device_in, &midiHdr_in, sizeof(MIDIHDR));
midiInStart(device_in);
...
while (GetMessage(&Msg, NULL, 0, 0) > 0){
TranslateMessage(&Msg);
DispatchMessage(&Msg);
// Check if midiHdr_in.dwBytesRecorded has changed...
...
}