fix: web midi
This commit is contained in:
parent
372bdf8be7
commit
eca92cf5b5
6 changed files with 249 additions and 230 deletions
|
|
@ -12,7 +12,19 @@ export function repl({
|
|||
transpiler,
|
||||
onToggle,
|
||||
}) {
|
||||
const scheduler = new Cyclist({ interval, onTrigger: defaultOutput, onError: onSchedulerError, getTime, onToggle });
|
||||
const scheduler = new Cyclist({
|
||||
interval,
|
||||
onTrigger: (hap, deadline, duration) => {
|
||||
if (!hap.context.onTrigger) {
|
||||
return defaultOutput(hap, deadline, duration);
|
||||
}
|
||||
// call signature of output / onTrigger is different...
|
||||
return hap.context.onTrigger(getTime() + deadline, hap);
|
||||
},
|
||||
onError: onSchedulerError,
|
||||
getTime,
|
||||
onToggle,
|
||||
});
|
||||
const evaluate = async (code, autostart = true) => {
|
||||
if (!code) {
|
||||
throw new Error('no code to evaluate');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue