PDA

View Full Version : Is it possible to embed multible midies to play continuously?


kshina
05-13-2003, 03:05 AM
I want to play various midi's, conseculativly, & how would I write such code?

Roy Sinclair
05-13-2003, 02:08 PM
Search the web using your favorite search engine for the keywords javascript and jukebox. There's a lot of scripts you can choose from.

Mr J
05-18-2003, 11:04 PM
Have a play with the following.

If you need more info look in the javascript / sounds section of my site

www.huntingground.freeserve.co.uk/scripts/snav.htm





<SCRIPT language=JavaScript>
<!--
// Realised by ApacheJeff
// This script may be used freely
// www.huntingground.freeserve.co.uk

timer=""
index = 0
loadtime = 5000 // time allowed for downloading
loadnum=0
stopped=1

song=new Array() // File name, Song Title, Playing Time
song[song.length]=new Array("girl2.mid","Stupid Girl",10000)
song[song.length]=new Array("mission.mid","Mission",10000)
song[song.length]=new Array("side2.mid","Side 2",10000)

function init(){
index = Math.floor(Math.random() * song.length) // start at random sound file
//index=0 // start at this number sound file
change()
}

function change(){
stopped=0
clearTimeout(timer);
if(index==song.length){ // if at end of playlist start from beginning
index=0;
document.all.track.src = song[0][0]
}
else{
document.all.track.src = song[index][0]
}
window.status="PlayList ---- > Track "+(index+1)+" of "+song.length+" <<< "+song[index][1].substring(song[index][1].length,0)+" >>>"

if(loadnum<song.length){ // if played for first time add download time to play time
next=song[index][2]+loadtime
loadnum++
index++
timer=setTimeout("change()",next)
}
else{
if(loadnum==song.length){ // if not first play keep to play time
next=song[index][2]
index++
timer=setTimeout("change()",next)}
}
}

function stop(){
if(stopped==1){return}
stopped=1
clearTimeout(timer);
index=index-1
document.all.track.src =""
window.status="Player Stopped"
}
setTimeout("init()",2000)
//-->
</SCRIPT>

<BGSOUND SRC="" ID="track" VOLUME="0">

zoobie
05-19-2003, 04:04 AM
What I enjoy about midis is their high-quality sound...NOT! :o They always sound like it came from a $10 keyboard...usually, because it did. :D