mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-13 14:26:58 -04:00
Also set values immediately for supersaw and wavetable
This commit is contained in:
@@ -155,7 +155,7 @@ export function getCompressor(ac, threshold, ratio, knee, attack, release) {
|
||||
release: release ?? 0.05,
|
||||
};
|
||||
Object.entries(options).forEach(([key, value]) => {
|
||||
node[key].value = value;;
|
||||
node[key].value = value;
|
||||
});
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user