With JFugue, synthesizing music is as simple as this:
Player player = new Player();
player.play("C D E F G A B");
While I do realize that the HTML5 Audio API is still under development for most of the browsers, I am quite unaware if any of these browsers support an API like this.