From e3333e716fc6b30da5a792eced45a5487dd59a35 Mon Sep 17 00:00:00 2001 From: Raphael Forment Date: Sat, 30 Sep 2023 15:08:09 +0200 Subject: [PATCH] Cap noise amount to 1 --- packages/superdough/synth.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/superdough/synth.mjs b/packages/superdough/synth.mjs index cd523de8a..e5f84bcf7 100644 --- a/packages/superdough/synth.mjs +++ b/packages/superdough/synth.mjs @@ -226,6 +226,7 @@ export function getOscillator({ s, freq, t, vib, vibmod, partials, noise }) { if (noise > 0) { // Two gain nodes to set the oscillators to their respective levels + noise = noise > 1 ? 1 : noise; let o_gain = ac.createGain(); let n_gain = ac.createGain(); o_gain.gain.setValueAtTime(1 - noise, ac.currentTime);