Better ADSR support, fixed some segfaults

Now it supports a simple envelope using attack, decay1, sustain, and
release from the GIG file. I couldn't figure out what amplitude it
should go to after decay2 (if set), so currently that is unused.

It would segfault if you had notes being played and then switched the
instrument since the samples no longer exited. Now it'll delete all
notes when you switch GIG files.