From 1f7f00e39b458b549e89c19377b9ecd4983be63d Mon Sep 17 00:00:00 2001 From: TheoryOfNekomata Date: Sun, 29 May 2022 13:22:48 +0800 Subject: [PATCH] Adapt messages to receive from any channel Use higher bits of first message byte to get notes from all channels. --- src/packages/game/input/IZ_midi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/packages/game/input/IZ_midi.c b/src/packages/game/input/IZ_midi.c index d1517f0..7845d42 100644 --- a/src/packages/game/input/IZ_midi.c +++ b/src/packages/game/input/IZ_midi.c @@ -62,7 +62,8 @@ uint8_t IZ_GetMIDINoteFromName(char* name) { void IZ_HandleMIDINoteOnOffEvents(PmEvent e, IZ_MIDIInputState* state, IZ_Action* action) { uint32_t message = e.message; - uint8_t status = message & 0xFFu; + uint8_t status = message & 0xF0u; + // uint8_t channel = message & 0x0Fu; uint8_t data1 = (message >> 8) & 0xFFu; // uint8_t data2 = (message >> 16) & 0xFFu;