fix: catch errors in pianoroll getValue
This commit is contained in:
parent
dfd22b5e44
commit
1043baf08a
1 changed files with 7 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue