; eynstyne
; http://www.autoitscript.com/forum/topic/37072-midi-udf/page__view__findpost__p__810725
#include <Midiudf.au3>
$open = _MidiOutOpen()
If @error Then
	MsgBox(0, "Ошибка", "MIDI-устройство занято другим приложением")
	Exit
EndIf
$iNote = 29
$iVolume = 127
AdlibRegister('_Note', 500)
GUICreate("Тест", 140, 120)
GUISetState()
Do
Until GUIGetMsg() = -3
_MidiOutClose($open)

Func _Note()
	_MidiOutShortMsg($open, 0x90 + ($iNote * 256) + ($iVolume * 0x10000))
	$iNote += 1
EndFunc