fix: format

This commit is contained in:
Felix Roos 2023-08-31 03:56:31 +02:00
parent c625096f59
commit b1b084452c

View file

@ -20,7 +20,6 @@ const mod = (freq, range = 1, type) => {
return { node: g, stop: (t) => osc.stop(t) };
};
export function registerSynthSounds() {
['sine', 'square', 'triangle', 'sawtooth'].forEach((wave) => {
registerSound(
@ -40,7 +39,7 @@ export function registerSynthSounds() {
fmsustain: fmSustain = 0.001,
fmrelease: fmRelease = 0.1,
fmvelocity: fmVelocity = 1,
fmwave: fmWaveform = 'sine'
fmwave: fmWaveform = 'sine',
} = value;
let { n, note, freq } = value;
// with synths, n and note are the same thing
@ -60,7 +59,7 @@ export function registerSynthSounds() {
if (fmModulationIndex) {
const { node: modulator, stop } = fm(o, fmHarmonicity, fmModulationIndex, fmWaveform);
fmEnvelope = getEnvelope(fmAttack, fmDecay, fmSustain, fmRelease, fmVelocity, t);
if (fmEnvelopeType === "exp") {
if (fmEnvelopeType === 'exp') {
fmEnvelope = getExpEnvelope(fmAttack, fmDecay, fmVelocity, t);
fmEnvelope.node.maxValue = fmModulationIndex * 2;
fmEnvelope.node.minValue = 0.00001;