From b2f63897f9644a2c1e25d576b3b6a82f1b21a638 Mon Sep 17 00:00:00 2001 From: "Jade (Rose) Rowland" Date: Fri, 5 Jan 2024 01:07:54 -0500 Subject: [PATCH] change default FM env to exp because it modulates frequency and sounds way better :) --- packages/superdough/synth.mjs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/superdough/synth.mjs b/packages/superdough/synth.mjs index cfe3567c..c4586e92 100644 --- a/packages/superdough/synth.mjs +++ b/packages/superdough/synth.mjs @@ -119,7 +119,7 @@ export function getOscillator( // fm fmh: fmHarmonicity = 1, fmi: fmModulationIndex, - fmenv: fmEnvelopeType = 'lin', + fmenv: fmEnvelopeType = 'exp', fmattack: fmAttack, fmdecay: fmDecay, fmsustain: fmSustain, @@ -165,10 +165,7 @@ export function getOscillator( modulator.connect(o.frequency); } else { const [attack, decay, sustain, release] = getADSRValues([fmAttack, fmDecay, fmSustain, fmRelease]); - const holdEnd = t + duration; - // let envEnd = holdEnd + release + 0.01; - getParamADSR( envGain.gain, attack, @@ -181,11 +178,6 @@ export function getOscillator( holdEnd, fmEnvelopeType === 'exp' ? 'exponential' : 'linear', ); - - if (fmEnvelopeType === 'exp') { - envGain.maxValue = fmModulationIndex * 2; - envGain.minValue = 0.00001; - } modulator.connect(envGain); envGain.connect(o.frequency); }