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

@ -244,11 +244,10 @@ export async function onTriggerSynth(t, value, onended, tables, cps, frameLen) {
};
const factory = () => new AudioWorkletNode(ac, 'wavetable-oscillator-processor', { outputChannelCount: [2] });
const source = getNodeFromPool('wavetable', factory);
const now = ac.currentTime;
Object.entries(params).forEach(([key, value]) => {
const param = source.parameters.get(key);
const target = value !== undefined ? value : param.defaultValue;
param.setValueAtTime(target, now);
param.value = target;
});
source.port.postMessage({ type: 'initialize', payload });
if (ac.currentTime > t) {