diff --git a/packages/core/util.mjs b/packages/core/util.mjs index 0a4866d07..750662c02 100644 --- a/packages/core/util.mjs +++ b/packages/core/util.mjs @@ -19,6 +19,9 @@ export const tokenizeNote = (note) => { // turns the given note into its midi number representation export const toMidi = (note) => { + if (typeof note === 'number') { + return note; + } const [pc, acc, oct] = tokenizeNote(note); if (!pc) { throw new Error('not a note: "' + note + '"');