Adapt the array size to account for possibly extended CCs

This commit is contained in:
Paul Ferrand 2019-12-17 18:50:07 +01:00
parent 38ab855415
commit 81cd4db0c4
2 changed files with 3 additions and 3 deletions

View file

@ -258,13 +258,13 @@ bool sfz::Synth::loadSfzFile(const fs::path& filename)
noteActivationLists[note].push_back(region); 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)) if (region->ccTriggers.contains(cc) || region->ccConditions.contains(cc))
ccActivationLists[cc].push_back(region); ccActivationLists[cc].push_back(region);
} }
// Defaults // Defaults
for (int ccIndex = 1; ccIndex < 128; ccIndex++) { for (int ccIndex = 0; ccIndex < config::numCCs; ccIndex++) {
const auto channel = region->channelRange.getStart(); const auto channel = region->channelRange.getStart();
region->registerCC(channel, ccIndex, midiState.getCCValue(channel, ccIndex)); region->registerCC(channel, ccIndex, midiState.getCCValue(channel, ccIndex));
} }

View file

@ -422,7 +422,7 @@ private:
// occur in the audio callback // occur in the audio callback
VoicePtrVector voiceViewArray; VoicePtrVector voiceViewArray;
std::array<RegionPtrVector, 128> noteActivationLists; std::array<RegionPtrVector, 128> noteActivationLists;
std::array<RegionPtrVector, 128> ccActivationLists; std::array<RegionPtrVector, config::numCCs> ccActivationLists;
// Internal temporary buffer // Internal temporary buffer
AudioBuffer<float> tempBuffer { 2, config::defaultSamplesPerBlock }; AudioBuffer<float> tempBuffer { 2, config::defaultSamplesPerBlock };