Apply velocity-related note gain to a CC-triggered note

if the velocity has been replaced with `sw_vel=previous`
This commit is contained in:
Paul Fd 2021-04-04 17:54:08 +02:00
parent 78e20c68bf
commit ac27e060ba

View file

@ -472,8 +472,9 @@ bool Voice::startVoice(Layer* layer, int delay, const TriggerEvent& event) noexc
impl.baseVolumedB_ = region.getBaseVolumedB(resources.midiState, impl.triggerEvent_.number);
impl.baseGain_ = region.getBaseGain();
if (impl.triggerEvent_.type != TriggerEventType::CC)
if (impl.triggerEvent_.type != TriggerEventType::CC || region.velocityOverride == VelocityOverride::previous)
impl.baseGain_ *= region.getNoteGain(impl.triggerEvent_.number, impl.triggerEvent_.value);
impl.gainSmoother_.reset();
impl.resetCrossfades();