Setting up the HTML for Your Webpage
Now that your sounds are in the proprietary .rmf file format you're ready to manipulate these sounds with some clever HTML and JavaScript.
The Beatnik website provides a lot of free copy-and-paste HTML that you can download from its Web Authoring Docs section.
Our example uses this code:
<SCRIPT LANGUAGE=JavaScript>
new Music ('coffee');
coffee.preloadEmbed ('coffee.rmf');
</SCRIPT>
To recap on sourcing the JavaScript from earlier in the tutorial, the following code would embed our custom sample "coffee" and make it available to be triggered when users move their cursors over the Angry Coffee logo above.
<SCRIPT SRC="music-object.js"></SCRIPT>
<SCRIPT LANGUAGE=JavaScript>
new Music ('stub');
stub.preloadEmbed ('stub.rmf');
new Music ('coffee');
coffee.preloadEmbed ('coffee.rmf');
</SCRIPT>
Replace the word "coffee" above with the name of your own custom sound file to set up your own sonified logo.