modify ramp value to 0.2/0.3 on recommendation of @Miranet & @0xfe
This commit is contained in:
parent
c97c636cd1
commit
b95aabcc7b
|
@ -183,11 +183,11 @@ if (window.AudioContext || window.webkitAudioContext) (function () {
|
||||||
if (delay < ctx.currentTime) delay += ctx.currentTime;
|
if (delay < ctx.currentTime) delay += ctx.currentTime;
|
||||||
var source = sources[channel + "" + note];
|
var source = sources[channel + "" + note];
|
||||||
if (!source) return;
|
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."
|
// a 'release' parameter for ADSR like time settings."
|
||||||
source.gain.linearRampToValueAtTime(1, delay);
|
source.gain.linearRampToValueAtTime(1, delay);
|
||||||
source.gain.linearRampToValueAtTime(0, delay + 0.4);
|
source.gain.linearRampToValueAtTime(0, delay + 0.2);
|
||||||
source.noteOff(delay + 0.5);
|
source.noteOff(delay + 0.3);
|
||||||
return source;
|
return source;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue