mohayonao / timbre.js

JavaScript library for objective sound programming
http://mohayonao.github.io/timbre.js/
MIT License
962 stars 74 forks source link

noteOff() does not work #47

Open jazz-soft opened 9 years ago

jazz-soft commented 9 years ago

Tried it with T("PluckGen"), T("OscGen"), T("SynthDef") on several browsers Windows and Mac. Here is a sample file:

<!DOCTYPE html>

Timbre

Timbre

jazz-soft commented 9 years ago

Oops, html did not load properly...

jazz-soft commented 9 years ago

var env = T("perc", {a:50, r:2500}); var osc = T("pulse"); var synth1 = T("PluckGen", {env:env, mul:0.5}).play(); var synth2 = T("OscGen", {osc:osc, env:env, mul:0.15}).play(); var synth3 = T("SynthDef").play(); synth3.def = function(opts) { var osc1, osc2, env; osc = T("saw", {freq:opts.freq, mul:0.25}); env = T("linen", {s:450, r:2500, lv:0.5}, osc); return env.on("ended", opts.doneAction).bang(); };

var env = T("perc", {a:50, r:2500}); var osc = T("pulse"); var synth1 = T("PluckGen", {env:env, mul:0.5}).play(); var synth2 = T("OscGen", {osc:osc, env:env, mul:0.15}).play(); var synth3 = T("SynthDef").play(); synth3.def = function(opts) { var osc1, osc2, env; osc = T("saw", {freq:opts.freq, mul:0.25}); env = T("linen", {s:450, r:2500, lv:0.5}, osc); return env.on("ended", opts.doneAction).bang(); };

function noteOn1() { synth1.noteOn(60, 100);} function noteOff1() { synth1.noteOff(60);}

function noteOn2() { synth2.noteOn(60, 100);} function noteOff2() { synth2.noteOff(60);}

function noteOn3() { synth3.noteOn(60, 100);} function noteOff3() { synth3.noteOff(60); alert(timbre.version);}

it does not work at https://mohayonao.github.io/timbre.js/PragmaSynth.html either