From 39b087be3ddf44bc5ef3237b27cf94e53f7c8251 Mon Sep 17 00:00:00 2001 From: Kevin <68612569+diyelectromusic@users.noreply.github.com> Date: Sun, 21 Jul 2024 12:41:00 +0100 Subject: [PATCH] Ensure unused TGs in a performance are MIDI disabled. Set polyphony to higher defaults on Pi 4 and 5. --- src/config.h | 6 +++--- src/performanceconfig.cpp | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/config.h b/src/config.h index ba88cf5f..166c4bbb 100644 --- a/src/config.h +++ b/src/config.h @@ -70,11 +70,11 @@ class CConfig // Configuration for MiniDexed static const unsigned MaxNotes = 8; static const unsigned DefaultNotes = 8; #elif RASPPI == 4 - static const unsigned MaxNotes = 24; - static const unsigned DefaultNotes = 16; + static const unsigned MaxNotes = 32; + static const unsigned DefaultNotes = 24; #elif RASPPI == 5 static const unsigned MaxNotes = 32; - static const unsigned DefaultNotes = 16; + static const unsigned DefaultNotes = 32; #else static const unsigned MaxNotes = 16; static const unsigned DefaultNotes = 16; diff --git a/src/performanceconfig.cpp b/src/performanceconfig.cpp index efbce575..d561c620 100644 --- a/src/performanceconfig.cpp +++ b/src/performanceconfig.cpp @@ -122,7 +122,7 @@ bool CPerformanceConfig::Load (void) } PropertyName.Format ("MIDIChannel%u", nTG+1); - unsigned nMIDIChannel = m_Properties.GetNumber (PropertyName, 255); + unsigned nMIDIChannel = m_Properties.GetNumber (PropertyName, 42); if (nMIDIChannel == 0) { m_nMIDIChannel[nTG] = CMIDIDevice::Disabled; @@ -132,6 +132,11 @@ bool CPerformanceConfig::Load (void) m_nMIDIChannel[nTG] = nMIDIChannel-1; bResult = true; } + else if (nMIDIChannel == 42) + { + // Property didn't exist in the file, so disable this TG + m_nMIDIChannel[nTG] = CMIDIDevice::Disabled; + } else { m_nMIDIChannel[nTG] = CMIDIDevice::OmniMode;