<SCRIPT language="JavaScript">
<!--
if (navigator.appName == "Netscape")
document.writeln("<EMBED src=\"***.mid\" autostart=true
hidden=true loop=false>");
else
document.writeln("<BGSOUND src=\"***.mid\" loop=0>");
// -->
</SCRIPT>
|
|
***.mid(MID) // Change file name correctly.
This script is single play. If you want play infinity, change next part
of script.
loop=false (or 0 ) to loop=true |
|
| If you want to chage Music by hour, use next script. |
<SCRIPT language="JavaScript"> <!-- BGM = new
Array(24); BGM[0]="**.MID"; BGM[1]="**.MID"; BGM[2]="**.MID"; BGM[3]="**.MID"; BGM[4]="**.MID"; BGM[5]="**.MID"; BGM[6]="**.MID"; BGM[7]="**.MID"; BGM[8]="**.MID"; BGM[9]="**.MID"; BGM[10]="**.MID"; BGM[11]="**.MID"; BGM[12]="**.MID"; BGM[13]="**.MID"; BGM[14]="**.MID"; BGM[15]="**.MID"; BGM[16]="**.MID"; BGM[17]="**.MID"; BGM[18]="**.MID"; BGM[19]="**.MID"; BGM[20]="**.MID"; BGM[21]="**.MID"; BGM[22]="**.MID"; BGM[23]="**.MID";
function
setBGM() { d=new Date(); h=d.getHours(); if (navigator.appName ==
"Netscape") document.writeln("<EMBED src='",BGM[h],"' autostart=true
hidden=true loop=false>"); else document.writeln("<BGSOUND
src='",BGM[h],"' loop=0>"); } //
--> </SCRIPT> <SCRIPT
language="JavaScript"> <!-- setBGM(); //
-->
</SCRIPT> |
|
| This is a sample for Random. |
<SCRIPT language="JavaScript"> <!-- BGM = new
Array(8); BGM[0]="**.MID"; BGM[1]="**.MID"; BGM[2]="**.MID"; BGM[3]="**.MID"; BGM[4]="**.MID"; BGM[5]="**.MID"; BGM[6]="**.MID"; BGM[7]="**.MID";
maxSound
= 8;
function setBGM() { soundNo =
Math.floor(Math.random()*maxSound); if (navigator.appName ==
"Netscape") document.writeln("<EMBED src='",BGM[soundNo],"' autostart=true
hidden=true loop=true>"); else document.writeln("<BGSOUND
src='",BGM[soundNo],"' loop=infinite>"); } //
--> </SCRIPT> <SCRIPT
language="JavaScript"> <!-- setBGM(); //
-->
</SCRIPT> |
|
| Recommended site of embeded MIDI.
|