Form1 Form1 Form1 Text1 Text1 Label1 Status Label2 Channel Text2 Text2 Label3 Data1 Text3 Text3 Label4 Data2 Text4 Text4 Command2 Command1 Send Data Form_Click& Form_Load Midiopen hmidi midiOutOpen MIDIMAPPER lphMidiOut PHMidiOut uDeviceID dwCallback dwInstance dwFlags Longint remfunction MessageBox Form_Unload Cancelm midiOutClose hMidiOut Command1_Click midiOutMessage message statuse channel data1; data2 Text1_Change text1 Text2_Change channle( text2 Text3_Change text3 Text4_ChangeA text4K midiOutShortMsg Command1_KeyPress KeyAscii lmessage istatus ichannel idata1 idata2 MsgBix ldata2 Label4_Click Command2_Click ErrCode Label3_Click Label2_Click Label1_Click Form_Load Listing 2 Try to open the default MIDI device. Quit w/error if unable to.D Error code " , 16, "Error!") Send the patch change for voice 25, the steel-e string guitar in General MIDI. Set default values in the text boxes. This is the Note On message.x This value isn't used for note on.e Middle C. Maximum volume. Form_Unload Listing 3 Close the MIDI device. This must be done; otherwise it can't be used untilt Windows is restarted. Command1_Click Listing 4 The 3 bytes of a MIDI message must be written to lmessage. Send the message to the hmidi device handle.l Text1_Change Listing 6 This is the status byte portion ' of the MIDI message. Convert the value in the text box to an integer.i Text2_Change Listing 7 This is the channel nybble of the status byte.n Text3_Change Listing 8 The first of 2 data bytes.e Convert the value in the text box to an integer.i Text4_Change Listing 9 The second of 2 data bytes. Convert the value in the text box to an integer.i Command2_Click Listing 5 Make sure you close the MIDI device handled before quitting VB.