From 81cd4db0c439e8828931263f058fd71a2028c534 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Tue, 17 Dec 2019 18:50:07 +0100 Subject: [PATCH] Adapt the array size to account for possibly extended CCs --- src/sfizz/Synth.cpp | 4 ++-- src/sfizz/Synth.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sfizz/Synth.cpp b/src/sfizz/Synth.cpp index 5b295288..d16e7954 100644 --- a/src/sfizz/Synth.cpp +++ b/src/sfizz/Synth.cpp @@ -258,13 +258,13 @@ bool sfz::Synth::loadSfzFile(const fs::path& filename) noteActivationLists[note].push_back(region); } - for (auto cc = 0; cc < 128; cc++) { + for (auto cc = 0; cc < config::numCCs; cc++) { if (region->ccTriggers.contains(cc) || region->ccConditions.contains(cc)) ccActivationLists[cc].push_back(region); } // Defaults - for (int ccIndex = 1; ccIndex < 128; ccIndex++) { + for (int ccIndex = 0; ccIndex < config::numCCs; ccIndex++) { const auto channel = region->channelRange.getStart(); region->registerCC(channel, ccIndex, midiState.getCCValue(channel, ccIndex)); } diff --git a/src/sfizz/Synth.h b/src/sfizz/Synth.h index 6c3241f8..6cb13fcd 100644 --- a/src/sfizz/Synth.h +++ b/src/sfizz/Synth.h @@ -422,7 +422,7 @@ private: // occur in the audio callback VoicePtrVector voiceViewArray; std::array noteActivationLists; - std::array ccActivationLists; + std::array ccActivationLists; // Internal temporary buffer AudioBuffer tempBuffer { 2, config::defaultSamplesPerBlock };