Skip to content

Commit

Permalink
fix: add fix for maudio possibly
Browse files Browse the repository at this point in the history
  • Loading branch information
ZaneH committed Jul 3, 2024
1 parent 233734a commit a7613fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/Keyboard/Keyboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Quiz/Quiz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ 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,
[note]: true,
}))
}

if (command === 128 || velocity === 0) {
if (command === 128 || command === 139 || velocity === 0) {
// remove midiNumber from chordStack
setChordStack?.((cs) => {
const removalIdx = cs.indexOf(note)
Expand Down

0 comments on commit a7613fc

Please sign in to comment.