Fixes buffer overrun issue construidor found and corrected.
Fixes audible squawking by not having any jumps in phase. Also cleans up envelope function.