mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-13 06:19:33 -04:00
proper disconnect onend
This commit is contained in:
@@ -305,10 +305,8 @@ Pattern.prototype.out = function () {
|
||||
chain.push(ac.destination);
|
||||
// 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(() => {
|
||||
chain.forEach((n) => n.disconnect());
|
||||
}, (hapDuration + release + 0.1) * 1000); */
|
||||
// disconnect all nodes when source node has ended:
|
||||
chain[0].onended = () => chain.forEach((n) => n.disconnect());
|
||||
} catch (e) {
|
||||
console.warn('.out error:', e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user