diff --git a/src/grandorgue/sound/GOSoundFader.cpp b/src/grandorgue/sound/GOSoundFader.cpp index 7851085f5..44bebdd42 100644 --- a/src/grandorgue/sound/GOSoundFader.cpp +++ b/src/grandorgue/sound/GOSoundFader.cpp @@ -80,18 +80,19 @@ void GOSoundFader::Process( } // Calculate the external volume - float newExternalVolume = m_VelocityVolume * externalVolume; + float targetExternalVolume = m_VelocityVolume * externalVolume; if (m_LastExternalVolumePoint < 0.0f) - m_LastExternalVolumePoint = newExternalVolume; + m_LastExternalVolumePoint = targetExternalVolume; float startExternalVolumePoint = m_LastExternalVolumePoint; // Calculate new m_LastExternalVolumePoint // the target volume will be changed from startExternalVolumePoint to // m_LastExternalVolumePoint during the nFrames period - if (newExternalVolume != startExternalVolumePoint) - m_LastExternalVolumePoint += (newExternalVolume - startExternalVolumePoint) + if (targetExternalVolume != startExternalVolumePoint) + m_LastExternalVolumePoint + += (targetExternalVolume - startExternalVolumePoint) // Assume that external volume is to be reached in MAX_FRAME_SIZE frames * std::max(nFrames, EXTERNAL_VOLUME_CHANGE_FRAMES) / EXTERNAL_VOLUME_CHANGE_FRAMES;