Timbre.js

JavaScript Library for Objective Sound Programming
system requirements: Chrome 14- or Firefox 4-

Polyphony

Example

synth = T("+");

function play(freq) {
    var tone = T("*", T("fami", freq, 0.25),
                      T("adsr", 50, 2500).bang());
    synth.append(tone);
    while (synth.args.length > 8)
        synth.args.shift();
}


i = 60;
timer = T("interval", 250, function() {
    play(timbre.utils.mtof(i));
    i += 5;
    if (96 < i) i -= 42;
});

synth.onplay = function() {
    timer.on();
};
synth.onpause = function() {
    timer.off();
};