front practice basically working, need cleanup

This commit is contained in:
GitBluub
2024-01-15 23:14:09 +01:00
committed by Clément Le Bihan
parent 23a1ff8d19
commit c08a1a2c74
2 changed files with 7 additions and 6 deletions

View File

@@ -223,8 +223,9 @@ const PlayView = ({ songId }: PlayViewProps) => {
};
inputs.forEach((input) => {
input.onmidimessage = (message) => {
const { command, note } = parseMidiMessage(message);
const keyIsPressed = command == 9;
const { command, note, velocity } = parseMidiMessage(message);
let keyIsPressed = command == 9;
if (velocity == 0) keyIsPressed = false;
webSocket.current?.send(
JSON.stringify({