diff --git a/src/mididevice.cpp b/src/mididevice.cpp index ce68339..de22a71 100644 --- a/src/mididevice.cpp +++ b/src/mididevice.cpp @@ -114,8 +114,7 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign switch(pMessage[0]) { case MIDI_SYSTEM_EXCLUSIVE_BEGIN: - printf("SysEx data length: [%d]\n",uint16_t(nLength)); - printf("SysEx data:"); + printf("MIDI%u: SysEx data length: [%d]:",nCable, uint16_t(nLength)); for (uint16_t i = 0; i < nLength; i++) { if((i % 8) == 0) @@ -125,7 +124,7 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign printf("\n"); break; default: - printf("Unhandled MIDI event type %0x02x\n",pMessage[0]); + printf("MIDI%u: Unhandled MIDI event type %0x02x\n",nCable,pMessage[0]); } break; } @@ -165,8 +164,15 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign for (unsigned nTG = 0; nTG < CConfig::ToneGenerators; nTG++) { // MIDI SYSEX per MIDI channel - if (ucStatus == MIDI_SYSTEM_EXCLUSIVE_BEGIN && (m_ChannelMap[nTG] == ((pMessage[2] & 0x07) + 1) || (m_ChannelMap[nTG] > 16 ))) + uint8_t ucSysExChannel = (pMessage[2] & 0x07) + 1; + if (ucStatus == MIDI_SYSTEM_EXCLUSIVE_BEGIN && + (ucSysExChannel == m_ChannelMap[nTG] || + ucSysExChannel == OmniMode) + ) + { + LOGNOTE("MIDI-SYSEX: channel: %u, len: %u, TG: %u",m_ChannelMap[nTG],nTG); HandleSystemExclusive(pMessage, nLength, nTG); + } else { if ( m_ChannelMap[nTG] == ucChannel diff --git a/src/serialmididevice.cpp b/src/serialmididevice.cpp index 157c6be..fd25a28 100644 --- a/src/serialmididevice.cpp +++ b/src/serialmididevice.cpp @@ -20,10 +20,14 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . // + +#include #include #include "serialmididevice.h" #include +LOGMODULE("serialmididevice"); + CSerialMIDIDevice::CSerialMIDIDevice (CMiniDexed *pSynthesizer, CInterruptSystem *pInterrupt, CConfig *pConfig) : CMIDIDevice (pSynthesizer, pConfig), @@ -58,10 +62,11 @@ void CSerialMIDIDevice::Process (void) if (nResult <= 0) { if(nResult!=0) - printf("Serial-Read: %d\n",nResult); + LOGERR("Serial.Read() error: %d\n",nResult); return; } + /* if (m_pConfig->GetMIDIDumpEnabled ()) { printf("Incoming MIDI data:"); @@ -73,6 +78,7 @@ void CSerialMIDIDevice::Process (void) } printf("\n"); } + */ // Process MIDI messages // See: https://www.midi.org/specifications/item/table-1-summary-of-midi-message