Bug in SamplerVoice regarding releaseDelta

Hey Jules,

I'm using JUCE v3.0.8 and happened upon what I believe to be a minor issue with the startNote method in the SamplerVoice class. On line 122 of juce_Sampler.cpp, releaseDelta is set to 0.0 in the case where the number of release samples does not exceed 0. This causes the playback to sustain until the end of the sample is reached when stopNote is called called with allowTailOff set to true. It seems to me that the best behavior when stopNote is called with allowTailOff = true in the case where numReleaseSamples = 0 would be to end the note completely.

A simple fix would be to change line 122 from:

releaseDelta = 0.0f;


releaseDelta = -1.0f;

Ideally, one wouldn't call stopNote with allowTailOff = true in the case where numReleaseSamples = 0, but I thought it might be worth pointing out. 

~ Doron

That's a good idea, thanks for the heads-up!