How Do I Embed a MIDI Onto a Web Page?
MIDI is a widely used sound file format. However, unlike digital music files formats like MP3 or WAV, MIDI files do not contain any actual music or sounds. Instead, MIDIs store sets of instruction data that tell your computer how to generate a specific pattern of sounds by using the synthesizer function of its sound card. Because MIDIs do not store actual sounds, their file sizes are relatively small, and website visitors can download them quickly. If you want to embed a MIDI file on a webpage, simply add one line of HTML code to your page.
Instructions
-
-
1
Open your webpage and view its HTML code. If you use a visual web editor, such as Adobe Dreamweaver, open your page and single-click on the area where you want to embed your MIDI file. Change your viewing mode to Code View after doing so to view the HTML code that controls the content and appearance of the page. If you edit your HTML code by hand, simply open your editing program and scroll down to the section of the page where you want to embed the MIDI.
-
2
Press the "Enter" key to create a blank line.
-
-
3
Copy and paste the following line of code onto the blank line:
<embed src="sample.mid" width="250" height="20" loop="false" autostart="false">
-
4
Adjust the <embed> tag parameters to suit your preferences. Replace the "sample.mid" value with the actual file name of your MIDI. Change the width and height values to reflect your preferred player dimensions. Change the loop attribute to "true" if you want the MIDI file to loop continuously. Change the autostart attribute to "true" if you want to the MIDI to play automatically when your webpage loads.
-
5
Save your page and open it in a web browser. The MIDI file appears on-screen at the location you selected in Step 1, reflecting the parameters you specified in Step 4.
-
1
References
- Photo Credit laptop image by Ewe Degiampietro from Fotolia.com