encapsulate .dough
This commit is contained in:
parent
6e26f39751
commit
52c01abbe9
2 changed files with 8 additions and 7 deletions
|
|
@ -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 });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue