Corrected a bug from the pitch bend normalization which led to only bending "up"

This commit is contained in:
Paul Ferrand 2019-12-13 13:10:33 +01:00
parent e1be03f0e7
commit 87ee6e1d74

View file

@ -96,8 +96,8 @@ void sfz::Voice::startVoice(Region* region, int delay, int channel, int number,
widthEnvelope.reset(width);
pitchBendEnvelope.setFunction([region](float pitchValue){
const auto normalizedBend = -1 * normalizeBend(pitchValue);
const auto bendInCents = normalizedBend > 0 ? normalizedBend * region->bendUp : normalizedBend * region->bendDown;
const auto normalizedBend = normalizeBend(pitchValue);
const auto bendInCents = normalizedBend > 0 ? normalizedBend * region->bendUp : -normalizedBend * region->bendDown;
return centsFactor(bendInCents);
});
pitchBendEnvelope.reset(midiState.pitchBend);