--- linuxsampler/trunk/src/engines/gig/Voice.cpp 2018/12/23 22:10:56 3448 +++ linuxsampler/trunk/src/engines/gig/Voice.cpp 2019/08/23 11:44:00 3561 @@ -280,8 +280,18 @@ pRegion->LFO1FlipPhase, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); pLFO1->updateByMIDICtrlValue(pLFO1->ExtController ? GetGigEngineChannel()->ControllerTable[pLFO1->ExtController] : 0); - pLFO1->setScriptDepthFactor(pNote->Override.AmpLFODepth); - pLFO1->setScriptFrequencyFactor(pNote->Override.AmpLFOFreq, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); + pLFO1->setScriptDepthFactor( + pNote->Override.AmpLFODepth.Value, + pNote->Override.AmpLFODepth.Final + ); + if (pNote->Override.AmpLFOFreq.isFinal()) + pLFO1->setScriptFrequencyFinal( + pNote->Override.AmpLFOFreq.Value, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE + ); + else + pLFO1->setScriptFrequencyFactor( + pNote->Override.AmpLFOFreq.Value, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE + ); } } @@ -326,8 +336,14 @@ pRegion->LFO2FlipPhase, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); pLFO2->updateByMIDICtrlValue(pLFO2->ExtController ? GetGigEngineChannel()->ControllerTable[pLFO2->ExtController] : 0); - pLFO2->setScriptDepthFactor(pNote->Override.CutoffLFODepth); - pLFO2->setScriptFrequencyFactor(pNote->Override.CutoffLFOFreq, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); + pLFO2->setScriptDepthFactor( + pNote->Override.CutoffLFODepth.Value, + pNote->Override.CutoffLFODepth.Final + ); + if (pNote->Override.CutoffLFOFreq.isFinal()) + pLFO2->setScriptFrequencyFinal(pNote->Override.CutoffLFOFreq.Value, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); + else + pLFO2->setScriptFrequencyFactor(pNote->Override.CutoffLFOFreq.Value, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); } } @@ -372,8 +388,14 @@ false, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); pLFO3->updateByMIDICtrlValue(pLFO3->ExtController ? GetGigEngineChannel()->ControllerTable[pLFO3->ExtController] : 0); - pLFO3->setScriptDepthFactor(pNote->Override.PitchLFODepth); - pLFO3->setScriptFrequencyFactor(pNote->Override.PitchLFOFreq, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); + pLFO3->setScriptDepthFactor( + pNote->Override.PitchLFODepth.Value, + pNote->Override.PitchLFODepth.Final + ); + if (pNote->Override.PitchLFOFreq.isFinal()) + pLFO3->setScriptFrequencyFinal(pNote->Override.PitchLFOFreq.Value, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); + else + pLFO3->setScriptFrequencyFactor(pNote->Override.PitchLFOFreq.Value, pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); } } @@ -481,7 +503,9 @@ pRegion->EG1Decay1 * egInfo.Decay * velrelease, pRegion->EG1Decay2 * egInfo.Decay * velrelease, pRegion->EG1InfiniteSustain, - pRegion->EG1Sustain * (pNote ? pNote->Override.Sustain : 1.f), + (pNote && pNote->Override.Sustain.Final) ? + pNote->Override.Sustain.Value : + pRegion->EG1Sustain * (pNote ? pNote->Override.Sustain.Value : 1.f), RTMath::Max(pRegion->EG1Release * velrelease, 0.014) * egInfo.Release, velocityAttenuation, sampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);