Solved

CGI for Midis?

Posted on 1998-02-12
1
242 Views
Last Modified: 2013-12-25
I would like to have a random midi play on my webpage when someone visits it.  Is there a cgi out there or someway to do this?
0
Comment
Question by:treyjeff
1 Comment
 

Accepted Solution

by:
cfrericks earned 50 total points
Comment Utility
you don't need to use cgi to do this.  A simple javascript will do this for you.  here it is:



<SCRIPT LANGUAGE="JavaScript">
var theurl = document.location
if (theurl == "put your page address here where you will use the midi randomizer") {
   
song = new Array(10);

song[0] ='m/first song title name.mid'
song[1] ='m/second song title name.mid'
song[2] ='m/third song title name.mid'
song[3] ='m/fourth song title name.mid'
song[4] ='m/fifth song title name.mid'
song[5] ='m/sixth song title name.mid'
song[6] ='m/seventh song title name.mid'
song[7] ='m/eighth song title name.mid'
song[8] ='m/ninth song title name.mid'
song[9] ='m/tenth song title name.mid'
song[10] = 'm/eleventh song title.mid'


index = Math.floor(Math.random() * song.length);document.write("<DL>\n");
document.write("<EMBED SRC="+song[index]+" width=200 height=55 autostart=true loop=infinite BGCOLOR='enter background color'");
document.write("</DL>\n");
}
else{}
</SCRIPT>

to add more songs to the randomizer change the song = new array to the appropriate number and duplicate the song [number] thing.
This script goes between the head tags of your homepage.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now