Also set values immediately for supersaw and wavetable

This commit is contained in:
Aria 2026-01-14 16:58:45 -06:00
parent 85e79d9932
commit 21e6d81d34
3 changed files with 3 additions and 5 deletions

View file

@ -178,11 +178,10 @@ export function registerSynthSounds() {
};
const factory = () => new AudioWorkletNode(ac, 'supersaw-oscillator', { outputChannelCount: [2] });
const o = getNodeFromPool('supersaw', factory);
const now = ac.currentTime;
Object.entries(params).forEach(([key, value]) => {
const param = o.parameters.get(key);
const target = value !== undefined ? value : param.defaultValue;
param.setValueAtTime(target, now);
param.value = target;
});
o.port.postMessage({ type: 'initialize' });
const gainAdjustment = 1 / Math.sqrt(voices);