MIDI and MCI Control
Keywords: MIDI control playing music payback playmedia
How do I start and stop MIDI playback?
The following code shows how to start and stop MIDI Playback. The PlayMidi can start it, but then you will have no control on stopping the playback.The code below shows how to use the PlayMedia function to start a midi playback and then later stop it.
midiname="c:\windows\media\canyon.mid" midiname=FileNameShort(midiname) ; for 32 bit only PlayMedia("open sequencer!%midiname% alias abc123") PlayMedia("play abc123") Message("midi","playing") PlayMedia("close abc123") Message("midi","stopped")MCI File Playback
MMSYSTEM 263 NOT REGISTERED THIS IS NOT A REGISTERED MCI DEVICEIf you're getting the error message above, and for more information on MCI device playback, take a look at the Microsoft Technical specifications on their Web site. (You'll have to subscribe now!) Search for MCIWnd Window Class. Or these links might work if you're already registered:http://premium.microsoft.com/msdn/library/sdkdoc/mciwnd_0xt7.htmorhttp://premium.microsoft.com/msdn/library/sdkdoc/mciwnd_75wz.htmMCIWnd is a window class for controlling multimedia devices. A library of functions, messages, and macros associated with MCIWnd provides a simple method to add multimedia playback or recording capabilities to your applications.
The Media Control Interface (MCI) provides standard commands for playing multimedia devices and recording multimedia resource files. These commands are a generic interface to nearly every kind of multimedia device.
Article ID: W13216Filename: Control and stop playback of MIDI and MCI files.txt