--- linuxsampler/trunk/src/engines/common/AbstractVoice.cpp 2010/01/30 10:30:02 2055 +++ linuxsampler/trunk/src/engines/common/AbstractVoice.cpp 2010/02/23 18:32:31 2061 @@ -600,10 +600,13 @@ float noteLength = float(GetEngine()->FrameTime + Delay - GetNoteOnTime(MIDIKey) ) / GetEngine()->SampleRate; - float attenuation = 1 - 0.01053 * (256 >> RgnInfo.ReleaseTriggerDecay) * noteLength; - volume *= attenuation; + volume *= GetReleaseTriggerAttenuation(noteLength); } return volume; } + + float AbstractVoice::GetReleaseTriggerAttenuation(float noteLength) { + return 1 - RgnInfo.ReleaseTriggerDecay * noteLength; + } } // namespace LinuxSampler