From 157b05536ad6600fffa81aba590209f24e403a93 Mon Sep 17 00:00:00 2001 From: Aria Date: Wed, 12 Nov 2025 13:36:01 -0600 Subject: [PATCH] Final cleanup --- packages/superdough/worklets.mjs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/packages/superdough/worklets.mjs b/packages/superdough/worklets.mjs index 038f59697..51a025d6d 100644 --- a/packages/superdough/worklets.mjs +++ b/packages/superdough/worklets.mjs @@ -591,10 +591,6 @@ class PhaseVocoderProcessor extends OLAProcessor { this.fftSize = this.blockSize; this.invfftSize = 1 / this.fftSize; this.hannWindow = genHannWindow(this.fftSize); - // rescale hann window (empirically sounds nicer) - for (let i = 0; i < this.hannWindow.length; i++) { - this.hannWindow[i] *= 1.62; - } // prepare FFT and pre-allocate buffers this.fft = new FFT(this.fftSize); this.freqComplexBuffer = this.fft.createComplexArray(); @@ -633,7 +629,7 @@ class PhaseVocoderProcessor extends OLAProcessor { /** Apply Hann window in-place */ applyHannWindow(input) { for (let i = 0; i < this.blockSize; i++) { - input[i] *= this.hannWindow[i]; + input[i] *= this.hannWindow[i] * 1.62; } } @@ -791,7 +787,7 @@ class PulseOscillatorProcessor extends AudioWorkletProcessor { const detune = pv(params.detune, i); const freq = applySemitoneDetuneToFrequency(pv(params.frequency, i), detune / 100); - dphi = freq * (PI / (sampleRate * 0.5)); // phase increment + dphi = freq * TWO_PI * INVSR; // phase increment this.dphif += 0.1 * (dphi - this.dphif); env *= 0.9998; // exponential decay envelope @@ -981,7 +977,6 @@ export const WarpMode = Object.freeze({ SIGMOID: 19, FRACTAL: 20, FLIP: 21, - MODULAR: 22, }); function hash32(u) { @@ -1162,12 +1157,6 @@ class WavetableOscillatorProcessor extends AudioWorkletProcessor { const ridx = bitReverse(idx, b); return ridx / n; } - case WarpMode.MODULAR: { - const { n } = this._toBits(amt); - const depth = 0.5 * amt; - const jump = ffrac(phase * n) / n; - return ffrac(phase + depth * jump); - } case WarpMode.BROWNIAN: { const disp = 0.25 * amt * brownian(64 * phase, 4); return frac(phase + disp);