From 48de65441be99f085f530a0af9978df70438c409 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Sat, 20 Jun 2020 15:31:48 +0200 Subject: [PATCH] Make getBendInCents actually return cents --- src/sfizz/Region.cpp | 3 +-- src/sfizz/Region.h | 2 +- src/sfizz/Voice.cpp | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/sfizz/Region.cpp b/src/sfizz/Region.cpp index 5084c221..47cf33bd 100644 --- a/src/sfizz/Region.cpp +++ b/src/sfizz/Region.cpp @@ -1225,6 +1225,5 @@ float sfz::Region::getGainToEffectBus(unsigned number) const noexcept float sfz::Region::getBendInCents(float bend) const noexcept { - const auto bendInCents = bend > 0.0f ? bend * static_cast(bendUp) : -bend * static_cast(bendDown); - return centsFactor(bendInCents); + return bend > 0.0f ? bend * static_cast(bendUp) : -bend * static_cast(bendDown); } diff --git a/src/sfizz/Region.h b/src/sfizz/Region.h index 3b09232c..c346949e 100644 --- a/src/sfizz/Region.h +++ b/src/sfizz/Region.h @@ -197,7 +197,7 @@ struct Region { */ float velocityCurve(float velocity) const noexcept; /** - * @brief Get the cents factor for a given bend value between -1 and 1 + * @brief Get the detuning in cents for a given bend value between -1 and 1 * * @param bend * @return float diff --git a/src/sfizz/Voice.cpp b/src/sfizz/Voice.cpp index 204615d6..3d6fe14b 100644 --- a/src/sfizz/Voice.cpp +++ b/src/sfizz/Voice.cpp @@ -821,7 +821,7 @@ void sfz::Voice::pitchEnvelope(absl::Span pitchSpan) noexcept const auto events = resources.midiState.getPitchEvents(); const auto bendLambda = [this](float bend) { - return region->getBendInCents(bend); + return centsFactor(region->getBendInCents(bend)); }; if (region->bendStep > 1)