Código HTML y JS:

 

 

LOOP DE MIDI PARA NETSCAPE NAVIGATOR:

<head>

<BGSOUND src="midi_que_tu_quieras.mid" loop="infinite">

</head>

 

LOOP DE MIDI PARA IEXPLORER:

<head>

<bgsound src="midi_que_tu_quieras.mid" loop="-1">

</head>

 

MIDI PARA IEXPLORER (sin loop):

<head>

<bgsound src="midi_que_tu_quieras.mid" loop="0">

</head>

 

JAVASCRIPT  PARA ESCUCHAR UN FICHERO MIDI CUANDO SE CARGUE UNA PAGINA:

<head>

<script language = "JavaScript">

<!-- Hide

function PlaySound(){

window.location = "midi_que_tu_quieras.mid"

}

//-->

</script></head><body onLoad="PlaySound()"></body>

 

BOTÓN QUE TOCA UN FICHERO DE SONIDO

<FORM>

<! ---- Here's where we call the playSound() custom function><INPUT Type="button" Value="Pulsa para oirme" onClick="playSound('wavquequieras.wav')">
</FORM><! ---- Here's the script><SCRIPT LANGUAGE="JavaScript">
function playSound(fullName) {
location.href=fullName
}
</SCRIPT>

 

JAVASCRIPT QUE TOCA UN FICHERO MIDI ALEATORIO  ENTRE 5:

<script>
<!--
/*
Random background music player script credit: Website Abstraction (www.wsabstract.com).
Your free JavaScripts archieve, with over 200+ free JavaScripts.
This script may be freely used as long as credit remains intact.
*/
var sound1="first.mid"
var sound2="second.mid"
var sound3="third.mid"
var sound4="fourth.mid"
var sound5="fifth.mid"
var x=Math.round(Math.random()*4)
if (x==0) x=sound1
else if (x==1) x=sound2
else if (x==2) x=sound3
else if (x==3) x=sound4
else x=sound5
if (navigator.appName=="Microsoft Internet Explorer")
document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
else
document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
//-->
</script>

 

JAVASCRIPT QUE DETECTA EL NAVEGADOR QUE USAS Y MANDA LA INSTRUCCION ADECUADA (LOOP)

<SCRIPT LANGUAGE="JavaScript">
if (navigator.appName == "Microsoft Internet Explorer") {
    document.writeln ('<BGSOUND SRC="midi_que_tu_quieras.mid" LOOP=INFINITE>') }
if (navigator.appName == "Netscape") {
    document.writeln ('<EMBED SRC="midi_que_tu_quieras.mid" WIDTH=0 HEIGHT=2 LOOP=TRUE AUTOSTART=TRUE></EMBED>') }
</SCRIPT>

 

Si lo deseas puedes poner un link a mi página con este código:

<a href="http://mbit.alva.net/mid4web.html">

<p align="center"><img src="http:/mbit.alva.net/mid4weblogo.gif"

alt="Midis especiales gratis para tus páginas web" border="0"> </a> </p>

 

 

http://mbit.alva.net/mid4web.html