mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-16 16:18:32 +00:00
change default FM env to exp because it modulates frequency and sounds way better :)
This commit is contained in:
parent
2ee392be9b
commit
b2f63897f9
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user