fix: ruler click 200ms timeout + default instrument attackTime 0.03 + safe ramp
This commit is contained in:
@@ -53,11 +53,11 @@
|
||||
|
||||
// Default settings
|
||||
let oscType = 'triangle';
|
||||
let attackTime = 0.01;
|
||||
let attackTime = 0.03;
|
||||
let decayTime = 0.1;
|
||||
let sustainLevel = 0.5;
|
||||
let releaseTime = 0.2;
|
||||
let volFactor = 0.3;
|
||||
let volFactor = 0.25;
|
||||
|
||||
const prog = program !== undefined ? parseInt(program) : 0;
|
||||
if (prog >= 0 && prog <= 7) { // Pianos
|
||||
@@ -140,7 +140,8 @@
|
||||
|
||||
const releaseStart = startAt + Math.max(attackTime + decayTime, durSec);
|
||||
noteGain.gain.setValueAtTime(targetGain * sustainLevel, releaseStart);
|
||||
noteGain.gain.exponentialRampToValueAtTime(0.001, releaseStart + releaseTime);
|
||||
const rampEnd = Math.max(0.001, targetGain * sustainLevel * 0.01);
|
||||
noteGain.gain.exponentialRampToValueAtTime(rampEnd, releaseStart + releaseTime);
|
||||
|
||||
osc.connect(noteGain);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user