Here's a script from a person who learned JavaScript through the HTML Goodies 30-Step JavaScript Primers. He handed it in as "Assignment 30".
The problem right now is that it isn't on the page. I don't want to set it up as it will need multiple MIDIs and that would take up a lot of space. So, grab
the script for yourself and get it up and running. Here's what the author had to say about it himself:
Joe, this is a phat script I made up that makes a random sound when you enter a page. Please add this to your page. It should work with Explorer and Netscape 3.0 or above. Please tell the reader to change the number after the part labeled Mcount near the top, to however many midi files they wish to randomize. The reader then must change the parts where it says FirstMidi.mid, SecondMidi.mid, etc. to the name of the Midi to be randomized. Thanks for the Primers Joe and Andree. I hope this script helps many JScript Lovers!
Please keep Jeremy's name in the script where he put it. It's a copyright thing, you know.
Please note: This script is being offered in simple text format. When you click to Grab the Script, the text should display. Internet Explorer and AOL users may get a blank page or the script may run and produce the effect. If this happens, choose SAVE AS from the FILE menu and save the blank or compiled page.