GFMidi/Testfrm.frm
VERSION 5.00
Begin VB.Form Testfrm
Caption = "Form1"
ClientHeight = 3075
ClientLeft = 60
ClientTop = 435
ClientWidth = 4635
LinkTopic = "Form1"
ScaleHeight = 3075
ScaleWidth = 4635
StartUpPosition = 3 'Windows‑Standard
End
Attribute VB_Name = "Testfrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'(c)2003, 2004 by Louis.
'
'Downloaded from www.louis‑coder.com.
'Simple sample demonstrating how to use MIDI to play notes with any supported instrument.
'A good possibility to play simple sounds or even songs in games. This sample is a good way to start.
'Please view MSDN for further help (midiX‑API‑functions).
'
'Form_Load
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Call GFMidi_PlayNote(KeyCode)
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Call GFMidi_PlayNote(KeyCode)
End Sub
Private Sub Form_Load()
'on error resume next
Dim Temp As Long
Call GFMidi_Initialize(127, 1)
Call GFMidi_SetInstrument(10)
' For Temp = 0 To 127 'kinda cool!
' Call GFMidi_SetInstrument(Temp)
' Call GFMidi_PlayNote(44)
' Call Sleep(200)
' Call GFMidi_StopNote(44)
' Next Temp
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call GFMidi_Terminate
End Sub
[END OF FILE]