modify ramp value to 0.2/0.3 on recommendation of @Miranet & @0xfe

master
Michael Deal 2013-01-25 09:50:14 -08:00
parent c97c636cd1
commit b95aabcc7b
1 changed files with 3 additions and 3 deletions

View File

@ -183,11 +183,11 @@ if (window.AudioContext || window.webkitAudioContext) (function () {
if (delay < ctx.currentTime) delay += ctx.currentTime;
var source = sources[channel + "" + note];
if (!source) return;
// @Miranet: "the values of 0.4 and 0.5 could ofcourse be used as
// @Miranet: "the values of 0.2 and 0.3 could ofcourse be used as
// a 'release' parameter for ADSR like time settings."
source.gain.linearRampToValueAtTime(1, delay);
source.gain.linearRampToValueAtTime(0, delay + 0.4);
source.noteOff(delay + 0.5);
source.gain.linearRampToValueAtTime(0, delay + 0.2);
source.noteOff(delay + 0.3);
return source;
};