08/28/02

Play Random Music

I f you are viewing this page with Netscape4.08, you will not see the control panel properly. The size attributes for a control panel in Netscape are different than that of Internet Explorer. See the below link for the different size attributes and definitions for both Netscape and Internet Explorer.
Control Panel Attributes ]

W ith this script, it will play a random midi file each time the page is opened.

e have tested the code in IE5.5, IE6 and Netscape4.08. This script worked well in all platforms tested with no variations observed other than the size of the control panel depending on the browser platform.

D epending on your knowledge of HTML and Java scripts this is a very easy one step, "Copy & Paste" code that is pasted into the <BODY> section of your document.

O nce you upload your midi files to your editor then all you need to do is reconfigure the three random tunes with your URL linking to your music. Where you substitute the default music for yours you need to put in your entire URL, not the way the default is.

Reconfigurations

x = parseInt(y/100*nummidi,10) + 1
if (x == (1))
midi=("mid1.mid")
if (x == (2))
midi=("mid2.mid")
if (x == (3))
midi=("mid3.mid")
document.write('<EMBED SRC= ' + midi + ' autostart=true loop=true ')
document.write('volume=100 align="center" hidden=true width=150 height=45 controls=smallconsole>')

T here are other reconfigurations you can make and that is pertaining to autostart= and loop= and hidden=. Lets define what these attributes do so you will get a better insite on why they can be reconfigured.

autostart=true      true is the attribute for starting without an outside prompt from the viewer. If you would change that to false, then your guests would have the option on starting the music themselves. Remember! To start the music themselves, the control panel Must be visible.

hidden=true      true here is the attribute for either making the control panel either visible or hidden. By changing this attribute to false, your visitors will see a control panel where they can either start or stop the music by themselves.

loop=true      true here is the attribute that it will keep looping endlessly. In other words, it will play over and over again. If you change that to false, it will play only one time and stop. If you use numbers starting with 1 or higher, it will play that number of times before it stops.

More Control Panel Attributes And Definitions ]

I f you notice, we have placed the control panel on top of the page. Against popular belief, music as with everything else on a web page loads from the top down. You want your music to load first so, place it as close to the top of the body section as possible.

Y ou may want to read the below little article about Midi Files and see if "Midi" is the choice for you. If you need any more help on this feel free to contact us.
Read Me ]
Get Code Here ]

I f you would like to search for different Midi songs, just use the below search box powered by vanBasco. Your search will open in a new browser window so you do not lose this page.

vanBasco's MIDI SearchType artist or song name:
 

[ Yahoo! ] options

Search Our Site By Individual letter

A ]  [ B ]  [ C ]  [ D ]  [ E ]  [ F ]  [ G ]  [ H ]  [ I ]  [ J-K ]  [ L ] 
M ]  [ N-O ]  [ P-Q ]  [ R ]  [ S ]  [ T ]  [ U-V ]  [ W ]  [ X-Y-Z ] 

Little Tips Directory

Page 1  ] [ Page 2 ] [ Page 3 ] [ Page 4 ] [ Page 5  ] [ Page 6  ] [ Page 7  ]

Index Page 1 ] [ Index Page 2 ] [ Index Page 3 ] [ Index Page 4 ] [ Index Page 5 ]
Index Page 6 ] [ Index Page 7 ] [ Index Page 8 ] [ Index Page 9 ] [ Index Page 10 ]
Index Page 11 ] [ Index Page 12 ] [ Index Page 13 ]

News Letter Archives ] [ Navigation Page ] [ Archives Of Published Material ]
Link To Us ] [ Alphabet Index ] [ Feedback ] [ On Line Support ] [ FAQ ]
Webmaster Utilities ] [ Casino ] [ Banner Exchange ] [  Advanced Site Search ]

  

If you are part of the ever growing number of webmasters who enjoy sharing your knowledge with others on web design, join The Consigliere Ltd. web ring to broaden your scope of exposure.
Join Today

This Site Was Built And Is Maintained Exclusively by
The Webmaster @ Consigliere Ltd.

Copyright © Consigliere Ltd., All Rights Reserved. 2001-