Mitzrah's Get IT Right Column!! Random MIDI Selector/Player Updated : Friday, August 07, 1998 |
![]() |
You can fill up your JAVAscript as follows.
This is the JAVA script, please copy and paste the JAVA script BEFORE your </HEAD> tag:
<script language="JavaScript">
var nummidi = 3
day = new Date()
seed = day.getTime()
ran = parseInt(((seed - (parseInt(seed/1000,10) * 1000))/10)/100*nummidi + 1,10)
if (ran == (1))
midi=("1.mid")
if (ran == (2))
midi=("2.mid")
if (ran == (3))
midi=("3.mid")
browserName = navigator.appName
browserVer = parseInt(navigator.appVersion)
if (browserName == "Netscape"){
document.write('<EMBED SRC= "' + midi + '"
AUTOSTART="TRUE" LOOP="1" HIDDEN="TRUE"
VOLUME="100%">');
}
else{
document.write('<BGSOUND SRC= "' + midi + '"
LOOP="1" VOLUME="100%">');
}
// --></script>
Erm.. that's it, you now know how to make midi files play, you can also use .wav files, but hey, they are pretty big!
Additional things you should know:
MIDI Links:
![]() |
This is my MIDI collection - All are high quality MIDIs which I often use! |
![]() |
http://www.midifarm.com - A lot of MIDIs can be found here. |
![]() |
http://www.midi.com - Also a great number of MIDI files here! |
Notes from Alex:
If you found my tutorial helpful, please drop a note by my guestbook! So I know that you have dropped by and benefitted from my efforts, it took me quite sometime to get these tutorial up! Click on home and then SIGN GUESTBOOK! I will also visit your homepage at GeoCities and sign your guestbook if you sign mine!
|
||
[
Emiri Nakayama | Sailor Mars, Rei | About Me | Photo Gallery ] |
![]() |
![]() |
LinkExchange Member | Free Home Pages at GeoCities |