PlayTheWeb Beta

PlayTheWeb Project is a semi-random music creator based on web pages' source codes. The purpose is to generate unique musical pieces.

With PlayTheWeb, you can listen to any web site as Facebook, Twitter, Yahoo etc. as long as the site contain different id and class variables in their HTML. Each site will generate a different piece. The algorithm will generate the same piece as long as the inputted site's code remains the same.

Click here for details:



Mode: Pick one or set automatic | Seconds: : / 00:00

Mode: Tone:

How it works?



When you submit a web site URL to PlayTheWeb,

  • It makes a list of the most frequent id and class names in the site’s HTML code.

  • It orders the items in the list according to their popularity in the code.

  • It finds the letter count of the list (the number of all items’ letters) and it uses this number in the modulus of 22. The final number – which will be between 1 and 22 – is going to be the one to choose a mode between 22 different ones as major, minor, lydian etc. This process is handled thanks to the Music Theory library, developed by Arturs Sosins.

  • The most popular word in our list is used to find the tone of the piece. This word’s letter count will be taken in the modulus of 7.

  • (1 / total letter count of all items) x 50.000 is the formula of the piece’s tempo.


When the basic values of the new piece are set, PlayTheWeb engine continues by:
  • Taking the ASCII value of the first letter of each word in the list in modulus 7 in order to find the tone of each word (each note in the piece is determined that way).

  • Using the character count of each word to determine the duration of each note.

  • Converting each note to a frequency between 440Hz and 830Hz thanks to the SineWave JQuery API, which is developed by Mohit Cheppudira. Currently this API only works in Google Chrome, and is been replaced by Mozilla Sound API in fallback mode when using Mozilla Firefox. web audio oscillator. Currently it works in most of the major browsers except Internet Explorer.

  • Converting the 8 modulus of total character count of the item list to repeating mute points. (If this value is smaller than 3, it will be equal to 3). This means, for example, if this number is 5, we will hear a silence in the end of every 5 notes.

  • Visualizing notes in the musical piece by drawing colored bars in the screen. Colors of the bars change according to the tone, and length of them are relevant to the notes’ duration.