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:
Felix Roos 2023-01-09 23:26:20 +01:00
parent 10ee11c886
commit 69ecb7b54f
8 changed files with 317 additions and 228 deletions

View file

@ -195,9 +195,14 @@ export const webaudioOutput = async (hap, deadline, hapDuration) => {
hap.value = { note: hap.value };
} */
if (typeof hap.value !== 'object') {
throw new Error(
`hap.value ${hap.value} is not supported by webaudio output. Hint: append .note() or .s() to the end`,
logger(
`hap.value "${hap.value}" is not supported by webaudio output. Hint: append .note() or .s() to the end`,
'error',
);
/* throw new Error(
`hap.value "${hap.value}"" is not supported by webaudio output. Hint: append .note() or .s() to the end`,
); */
return;
}
// calculate correct time (tone.js workaround)
let t = ac.currentTime + deadline;