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