Corrected a bug where the pitch shift due to the note displacement with respect to the key center was applied twice

This commit is contained in:
Paul Ferrand 2019-12-13 13:20:20 +01:00
parent 87ee6e1d74
commit bfb9b80724

View file

@ -104,7 +104,7 @@ void sfz::Voice::startVoice(Region* region, int delay, int channel, int number,
sourcePosition = region->getOffset();
initialDelay = delay + static_cast<uint32_t>(region->getDelay() * sampleRate);
baseFrequency = midiNoteFrequency(number) * pitchRatio;
baseFrequency = midiNoteFrequency(number);
prepareEGEnvelope(initialDelay, value);
}
@ -463,6 +463,7 @@ void sfz::Voice::fillWithGenerator(AudioSpan<float> buffer) noexcept
pitchBendEnvelope.getQuantizedBlock(bends, region->bendStep);
else
pitchBendEnvelope.getBlock(bends);
applyGain<float>(bends, jumps);
jumps[0] += phase;
cumsum<float>(jumps, phases);