From 64c2e7c1e8071e1676e9958d4f8f3a7f840f8b37 Mon Sep 17 00:00:00 2001 From: Jade Rowland Date: Thu, 23 Nov 2023 13:45:58 -0500 Subject: [PATCH] cleaning up --- packages/superdough/synth.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/superdough/synth.mjs b/packages/superdough/synth.mjs index fad67b75..dafc2e7c 100644 --- a/packages/superdough/synth.mjs +++ b/packages/superdough/synth.mjs @@ -71,7 +71,8 @@ export function waveformN(partials, type) { const real = new Float32Array(partials + 1); const imag = new Float32Array(partials + 1); const ac = getAudioContext(); - const osc = new OscillatorNode(ac, { channelCount: 1, channelCountMode: 'explicit' }); + const osc = ac.createOscillator(); + const terms = { sawtooth: (n) => [0, -1 / n], square: (n) => [0, n % 2 === 0 ? 0 : 1 / n], @@ -124,8 +125,7 @@ export function getOscillator( let o; // If no partials are given, use stock waveforms if (!partials || s === 'sine') { - o = new OscillatorNode(ac, { channelCount: 1, channelCountMode: 'explicit' }); - console.log(o); + o = getAudioContext().createOscillator(); o.type = s || 'triangle'; } // generate custom waveform if partials are given