Remove unnecessary defaulting
This commit is contained in:
parent
46a45b4596
commit
d3d9f23c3c
1 changed files with 2 additions and 4 deletions
|
|
@ -186,13 +186,11 @@ async function onTriggerSynth(t, value, onended, bank, frameLen) {
|
||||||
const ac = getAudioContext();
|
const ac = getAudioContext();
|
||||||
let [attack, decay, sustain, release] = getADSRValues([value.attack, value.decay, value.sustain, value.release]);
|
let [attack, decay, sustain, release] = getADSRValues([value.attack, value.decay, value.sustain, value.release]);
|
||||||
let sourceDesc, holdEnd, envEnd;
|
let sourceDesc, holdEnd, envEnd;
|
||||||
let { unison = 5, spread = 0.6, detune, wtPos, wtWarp, wtWarpMode } = value;
|
let { unison, spread, detune, wtPos, wtWarp, wtWarpMode } = value;
|
||||||
if (typeof wtWarpMode === 'string') {
|
if (typeof wtWarpMode === 'string') {
|
||||||
wtWarpMode = WarpMode[wtWarpMode.toUpperCase()] ?? WarpMode.NONE;
|
wtWarpMode = WarpMode[wtWarpMode.toUpperCase()] ?? WarpMode.NONE;
|
||||||
}
|
}
|
||||||
detune = detune ?? 0.18;
|
|
||||||
const frequency = getFrequencyFromValue(value);
|
const frequency = getFrequencyFromValue(value);
|
||||||
const voices = clamp(unison, 1, 100);
|
|
||||||
let { tableUrl, label } = getTableInfo(value, bank);
|
let { tableUrl, label } = getTableInfo(value, bank);
|
||||||
const payload = await loadWavetableFrames(tableUrl, label, frameLen);
|
const payload = await loadWavetableFrames(tableUrl, label, frameLen);
|
||||||
holdEnd = t + duration;
|
holdEnd = t + duration;
|
||||||
|
|
@ -208,7 +206,7 @@ async function onTriggerSynth(t, value, onended, bank, frameLen) {
|
||||||
position: wtPos,
|
position: wtPos,
|
||||||
warp: wtWarp,
|
warp: wtWarp,
|
||||||
warpMode: wtWarpMode,
|
warpMode: wtWarpMode,
|
||||||
voices,
|
voices: unison,
|
||||||
spread,
|
spread,
|
||||||
},
|
},
|
||||||
{ outputChannelCount: [2] },
|
{ outputChannelCount: [2] },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue