Home : Tune Toys : Muse-O-MaticHelp 
  This toy reads the contents of a URL, and uses its data to drive the generation of algorithmic music. You can specify any type of URL (an HTML file, a GIF, a MIDI file, anything).
Step 1   Enter a URL
URL:
Step 2   Set some parameters (the bold ones have the most dramatic effect):
Scale: Controls the tonic of the scale used.
Guide: Controls which "guide" algorithm is applied.
Guide Length: Controls how many notes will be "guided" before changing.
Add Root: Controls whether or not "root" tones are added to the music.
Filter: Controls whether notes not on the scale are removed or adjusted.
Range: Controls the pitch range of the notes.
Step: Controls the duration and step size of the notes.
Patch: Controls what sound will be used.
Length: Controls how long the entire piece of music will be.
Step 3   Press this button

The algorithm for Web Tones is written in KeyKit, and here's the source code.