Fixes to audio attenuation jumps and better sample loop script

coding standard: split onto multiple lines.

**3.4.2. The conditional should be put on a separate line and wrapped in braces.** - https://github.com/highfidelity/hifi/wiki/Coding-Standard#342-the-conditional-should-be-put-on-a-separate-line-and-wrapped-in-braces