Always key on for 32 samples regardless of pitch.

Before it would be more or less depending on pitch.  It's always 32.
Don't drop the last mix of vag samples.

Wait instead until the end of mixing to end the envelope.
Reset sampleFrac on keyon.

Since we're starting the samples over.
Smooth SAS resampling when pitch != 0x1000.
Return an error for an invalid pitch, per tests.
Optimize mixing samples at common pitches.

Doesn't seem to be a big help but may matter more on mobile.
Ignore pitch > 0x1000 for pcm.

It seems to be supported only below 0x1000.  Also, drop optimization for
double for now, simpler this way and doesn't seem common?
Avoid some divisions, just in case.
Actually use the resample buffer.

Fixes static in Final Fantasy Tactics music.
Merge pull request #5509 from unknownbrackets/sas-minor

Improve pitch handling in sas