fix: use full repl in web package

This commit is contained in:
Felix Roos 2024-05-30 14:36:28 +02:00
parent 65856409b6
commit 3cd31b2290
3 changed files with 17 additions and 23 deletions

View file

@ -6,7 +6,7 @@ This program is free software: you can redistribute it and/or modify it under th
import * as strudel from '@strudel/core';
import { superdough, getAudioContext, setLogger, doughTrigger } from 'superdough';
const { Pattern, logger } = strudel;
const { Pattern, logger, repl } = strudel;
setLogger(logger);
@ -24,17 +24,13 @@ Pattern.prototype.webaudio = function () {
return this.onTrigger(webaudioOutputTrigger);
};
export function webaudioScheduler(options = {}) {
export function webaudioRepl(options = {}) {
options = {
getTime: () => getAudioContext().currentTime,
defaultOutput: webaudioOutput,
...options,
};
const { defaultOutput, getTime } = options;
return new strudel.Cyclist({
...options,
onTrigger: strudel.getTrigger({ defaultOutput, getTime }),
});
return repl(options);
}
Pattern.prototype.dough = function () {