Merge branch 'main' into jade/orbitsynonym

This commit is contained in:
Jade (Rose) Rowland 2025-11-23 19:06:16 -05:00
commit 8325b4cfc4
3 changed files with 12 additions and 6 deletions

View file

@ -238,8 +238,8 @@ export function repl({
pattern = eachTransform(pattern); pattern = eachTransform(pattern);
} }
if (allTransforms.length) { if (allTransforms.length) {
for (let i in allTransforms) { for (const transform of allTransforms) {
pattern = allTransforms[i](pattern); pattern = transform(pattern);
} }
} }

View file

@ -238,7 +238,7 @@ export function createFilter(context, start, end, params, cps) {
if (sync != null) { if (sync != null) {
rate = cps * sync; rate = cps * sync;
} }
const lfoValues = { depth, dcoffset, skew, shape, frequency: rate }; const lfoValues = { depth, dcoffset, skew, shape, frequency: rate, min: 10, max: 20000 };
getParamLfo(context, frequencyParam, start, end, lfoValues); getParamLfo(context, frequencyParam, start, end, lfoValues);
return filter; return filter;
} }
@ -362,9 +362,9 @@ const mod = (freq, range = 1, type = 'sine') => {
} }
osc.start(); osc.start();
const g = new GainNode(ctx, { gain: range }); const g = gainNode(range);
osc.connect(g); // -range, range osc.connect(g); // -range, range
return { node: g, stop: (t) => osc.stop(t) }; return { node: g, stop: (t) => osc.stop(t), osc: osc };
}; };
const fm = (frequencyparam, harmonicityRatio, modulationIndex, wave = 'sine') => { const fm = (frequencyparam, harmonicityRatio, modulationIndex, wave = 'sine') => {
const carrfreq = frequencyparam.value; const carrfreq = frequencyparam.value;
@ -416,6 +416,11 @@ export function applyFM(param, value, begin) {
modulator.connect(envGain); modulator.connect(envGain);
envGain.connect(param); envGain.connect(param);
} }
fmmod.osc.onended = () => {
envGain.disconnect();
modulator.disconnect();
fmmod.osc.disconnect();
};
} }
return { stop }; return { stop };
} }

View file

@ -543,8 +543,9 @@ class SuperSawOscillatorProcessor extends AudioWorkletProcessor {
if (pn >= 1.0) pn -= 1.0; if (pn >= 1.0) pn -= 1.0;
this.phase[n] = pn; this.phase[n] = pn;
// invert right and left gain // invert right and left gain
const tmp = gainL;
gainL = gainR; gainL = gainR;
gainR = gainL; gainR = tmp;
} }
} }
return true; return true;