Make your own free website on
Home page
Message Board
David's home
Java Script menu
Angelfire home

Random midi player

Put the script between the <HEAD> and the </HEAD>the small in red anywhere below the <BODY>tag. The midi files and their names are color coded so you can see how to do it. This script suppose to play different file everytime you go to that page or reload/refresh. I put a meta tag that will refresh the page every 120 seconds it is extra you don't have to use it keeps the midi going and changing.. <META HTTP-EQUIV="Refresh" CONTENT="120">
since the lenght of the midi files is not the same make sure to get the average length in seconds.





<META NAME="Author" CONTENT="David J.Dalleh">

<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (Win95; I) [Netscape]">


<SCRIPT LANGUAGE = "JavaScript">

now = new Date();

seed = now.getTime();

Mcount = 10;

midis = new Array(Mcount);

names = new Array(Mcount);

var playing;

midis[0] = "/md/jdfaq/images/all_shook_up.mid";

names[0] = "All shook up";

midis[1] = "/md/jdfaq/images/alwsonmymind.mid";

names[1] = "Always on my mind";

midis[2] = "/md/jdfaq/images/bluesuede.mid";

names[2] = "Blue suede";

midis[3] = "/md/jdfaq/images/ret2send.mid";

names[3] = "Return to sender";

midis[4] = "/md/jdfaq/images/teddy.mid";

names[4] = "Teddy";

midis[5] = "/md/jdfaq/images/whatisay.mid";

names[5] = "What I say";

midis[6] = "/md/jdfaq/images/myway.mid