fix: catch errors in pianoroll getValue

This commit is contained in:
Felix Roos 2024-03-15 12:24:03 +01:00
parent dfd22b5e44
commit 1043baf08a

View File

@ -18,7 +18,13 @@ const getValue = (e) => {
}
note = note ?? n;
if (typeof note === 'string') {
return noteToMidi(note);
try {
// TODO: n(run(32)).scale("D:minor") fails when trying to query negative time..
return noteToMidi(note);
} catch (err) {
// console.warn(`error converting note to midi: ${err}`); // this spams to crazy
return 0;
}
}
if (typeof note === 'number') {
return note;