mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-25 04:28:30 +00:00
load worklets on startup
This commit is contained in:
parent
de4726ec8d
commit
acf339ad13
@ -147,12 +147,13 @@ function getWorklet(ac, processor, params) {
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
loadWorklets();
|
||||||
|
} catch (err) {
|
||||||
|
console.warn('could not load AudioWorklet effects coarse, crush and shape', err);
|
||||||
|
}
|
||||||
|
|
||||||
Pattern.prototype.out = function () {
|
Pattern.prototype.out = function () {
|
||||||
try {
|
|
||||||
loadWorklets();
|
|
||||||
} catch (err) {
|
|
||||||
console.warn('could not load AudioWorklet effects coarse, crush and shape', err);
|
|
||||||
}
|
|
||||||
return this.onTrigger(async (t, hap, ct, cps) => {
|
return this.onTrigger(async (t, hap, ct, cps) => {
|
||||||
const hapDuration = hap.duration / cps;
|
const hapDuration = hap.duration / cps;
|
||||||
try {
|
try {
|
||||||
@ -305,7 +306,7 @@ Pattern.prototype.out = function () {
|
|||||||
// connect chain elements together
|
// connect chain elements together
|
||||||
chain.slice(1).reduce((last, current) => last.connect(current), chain[0]);
|
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
|
// disconnect all nodes when hap is over to make sure they are garbage collected
|
||||||
/* setTimeout(() => {
|
/* setTimeout(() => {
|
||||||
chain.forEach((n) => n.disconnect());
|
chain.forEach((n) => n.disconnect());
|
||||||
}, (hapDuration + release + 0.1) * 1000); */
|
}, (hapDuration + release + 0.1) * 1000); */
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user