diff --git a/src/components/Keyboard/Keyboard.tsx b/src/components/Keyboard/Keyboard.tsx index 753e71c..5e71ca1 100644 --- a/src/components/Keyboard/Keyboard.tsx +++ b/src/components/Keyboard/Keyboard.tsx @@ -80,7 +80,7 @@ const Keyboard = () => { const payload = event.payload as { message: number[] } const [command, note, velocity] = payload.message - if (command === 144) { + if (command === 144 || command === 155) { setActiveNotes((an) => ({ ...an, [note]: true, @@ -89,7 +89,7 @@ const Keyboard = () => { // some midi keyboards don't send the off signal, // they just set the velocity to 0 - if (command === 128 || velocity === 0) { + if (command === 128 || command === 139 || velocity === 0) { setActiveNotes((an) => ({ ...an, [note]: false, diff --git a/src/components/Quiz/Quiz.tsx b/src/components/Quiz/Quiz.tsx index 2e4a043..e7d8463 100644 --- a/src/components/Quiz/Quiz.tsx +++ b/src/components/Quiz/Quiz.tsx @@ -122,7 +122,7 @@ const Quiz = () => { const payload = event.payload as { message: number[] } const [command, note, velocity] = payload.message - if (command === 144) { + if (command === 144 || command === 155) { setChordStack?.((cs) => [...cs, note]) setActiveNotes((an) => ({ ...an, @@ -130,7 +130,7 @@ const Quiz = () => { })) } - if (command === 128 || velocity === 0) { + if (command === 128 || command === 139 || velocity === 0) { // remove midiNumber from chordStack setChordStack?.((cs) => { const removalIdx = cs.indexOf(note)