Fix clamping when min/max not specified
This commit is contained in:
parent
367e07da0c
commit
6051b922c0
1 changed files with 7 additions and 1 deletions
|
|
@ -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,
|
||||
() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue