Fix various issues with player.
Fix various issues with player.

 * Envelope was applying sustain even if the flag was not set.
 * Envelope looping was completely broken.
 * Panning calculation was off, especially when working with panning
envelopes.
 * Note re-triggering (instrument but no note in event) wasn’t working at
all.

pgregory/wetracker,pgregory/wetracker