How to Play a series of .mid files as background

  • Thread starter Jack Sirulnikoff
  • Start date
J

Jack Sirulnikoff

Hi,

I'm trying to write some javascript to set up a series of MIDI files as
background using <EMBED>. I can get it to work in general, but the main
problem I have is:

what coding can be used so that each subsequent selection only starts when
the previous selection has finished.

an additional problem will be:

how to clear the control panel from the display after the selection has
finished.

The coding I'm trying to use is something like this in the <BODY>:

<SCRIPT>
var soundFile = "jsrgo1gm.mid,jsrgo2gm.mid,jsrgo3gm.mid";

for (var counter = 0; counter < 3; counter++) {
// something in here to determine when the next piece can start, and to
clear the Console
var sounds = soundFile.split(",");soundFile = sounds[counter];
document.write('<embed src="'+soundFile+'" autostart="true"
controls="Console" width=144 height=60></embed>');
}
</SCRIPT>

<noscript><embed src="jsrgo1gm.mid" autostart="true" ></embed></noscript>
<noembed><bgsound src="jsrgo1gm.mid" ></noembed>

I would appreciate any help you can provide, and if there is an altogether
better way of doing this, I would appreciate hearing about that as well.

Thanks,

Jack
 
R

Randy Webb

Jack said:
Hi,

I'm trying to write some javascript to set up a series of MIDI files as
background using <EMBED>. I can get it to work in general, but the main
problem I have is:

what coding can be used so that each subsequent selection only starts when
the previous selection has finished.

an additional problem will be:

how to clear the control panel from the display after the selection has
finished.

The coding I'm trying to use is something like this in the <BODY>:

<SCRIPT>
var soundFile = "jsrgo1gm.mid,jsrgo2gm.mid,jsrgo3gm.mid";

for (var counter = 0; counter < 3; counter++) {
// something in here to determine when the next piece can start, and to
clear the Console
var sounds = soundFile.split(",");soundFile = sounds[counter];
document.write('<embed src="'+soundFile+'" autostart="true"
controls="Console" width=144 height=60></embed>');
}
</SCRIPT>

<noscript><embed src="jsrgo1gm.mid" autostart="true" ></embed></noscript>
<noembed><bgsound src="jsrgo1gm.mid" ></noembed>

I would appreciate any help you can provide, and if there is an altogether
better way of doing this, I would appreciate hearing about that as well.


Embed an .m3u file and let the default application handle it. An .m3u
file is nothing more than a "playlist" of files. The URLs in an .m3u
file *must* be absolute URLs.
 
J

Jack Sirulnikoff

Thanks for your help. I set up an .m3u, and it worked perfectly from the
test directory on my hard drive. Since all my files are in one directory, it
worked both with just the filename, and using the absolute URL. However,
neither way worked when I tried to run it from my website. I suspect the
problem still has to do with that, but I'm not sure what the answer is.

Jack

Randy Webb said:
Jack said:
Hi,

I'm trying to write some javascript to set up a series of MIDI files as
background using <EMBED>. I can get it to work in general, but the main
problem I have is:

what coding can be used so that each subsequent selection only starts when
the previous selection has finished.

an additional problem will be:

how to clear the control panel from the display after the selection has
finished.

The coding I'm trying to use is something like this in the <BODY>:

<SCRIPT>
var soundFile = "jsrgo1gm.mid,jsrgo2gm.mid,jsrgo3gm.mid";

for (var counter = 0; counter < 3; counter++) {
// something in here to determine when the next piece can start, and to
clear the Console
var sounds = soundFile.split(",");soundFile = sounds[counter];
document.write('<embed src="'+soundFile+'" autostart="true"
controls="Console" width=144 height=60></embed>');
}
</SCRIPT>

<noscript><embed src="jsrgo1gm.mid" autostart="true"
<noembed><bgsound src="jsrgo1gm.mid" ></noembed>

I would appreciate any help you can provide, and if there is an altogether
better way of doing this, I would appreciate hearing about that as well.


Embed an .m3u file and let the default application handle it. An .m3u
file is nothing more than a "playlist" of files. The URLs in an .m3u
file *must* be absolute URLs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top