Code:
<script>
// Written by I.am
// for Crack man coz he was using junk script
//****Script****-->
var numberofmid = 2
day = new Date()
myseed = day.getTime()
random = parseInt(((myseed - (parseInt(myseed/1000,10) * 1000))/10)/100*numberofmid + 1,10)
if(random== (1))
midi = ("soundsrcfile1.mid")
if(random==(2))
midi = ("soundsrcfile2.mid")
if(random == (3))
midi = ("soundsrcfile3.mid")
//Make sure to put the right value in numberofmid. If you have 10 mid files then initialize numberofmid = 10
//Add as many random files you want. Increase random by 1 and keep adding the source files.
document.write('<EMBED SRC= "' + midi + '" WIDTH=200 HEIGHT=55 AUTOSTART=TRUE>')
document.write('<BGSOUND SRC= "' + midi + '" loop=infinite AUTOSTART=TRUE>')
//<--End of Script, By I.am
</SCRIPT>
Copy it to your page. In place of soundsrcfile give the path to your mid file.
B)
I.am
ps: Btw, this will be truly random. Almost impossible to predict which mid will be played as compared to that simple Math.random() function.
Second Edit: I forgot to mention what this will do. It will have a player on your page where you can control your mid. Play, Pause, Stop, Forward etc. all in there inbuilt.
Bookmarks