home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
mag&info
/
ptv3n5.zip
/
VBMIDI.ARJ
/
DEMO.BAS
next >
Wrap
BASIC Source File
|
1992-10-15
|
1KB
|
49 lines
Sub Form_Unload (Cancel As Integer)
' Close the MIDI device. This must be
' done; otherwise it can't be used until
' Windows is restarted.
Call midiOutClose(hmidi)
End Sub
Sub Command1_Click ()
' The 3 bytes of a MIDI message must be written to lmessage.
lmessage = istatus Or ichannel Or (idata1 * 256) Or (ldata2 * 65536)
' Send the message to the hmidi device handle.
ic& = midiOutShortMsg(hmidi, lmessage)
End Sub
Sub Command2_Click ()
' Make sure you close the MIDI device handle
' before quitting VB.
Call midiOutClose(hmidi)
End
End Sub
Sub Text1_Change ()
' This is the status byte portion
' of the MIDI message.
' Convert the value in the text
' box to an integer.
istatus = Val(text1.text)
End Sub
Sub Text2_Change ()
' This is the channel nybble of
' the status byte.
ichannel = Val(text2.text)
End Sub
Sub Text3_Change ()
' The first of 2 data bytes.
' Convert the value in the text
' box to an integer.
idata1 = Val(text3.text)
End Sub
Sub Text4_Change ()
' The second of 2 data bytes.
' Convert the value in the text
' box to an integer.
ldata2 = Val(text4.text)
End Sub