From e69365e25b0b563e3fb249447f3bf7b3536cc873 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Sat, 20 Jun 2020 18:03:11 +0200 Subject: [PATCH] Add percent normalization in initialization --- src/sfizz/Voice.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sfizz/Voice.cpp b/src/sfizz/Voice.cpp index 24186d11..7e384345 100644 --- a/src/sfizz/Voice.cpp +++ b/src/sfizz/Voice.cpp @@ -137,8 +137,15 @@ void sfz::Voice::startVoice(Region* region, int delay, int number, float value, case Mod::pitch: smoother.reset(centsFactor(resources.midiState.getCCValue(mod.cc) * mod.data.value)); break; + case Mod::amplitude: + case Mod::pan: + case Mod::width: + case Mod::position: + smoother.reset(normalizePercents(resources.midiState.getCCValue(mod.cc) * mod.data.value)); + break; default: smoother.reset(resources.midiState.getCCValue(mod.cc) * mod.data.value); + break; } smoother.setSmoothing(mod.data.smooth, sampleRate); });