MIDI Studio Consortium logo


"MIDI STUDIO MAX" Automatic Code Generator
Windows® Media Player 9 
Windows® 98/ME/SE/NT/2000/XP
Author: Les Gorven 
 

 
Whether you are a novice or well experienced in creating web pages, one of the problems is how to add music that plays when the page loads. This is referred to as "embedding". Many are of the misconception that if the music plays for them it must also play for anyone who visits their web site. Not true!

Many web page authors use the very popular Microsoft Front Page. If you add music using this application, you will find that it uses "<bgsound src=".  Problem is that this will only work if the visitor has Internet Explorer.  Although IE is the most popular browser, what about those visitors who are using Netscape, Firefox or Mozilla browsers?  Well, they are out of luck and will not hear the music.  Further, "<bgsound" does not display any Player on the page.  This is what many authors want, but there are many cases where a player is required or desireable.

There have been many JavaScripts written in the past that determine which Browser your visitor has and then writes the code on the page to suit.  Again, these scripts were of the assumption that the visitor had a plugin installed in Netscape type browsers. The other problem was that you never knew which Player was installed so you had no indication of what the final results were when your page was viewed.

We have simplified the process with our "MIDI STUDIO MAX" Automatic Code Generator. It is designed to use Windows® Media Player 9 no matter which browser is being used. Therefore, you will always know how you page will display for others.

Only requirement is that your visitor have WMP installed, as most do.
If not, it is available free from Microsoft. GetWindows Media Player


 
The code we generate automatically is understood by Internet Explorer and Netscape Navigator, versions 4.xx and up. Netscape Gecko 7.0 and up, Firefox, Mozilla, AOL(Internet Explorer) and WebTV.

No other Code Generator will work with as many Browsers and file types.

 
The following list details some of the file types covered and browsers that recognize our coding.
File Type: Description Browsers *
.MID MIDI File (requires wavetable synthesizer)** all
.AU Audio file (music or voice) all
.WAV Audio file (music or voice) all
.MP3 Compressed .WAV file all
.WMA Windows Media Audio. (Compressed .WAV) all but WebTV
.WAX Playlist definition file for all Media types all but WebTV
.WMV Yes, you can embed Music Videos all but WebTV
  There are several more types, but not major. all but WebTV
* Browsers:   all Windows types, incl. Macs
** MIDI files require that the user have a sound card with wavetable synthesizer, or an on-board audio chip and software synthesizer. All recent versions of Internet Explorer have the "Microsoft GS software synth". 

 
The heart of our Code Generator is "wmpCodeGen.js". This is a lengthy JavaScript application I have written .You never have to look at it or make any changes to it. By way of the following four lines you copy onto the source for your page, it is available for access by the JavaScript. The "playMedia" section is where you enter the variables that are passed to the Code Generator. "wmpCodeGen.js" is copied into your working directory and also uploaded to your Server.
 
Download the template below and "wmpCodeGen.js" together with instructions. wmpCodeGen.zip
 
<script language="JavaScript" src="wmpCodeGen.js"></script>
<script language="JavaScript" type="text/javascript"> 
playMedia("GoneFishing.mid",3,45,200) 
</script>
 
The "MIDI STUDIO MAX" code generator has many "smart" features built in.  The Windows Media Player can be hidden, or displayed in various sizes.  The size you choose will include different options to be displayed.
 
45 high x 200 wide has the controls shown.
 
16 X 16 is inconspicuous.  Has right-click menu for play/pause, stop etc.
 
50 x 250 includes a status bar to display song information.  This is suitable for .mp3 and .wma files that have  Song Name, Author, Copyright and other info included.  Each category displays in rotation.
 
You will find more sizes and illustrations on the Demo pages listed below.

Demo Pages. Listen to a few
examples and view the settings used.

.MID Normal embed with Console showing on the page.
.MID Embed with the Console hidden
.MID Using relational links for both the Code Generator and file.
.MID Code Generator "Magic" size results
.WAV A highly compressed music file using .wav extension.
.MP3 Good quality Stereo MP3 with Status bar to display file info.
.WAX Embed multiple files in a Playlist.
.WMV Embed a Music Video Rated PG
.WMV Embed Music Video smallest size, high compression.
 

 
Learn more about Windows Media Player <-Back
 
[ MIDI Studio Consortium Home Page ]
 

©2006 MidiStudio.com. All Rights Reserved
Last Update: January 18, 2006
This site is owned, designed and produced by Les Gorven
dba Business Technologies & MIDI-Studio Publishing