encapsulate .dough

This commit is contained in:
Felix Roos 2023-09-25 22:39:03 +02:00
parent 6e26f39751
commit 52c01abbe9
2 changed files with 8 additions and 7 deletions

View file

@ -1,4 +1,3 @@
import { Pattern } from '@strudel.cycles/core';
import { getAudioContext } from './superdough.mjs';
let worklet;
@ -73,8 +72,6 @@ export const dough = async (code) => {
worklet.node.connect(ac.destination);
};
Pattern.prototype.dough = function () {
return this.onTrigger((t, hap) => {
window.postMessage({ time: t, dough: hap.value });
}, 1);
};
export function doughTrigger(t, hap, currentTime, duration, cps) {
window.postMessage({ time: t, dough: hap.value, currentTime, duration, cps });
}