From 3c8acf9e0e9dbc08d9d5b91035b5c9c60fc4b854 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Fri, 16 Sep 2022 23:25:33 +0200 Subject: [PATCH] comment out timeout: it will cut of samples that are longer than hap.. --- packages/webaudio/webaudio.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/webaudio/webaudio.mjs b/packages/webaudio/webaudio.mjs index e2936f77..40d0f73f 100644 --- a/packages/webaudio/webaudio.mjs +++ b/packages/webaudio/webaudio.mjs @@ -199,7 +199,7 @@ Pattern.prototype.out = function () { } if (!s || ['sine', 'square', 'triangle', 'sawtooth'].includes(s)) { // with synths, n and note are the same thing - n = note || n; + n = note || n || 36; if (typeof n === 'string') { n = toMidi(n); // e.g. c3 => 48 } @@ -305,9 +305,9 @@ Pattern.prototype.out = function () { // connect chain elements together chain.slice(1).reduce((last, current) => last.connect(current), chain[0]); // disconnect all nodes when hap is over to make sure they are garbage collected - setTimeout(() => { +/* setTimeout(() => { chain.forEach((n) => n.disconnect()); - }, (hapDuration + release + 0.1) * 1000); + }, (hapDuration + release + 0.1) * 1000); */ } catch (e) { console.warn('.out error:', e); }