Jump to content

MIDI UDF


eynstyne
 Share

Recommended Posts

Hello la_saucisse,

Welcome to the forum and your English is fine. In the interest of solidarity - I have had the same experience as you. I could find and select my  devices and could get the notes working, but couldn't get any farther. I eventually gave up - I hope you have better luck. If you can make some headway with this maybe I'll be able to dust off my old stuff and get working on it again! Best of luck.

Link to comment
Share on other sites

  • 1 year later...

Hi,
I know this is an old thread, but I spent quite a long time to figure out sysex sending, so I want to share the solution I found:

Func SendSysex($HEXmessage)
    Local $data="0xF0" & $HEXmessage & "F7"
    Local $dbinary= Binary($data)
    Local $dlen=BinaryLen($dbinary)
    Local $stPreparedMidiHdr=_MidiOutPrepareHeader($hMidiOut2,$dbinary,$dlen,$dlen,"",0x03)  ; 0x03 for "MHDR_PREPARED"
    _MidiOutLongMsg($hMidiOut2, $stPreparedMidiHdr)
EndFunc

Enjoy! 

Link to comment
Share on other sites

take care, my code is for a secondary midi out called $hMidiOut2
If you just have one midi out with device name $hMidiOut, try this:

Func SendSysex($HEXmessage)
    Local $data="0xF0" & $HEXmessage & "F7"
    Local $dbinary= Binary($data)
    Local $dlen=BinaryLen($dbinary)
    Local $stPreparedMidiHdr=_MidiOutPrepareHeader($hMidiOut2,$dbinary,$dlen,$dlen,"",0x03)  ; 0x03 for "MHDR_PREPARED"
    _MidiOutLongMsg($hMidiOut, $stPreparedMidiHdr)
EndFunc

 

Link to comment
Share on other sites

Sorry, forgot to change in the _MidiOutPrepareHeader... And can't find the way to modify my post....
So the good code:

Func SendSysex($HEXmessage)
    Local $data="0xF0" & $HEXmessage & "F7"
    Local $dbinary= Binary($data)
    Local $dlen=BinaryLen($dbinary)
    Local $stPreparedMidiHdr=_MidiOutPrepareHeader($hMidiOut,$dbinary,$dlen,$dlen,"",0x03)  ; 0x03 for "MHDR_PREPARED"
    _MidiOutLongMsg($hMidiOut, $stPreparedMidiHdr)
EndFunc

 

Link to comment
Share on other sites

  • 6 months later...

sorry to wake up this thread, but this UDF is very interesting. I manage to send some MIDI to the output, but I did not succeed in receiving MIDI messages (simple and complex ones like SYSEX).

Does anybody have an example of MIDI receive to share ?

 

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...