support logs in mini repl
+ pass hap to logger + add editPattern hook to repl + useStrudel + do not throw when webaudio gets plain values
This commit is contained in:
parent
10ee11c886
commit
69ecb7b54f
8 changed files with 317 additions and 228 deletions
|
|
@ -12,6 +12,7 @@ export function repl({
|
|||
afterEval,
|
||||
getTime,
|
||||
transpiler,
|
||||
editPattern,
|
||||
onToggle,
|
||||
}) {
|
||||
const scheduler = new Cyclist({
|
||||
|
|
@ -41,8 +42,10 @@ export function repl({
|
|||
}
|
||||
try {
|
||||
beforeEval?.({ code });
|
||||
const { pattern } = await _evaluate(code, transpiler);
|
||||
let { pattern } = await _evaluate(code, transpiler);
|
||||
|
||||
logger(`[eval] code updated`);
|
||||
pattern = editPattern?.(pattern) || pattern;
|
||||
scheduler.setPattern(pattern, autostart);
|
||||
afterEval?.({ code, pattern });
|
||||
return pattern;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue