fix: ruler click 200ms timeout + default instrument attackTime 0.03 + safe ramp

This commit is contained in:
2026-07-26 11:51:50 +07:00
parent 523a754949
commit 1ffdec68c6
3 changed files with 6 additions and 5 deletions
+4 -3
View File
@@ -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);