Site hosted by Angelfire.com: Build your free website today!

Random Midi Script

Lets you put more than one midi on a page



To see it work just reload (cmd + R) this page!

This script is set up for 5 songs but can be as many as you'd like by changing the song array number and adding to the list. Remebering the list starts at 0 as opposed to 1 so this one is 0 - 4 , the same rule applys for more songs. Example 10 songs would be 10 in the song array tag and they'd be numbered 0 - 9.


<script language="JavaScript">

song = new Array(5);
song[0]
='http://members.tripod.com/~couchpapa/index-midi/blue.mid'
song[1]
='http://members.tripod.com/~couchpapa/index-midi/bootscoo2.mid' song[2]
='http://members.tripod.com/~couchpapa/index-midi/walkmid.mid'
song[3]
='http://members.tripod.com/~couchpapa/index-midi/ebb-tide.mid'
song[4]
='http://members.tripod.com/~couchpapa/index-midi/kitnkeys.mid'

index = Math.floor(Math.random() * song.length);

document.write("<embed src="+song[index]+"
width=1 height=1 autostart=true
loop=infinite");</SCRIPT>