Merge pull request 'Bugfix: Fix modulator clamping when min/max not specified' (#1859) from glossing/clamp-bugfix into main

Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1859
This commit is contained in:
Aria
2025-12-29 21:59:10 +01:00
+7 -1
View File
@@ -144,7 +144,13 @@ export const connectBusModulator = (params, nodeTracker, controller) => {
const depthValue = depthabs != null ? depthabs : depth * currentValue;
const depthGain = gainNode((Math.sign(depthValue) * Math.abs(depthValue)) / 0.3);
const unClamped = shifted.connect(depthGain);
let { modulator, toCleanup } = clampWithWaveShaper(unClamped, min, max);
const toCleanup = [];
let modulator = unClamped;
if (min !== undefined && max !== undefined) {
const wsData = clampWithWaveShaper(unClamped, min, max);
modulator = wsData.modulator;
toCleanup.push(...wsData.toCleanup);
}
webAudioTimeout(
ac,
() => {