Corrected a bug from the pitch bend normalization which led to only bending "up"
This commit is contained in:
parent
e1be03f0e7
commit
87ee6e1d74
1 changed files with 2 additions and 2 deletions
|
|
@ -96,8 +96,8 @@ void sfz::Voice::startVoice(Region* region, int delay, int channel, int number,
|
||||||
widthEnvelope.reset(width);
|
widthEnvelope.reset(width);
|
||||||
|
|
||||||
pitchBendEnvelope.setFunction([region](float pitchValue){
|
pitchBendEnvelope.setFunction([region](float pitchValue){
|
||||||
const auto normalizedBend = -1 * normalizeBend(pitchValue);
|
const auto normalizedBend = normalizeBend(pitchValue);
|
||||||
const auto bendInCents = normalizedBend > 0 ? normalizedBend * region->bendUp : normalizedBend * region->bendDown;
|
const auto bendInCents = normalizedBend > 0 ? normalizedBend * region->bendUp : -normalizedBend * region->bendDown;
|
||||||
return centsFactor(bendInCents);
|
return centsFactor(bendInCents);
|
||||||
});
|
});
|
||||||
pitchBendEnvelope.reset(midiState.pitchBend);
|
pitchBendEnvelope.reset(midiState.pitchBend);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue