02-25-2010, 08:07 AM
Does not work. QM doesn't seem to be running most of the code.
Played around:
Function MIDI_SysEx
That ERRORS: The specified device handle is invalid. (NOTE: EXAMPLE above fixed. Now works!!!)
Played around:
Function MIDI_SysEx
function str'SysEx;;Sends MIDI SysEx command over Windows default MIDI device.
int handle e
MIDIHDR midiHdr
SysEx.decrypt(8 SysEx)
if !midiOutOpen(&handle 0 0 0 CALLBACK_NULL)
,midiHdr.lpData=SysEx
,midiHdr.dwBufferLength=SysEx.len
,e = midiOutPrepareHeader(handle &midiHdr sizeof(MIDIHDR))
,if !e
,,e = midiOutLongMsg(handle &midiHdr sizeof(MIDIHDR))
,if e
,,,str errMsg.all(120)
,,,midiOutGetErrorText(e errMsg 120)
,,,out "Error: %s" errMsg
,,rep
,,,if(MIDIERR_STILLPLAYING != midiOutUnprepareHeader(handle &midiHdr sizeof(MIDIHDR))) break
,,,1
,midiOutClose(handle)
,ret 1