From bf243c04b908c2ace4307fabb46396d114f14415 Mon Sep 17 00:00:00 2001 From: Aria Date: Sat, 3 Jan 2026 18:27:11 -0600 Subject: [PATCH] Make stretch modulatable --- packages/superdough/superdough.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/superdough/superdough.mjs b/packages/superdough/superdough.mjs index c2515e324..33c1e404f 100644 --- a/packages/superdough/superdough.mjs +++ b/packages/superdough/superdough.mjs @@ -607,7 +607,11 @@ export const superdough = async (value, t, hapDuration, cps = 0.5, cycle = 0.5) gain *= velocity; // velocity currently only multiplies with gain. it might do other things in the future delaytime = delaytime ?? cycleToSeconds(delaysync, cps); - stretch !== undefined && chain.connect(getWorklet(ac, 'phase-vocoder-processor', { pitchFactor: stretch })); + if (stretch !== undefined) { + const phaseVocoder = getWorklet(ac, 'phase-vocoder-processor', { pitchFactor: stretch }); + chain.connect(phaseVocoder); + fxNodes['stretch'] = [phaseVocoder]; + } if (fx.transient !== undefined) { const transProcessor = getWorklet(