From 632cb0a6e0703d32d01c64311b06d265883f750f Mon Sep 17 00:00:00 2001 From: Iurie Nistor Date: Tue, 10 Dec 2024 14:59:30 +0200 Subject: [PATCH] set midi channel range --- src/percussion_state.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/percussion_state.cpp b/src/percussion_state.cpp index 6eb6e857..5f7bbf23 100755 --- a/src/percussion_state.cpp +++ b/src/percussion_state.cpp @@ -166,14 +166,18 @@ void PercussionState::setChannel(size_t channel) { outputChannel = std::clamp(channel, static_cast(0), - GeonkickApi::numberOfChannels() - 1); + GeonkickApi::numberOfChannels() - 2); } void PercussionState::setMidiChannel(signed char channel) { - outputMidiChannel = std::clamp(channel, - static_cast(0), - GeonkickApi::numberOfMidiChannels() - 1); + if (GeonkickTypes::geonkickAnyMidiChannel == static_cast(channel)) { + outputMidiChannel = channel; + } else { + outputMidiChannel = std::clamp(channel, + static_cast(0), + static_cast(GeonkickApi::numberOfMidiChannels() - 1)); + } } void PercussionState::setMute(bool b)