PencilCode/jquery-turtle — pull request #67 by davidbau (2014-05-19 10:26:59+00:00)
Title: Improve Music Support

This pull request is a significant improvement for music support in the library:

(1) The "Piano" object is now built-in to the library instead of requiring a separate import.
(2) Each turtle has a "turtleTimbre" property that lets you set 8 numbers to determine the quality of the sound of an instrument. The timbre can also be set for a specific song or a specific voice of a song.
(3) In addition to "play" there is a lower-level "tone" method that kids can use to just play a tone immediately without sequencing. It takes either an ABC pitch string or a numeric Hertz value. tone('C') to play a C, then tone('C', 0) to turn it off again.
(4) And there are "noteon" and "noteoff" callbacks: the Instrument base class of Piano sets these up, and you can override them to do various effects when a note is played. The callback is passed an object with a midi number for the note that is turning on or off.