VB MCI Control Does Not Support Recording of MIDI Data
ID: Q84473
|
The information in this article applies to:
-
Microsoft Visual Basic Professional Edition for Windows, versions 2.0, 3.0
-
Microsoft Professional Toolkit for Microsoft Visual Basic programming system for Windows, version 1.0
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 = "c:\midi\bach.mid"
MMControl1.Wait = -1
MMControl1.DeviceType = "sequencer"
MMControl1.Command = "open"
End Sub
- Add the following code to your Form_Unload event procedure:
Sub Form_Unload (Cancel As Integer)
MMControl1.Command = "close"
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 :
Version :
Platform :
Issue type :
|