mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 21:58:37 +00:00
proper disconnect onend
This commit is contained in:
parent
cafcead62e
commit
1ccc391c8e
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user