improve api for web package
This commit is contained in:
parent
3b631cb6af
commit
12228c56d9
10 changed files with 160 additions and 73 deletions
|
|
@ -243,3 +243,16 @@ Pattern.prototype.webaudio = function () {
|
|||
// TODO: refactor (t, hap, ct, cps) to (hap, deadline, duration) ?
|
||||
return this.onTrigger(webaudioOutputTrigger);
|
||||
};
|
||||
|
||||
export function webaudioScheduler(options = {}) {
|
||||
options = {
|
||||
getTime: () => getAudioContext().currentTime,
|
||||
defaultOutput: webaudioOutput,
|
||||
...options,
|
||||
};
|
||||
const { defaultOutput, getTime } = options;
|
||||
return new strudel.Cyclist({
|
||||
...options,
|
||||
onTrigger: strudel.getTrigger({ defaultOutput, getTime }),
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue