From 8d1c98f03eb38571dae21422df403cd9279ba277 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Sat, 6 Aug 2022 21:37:41 +0200 Subject: [PATCH] always throw error for invalid notes --- packages/core/util.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/util.mjs b/packages/core/util.mjs index 6a96be87..86d798d6 100644 --- a/packages/core/util.mjs +++ b/packages/core/util.mjs @@ -53,8 +53,8 @@ export const getPlayableNoteValue = (hap) => { // if value is number => interpret as midi number as long as its not marked as frequency if (typeof note === 'number' && context.type !== 'frequency') { note = fromMidi(hap.value); - } else if (typeof note === 'string' && !isNote(note)) { - throw new Error('not a note: ' + note); + } else if (typeof note !== 'string' || !isNote(note)) { + throw new Error('not a note: ' + JSON.stringify(note)); } return note; };