home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / p / ptv3n5.zip / VBMIDI.ZIP / FORMLOAD.BAS < prev    next >
BASIC Source File  |  1992-10-15  |  692b  |  29 lines

  1. Sub Form_Load ()
  2.   ' Try to open the default MIDI device.
  3.   ErrCode = midiOutOpen(hmidi, -1, 0, 0, 0)
  4.   ' Quit w/error if unable to.
  5.   If ErrCode <> 0 Then
  6.     st$ = "Error code " + Str$(ErrCode)
  7.     MsgBox (st$) ', 16, "Error!")
  8.     End
  9.   Else
  10.    ' Send the patch change
  11.    ' for voice 25, the steel-
  12.    ' string guitar in General MIDI.
  13.    lmessage = &HC0 Or 0 Or (25 * 256) Or (0 * 65536)
  14.    ic& = midiOutShortMsg(hmidi, lmessage)
  15. End If
  16.  
  17. ' Set default values in the text boxes.
  18.  
  19. ' This is the Note On message.
  20. text1.text = "&h90"
  21. ' This value isn't used for note on.
  22. text2.text = "0"
  23. ' Middle C.
  24. text3.text = "64"
  25. ' Maximum volume.
  26. text4.text = "127"
  27.  
  28. End Sub
  29.