Skip to content

Commit

Permalink
Fix bug in MIDI button handling commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
diyelectromusic committed Jan 3, 2024
1 parent 2871901 commit 7c6d544
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mididevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
}
}
}
if (nLength == 3)
{
m_pUI->UIMIDICmdHandler (ucChannel, ucStatus & 0xF0, pMessage[1], pMessage[2]);
}
break;

case MIDI_NOTE_OFF:
Expand Down
3 changes: 3 additions & 0 deletions src/userinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,16 @@ void CUserInterface::UISetMIDIButtonChannel (unsigned uCh)
if (uCh == 0)
{
m_nMIDIButtonCh = CMIDIDevice::Disabled;
LOGNOTE("MIDI Button channel not set");
}
else if (uCh < CMIDIDevice::Channels)
{
m_nMIDIButtonCh = uCh - 1;
LOGNOTE("MIDI Button channel set to: %d", m_nMIDIButtonCh);
}
else
{
m_nMIDIButtonCh = CMIDIDevice::OmniMode;
LOGNOTE("MIDI Button channel set to: OMNI");
}
}

0 comments on commit 7c6d544

Please sign in to comment.