From d5816ad186db704af1e03b3d374bf0cbb220b074 Mon Sep 17 00:00:00 2001 From: Tom Maisey Date: Tue, 19 Mar 2019 11:18:39 +0000 Subject: [PATCH] Fix master channel check in MPEInstrument --- modules/juce_audio_basics/mpe/juce_MPEInstrument.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_basics/mpe/juce_MPEInstrument.cpp b/modules/juce_audio_basics/mpe/juce_MPEInstrument.cpp index 75a2b01a87..c83b16fb79 100644 --- a/modules/juce_audio_basics/mpe/juce_MPEInstrument.cpp +++ b/modules/juce_audio_basics/mpe/juce_MPEInstrument.cpp @@ -607,7 +607,11 @@ bool MPEInstrument::isMasterChannel (int midiChannel) const noexcept if (legacyMode.isEnabled) return false; - return (midiChannel == 1 || midiChannel == 16); + const auto lowerZone = zoneLayout.getLowerZone(); + const auto upperZone = zoneLayout.getUpperZone(); + + return (lowerZone.isActive() && midiChannel == lowerZone.getMasterChannel()) + || (upperZone.isActive() && midiChannel == upperZone.getMasterChannel()); } bool MPEInstrument::isUsingChannel (int midiChannel) const noexcept