Home Advertising Contact
 

 

Big Resources
 BoxedArt
 StockedPhotos
 123Webmaster
 A1Javascripts
 1-Click-Clipart
 FresherImage
 FontFiles
 HTMLforums
 httpCITY
 PerlAccess
 HostRaiders
 
 
BigResources Somewhat Weekly Ezine



 
  :: Free Email Account
:: Link to Us
:: Contact Us
:: Advertise
:: Careers
:: Privacy
 

  ::Other Resources:

Web Templates
Web Hosting Reviews royalty free stock photos DHTML Menus & jQuery Modal Windows
Unlimited Domain Hosting
Turnkey Websites
Stock Photos
CMS Templates
Web Design Tutorials
Webmaster Resources
Javascripts
DHTML Scripts
Free Web Templates
Web Templates
Create a free forum



Unlimited Web Templates

All access to thousands of web templates, logos, icons, more...


Royalty Free Stock Photos

All access to thousands of professional stock photos


Turnkey Website Templates
Fully scripted PHP website templates!

123Webmaster.com : Onsite : Building
Embedding Midi Files

by Ian McDonald
http://www.bigresources.com

This page is designed to explain how to embed a single midi file
and the various controls.

To embed a single file: auto start (start on page load ) It is hidden and repeats.

<!-- --><embed src="http://YOUR URL.mid" autostart="true" hidden="true" loop=true><!-- -->

To change this so that it does play automatically in page load:
changeautostart="true" to autostart="false".

To change this so that it only plays once:
change loop="true" to loop="false"

Allowing Users to Control the Music:
(using the control console)

Small Console:

<!-- --><embed src="http://YOUR URL.mid" height=16 width=47 autostart="true" controls="smallconsole" loop="true"><!-- -->
(gives users the play and stop buttons in a small console)

<!-- --><embed src="http://YOUR URL.mid" height=16 width=145 autostart="true" controls="smallconsole" loop="true"><!-- -->
(gives users the play, stop and volume control) 

Large Console:

<!-- --><embed src="http://YOUR URL.mid" controls="console" autostart="true" loop=true height=60 width=145><!-- -->


The "MASTERSOUND" Option:

The MASTERSOUND attribute lets you control a single sound track with multiple single control panels. IE: A seperate volume, pause, stop and play button.

1) First you have to give your midi file a name so your control button knows what to play, stop, etc.

<!-- --><embed src="http://YOUR URL.mid" autostart="true" loop="true" name="mymidi" ><!-- -->

2) Add name="mymidi" and MASTERSOUND to it like this below: ( "mymidi" is an example, it does not have to be called that)

<!-- --><embed src="http://YOUR URL.mid" autostart="true" loop="true" name="mymidi" MASTERSOUND><!-- -->

3) Add your control to it.
<!-- --><embed src="http://YOUR URL.mid" autostart="true" loop="true" name="mymidi" CONTROLS="playbutton" MASTERSOUND><!-- -->
 
  • volume: CONTROLS="volumelever"
  • stop:     CONTROLS="stopbutton"
  • Pause:  CONTROLS="pausebutton"
Is greyed out until you click it.
  • Play:     CONTROLS="playbutton"
Is greyed out until you click it.

A Text or Image Stop Button:

This will allow you to stop a playing midi with a text or image link.

Normally this would be used for sound that auto plays.

Insert this into the body of your page.
<script LANGUAGE="JavaScript">
function stop() { document.mymidi.stop()}
</script>
start the midi here.
stop
Stop The Music
In your link:
onClick="javascript:stop()"

Example: text
<!-- --><a href="javascript://" onClick="javascript:stop()">stop</a><!-- -->

Example: Image
<!-- --><a href="javascript://" onClick="javascript:stop()"><img src="stopthemusic.gif" border=0 height=60 width=60 alt="Stop The Music"></a><!-- -->


Discussion - Graphics & Multimedia
WebSites - Midi Related Scripts at A1JavaScripts.com

© BIG RESOURCES, INC.