diff --git a/src/engine/audioEngine.js b/src/engine/audioEngine.js index ad5b387..0894599 100644 --- a/src/engine/audioEngine.js +++ b/src/engine/audioEngine.js @@ -127,8 +127,9 @@ function createNode(mod) { } case 'vca': { const gain = new Tone.Gain(p.gain); - // CV modulation scaler: envelope (0-1) × gain param → added to gain.gain - const cvMod = new Tone.Gain(p.gain); + // CV scaler: always gain=1 so envelope (0-1) passes through fully. + // When CV is connected, base gain is zeroed — envelope controls amplitude entirely. + const cvMod = new Tone.Gain(1); cvMod.connect(gain.gain); return { node: gain, @@ -401,9 +402,10 @@ export function updateParam(moduleId, paramName, value) { break; case 'vca': if (paramName === 'gain') { + // Only update base gain if no CV is connected (CV zeroes it) const hasCV = state.connections.some(c => c.to.moduleId === moduleId && c.to.port === 'cv'); if (!hasCV) entry.node.gain.value = value; - if (entry._cvMod) entry._cvMod.gain.value = value; + // cvMod stays at 1 always — envelope controls full range } break; case 'delay':