Dynamic HTML in Action

The Interactive Music Control is a way to add interactive music to your Web pages and use almost no bandwidth. It can work in concert with the Microsoft Synthesizer to provide high quality audio that is more controllable than MIDI, another popular format of audio file.

With the Interactive Music Control, you can specify many characteristics, including Style, Personality, Band, Motif, Transition, Length, Shape, and Activity Level of the music. These all have different effects. For example, Band specifies the type of instruments used, the volume, and the balance of the music. Shape controls sound intensity in terms of the number of instruments and their activity. Code Listing 18-8 demonstrates the Interactive Music Control in use.

Code Listing 18-8.

<HTML> <HEAD> <TITLE>Listing 18-8</TITLE> <OBJECT ID="IMC" CLASSID="clsid:D2377D41-E6FD-11CF-8DCF-00AA00C01802" CODEBASE="http://activex.microsoft.com/controls/music/ IMSTUP21.CAB#version=2,1,0,14"> [must be part of previous line] <PARAM NAME="Activity" VALUE="1"> <PARAM NAME="Length" VALUE="80"> <PARAM NAME="MaxCPU" VALUE="30"> <PARAM NAME="NumVoices" VALUE="10"> <PARAM NAME="Style" VALUE="http://www.microsoft.com/music/styles/DANCEMIX.STY"> <PARAM NAME="Personality" VALUE="http://www.microsoft.com/music/styles/POPDIA.PER"> <PARAM NAME="PlayImmediate" VALUE="1"> <PARAM NAME="Repeat" VALUE="1"> <PARAM NAME="Shape" VALUE="4"> <PARAM NAME="Transition" VALUE="1"> <PARAM NAME="UseSoftwareSynthesis" VALUE="0"> </OBJECT> </HEAD> <BODY> This page demonstrates the Interactive Music Control.<P> <FORM> <INPUT TYPE="button" onclick="IMC.PlayMotif(`Synth Brass')" VALUE="Synth Brass"> <INPUT TYPE="button" onclick="IMC.PlayMotif(`Orch Hits')" VALUE="Orch Hits"> </FORM> </BODY> </HTML>

This listing requires a net connection to work, since it downloads two files from www.microsoft.com. This file demonstrates controlling the Interactive Music Control with PARAM tags and through script. When the control is first loaded, PARAM tags are used to specify which files to play and how to play them. The buttons use script to cause different motifs to be played interactively by the user.

Much more about the Interactive Music Control can be found at microsoft.com/music, including a complete language reference, samples, a tutorial, and information about potential ways to use the Interactive Music Control in Netscape Navigator.

Thus far, we've covered many variations on conventional audio and video. In the next chapter, you will find information about the DirectAnimation Multimedia Controls, which allow everything from sequencing of events to the creation of complex animations.

Категории