From 58a5e87df533ba2add21d5512c804c64fd27c4fa Mon Sep 17 00:00:00 2001 From: Paul Fd Date: Sun, 9 Feb 2020 23:46:00 +0100 Subject: [PATCH] Position and width correctly map their own cc modulation --- src/sfizz/Voice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sfizz/Voice.cpp b/src/sfizz/Voice.cpp index 45e6ab4e..56e7fcea 100644 --- a/src/sfizz/Voice.cpp +++ b/src/sfizz/Voice.cpp @@ -182,12 +182,12 @@ void sfz::Voice::registerCC(int delay, int ccNumber, uint8_t ccValue) noexcept } if (region->positionCC && ccNumber == region->positionCC->first) { - const float newPosition { basePosition + normalizeCC(ccValue) * region->panCC->second / 100.0f }; + const float newPosition { basePosition + normalizeCC(ccValue) * region->positionCC->second / 100.0f }; positionEnvelope.registerEvent(delay, Default::symmetricNormalizedRange.clamp(newPosition)); } if (region->widthCC && ccNumber == region->widthCC->first) { - const float newWidth { baseWidth + normalizeCC(ccValue) * region->panCC->second / 100.0f }; + const float newWidth { baseWidth + normalizeCC(ccValue) * region->widthCC->second / 100.0f }; widthEnvelope.registerEvent(delay, Default::symmetricNormalizedRange.clamp(newWidth)); }