Microsoft KB Archive/84473

= VB MCI Control Does Not Support Recording of MIDI Data =

Article ID: 84473

Article Last Modified on 11/18/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Professional Toolkit for Microsoft Visual Basic programming system for Windows

-



This article was previously published under Q84473



SUMMARY
The Multimedia Device control called MCI (MCI.VBX), consists of a set of high level, device-independent commands that control audio and visual peripherals. However, the MCI control cannot record standard MIDI (Musical Instrument Data Interface) input. This is a limitation of the MCI control, not of Visual Basic for Windows.

Below is an example of using the MCI control to play back a MIDI file.



MORE INFORMATION
The MCI custom control can play back MIDI files if you have the necessary hardware and software installed. Typically, you need a sound board that supports MIDI and Windows, version 3.1 to use the MCI control to play back MIDI files. Windows 3.1 or (Windows 3.0 with Multimedia Extensions version 1.0) supplies MIDI drivers for several well-known hardware add-on boards that support MIDI.

The following is an example of using the MCI control to play back a MIDI file called TEST.MID.

 Run Visual Basic for Windows, or from the File menu, choose New Project (press ALT, F, N) if Visual Basic for Windows is already running. Form1 is created by default. From the File menu, choose Add File. In the Files box, select the MCI.VBX custom control file. The MCI tool appears in the Toolbox.  Add the following code to the Form_Load event procedure: Sub Form_Load MMControl1.PlayVisible = -1 MMControl1.StopVisible = -1 MMControl1.FileName = &quot;c:\midi\bach.mid&quot; MMControl1.Wait = -1 MMControl1.DeviceType = &quot;sequencer&quot; MMControl1.Command = &quot;open&quot; End Sub   Add the following code to your Form_Unload event procedure: Sub Form_Unload (Cancel As Integer) MMControl1.Command = &quot;close&quot; End Sub  Press the F5 key to run the program. Click the play arrow of the MCI control to play the MIDI file.

NOTE: An MIDI file may play, but may not be audible due to MIDI configuration issues such as the MIDI channel and instrument.

Additional query words: 1.00 2.00 3.00

Keywords: KB84473

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.