SoundEnvelope class fully refactored