Midi Files



Midi files are those sometimes cute, and sometimes annoying, music files that are placed on pages and are automatically activated when the browser loads the page they are attached to. There are too many midi download sites on the internet to count, and you can find them by typing in the key word "midi" in any search engine.

<BGSOUND SRC="nameofmidifile" LOOP=INFINITE>
<EMBED SRC="nameofmidifile" WIDTH=200 HEIGHT=55 AUTOSTART=true VOLUME=50% LOOP=-1>


You can adjust the volume that the midi will be played at. Setting the volume at 50% usually works the best for most midi files. Many viewers have the Crescendo plugin installed on their computer. If you are viewing a page in Netscape and are using a PC, the width and height values shown in the code above create a console on the page so that the viewer can either change the volume, pause, restart or stop the midi at their own will. If you do not want the console to show on the page, then simply omit the width and height information from the code and replace it with the word HIDDEN.

Midi files will only play while the page they are attached to is being viewed. If you want a midi to play during the whole time someone is visiting your website, then you need to attach it to a frame that is on the screen the entire time, such as the buttons frame on your practice website.

For this lesson, you will code the midi tile so that the player console is hidden. You will also set the code so that the midi file is actually being called in from another website so that you won't have to download one from the internet. It is considered to be "band width robbery", not to mention just plane rude, to set your code this way, but since you will be calling it from one of the websites that I (the crazy person who wrote this tutorial, and who needs to get out more) wrote, I really don't care. Setting your code so that you reference graphics or other files from a different server than the one that hosts your own site is not a good idea because you cannot guarantee that they will always be on the site you are referencing them from. Websites change over time, and unless you have all of your page elements on your own server, you might find that one will be missing in the future if it is dropped from it's originating site. Since this is a tutorial, and I don't expect millions of people to be constantly accessing the particular midi file from geocitie's server that you will be using for this lesson, I don't see a big problem with your HTML file referencing from this site.

Set the code shown below on in your home.html file right after your <BODY> line information, and just before your JavaScript code begins.

<BGSOUND SRC="http://www.geocities.com/Heartland/Pointe/8951/indy2.mid" LOOP=INFINITE>
<EMBED SRC="http://www.geocities.com/Heartland/Pointe/8951/indy2.mid" HIDDEN VOLUME="25%" AUTOSTART=TRUE LOOP=-1>


This site has a page of links to midi download sites where you can search and preview midis to your heart's content when you want to look for a midi for your own homepage.



















Hosted by www.Geocities.ws

1