diff --git a/src/sfizz/Defaults.h b/src/sfizz/Defaults.h index e0ba851b..540b6944 100644 --- a/src/sfizz/Defaults.h +++ b/src/sfizz/Defaults.h @@ -199,8 +199,8 @@ namespace Default constexpr uint8_t pitchKeycenter { 60 }; constexpr int pitchKeytrack { 100 }; constexpr Range pitchKeytrackRange { -1200, 1200 }; - constexpr int pitchRandom { 0 }; - constexpr Range pitchRandomRange { 0, 9600 }; + constexpr float pitchRandom { 0 }; + constexpr Range pitchRandomRange { 0, 9600 }; constexpr int pitchVeltrack { 0 }; constexpr Range pitchVeltrackRange { -9600, 9600 }; constexpr int transpose { 0 }; diff --git a/src/sfizz/Region.cpp b/src/sfizz/Region.cpp index 7d69d202..ee01cccc 100644 --- a/src/sfizz/Region.cpp +++ b/src/sfizz/Region.cpp @@ -1714,7 +1714,7 @@ float sfz::Region::getBasePitchVariation(float noteNumber, float velocity) const { ASSERT(velocity >= 0.0f && velocity <= 1.0f); - std::uniform_int_distribution pitchDistribution { -pitchRandom, pitchRandom }; + fast_real_distribution pitchDistribution { -pitchRandom, pitchRandom }; auto pitchVariationInCents = pitchKeytrack * (noteNumber - pitchKeycenter); // note difference with pitch center pitchVariationInCents += tune; // sample tuning pitchVariationInCents += config::centPerSemitone * transpose; // sample transpose diff --git a/src/sfizz/Region.h b/src/sfizz/Region.h index fabe91c4..76840c53 100644 --- a/src/sfizz/Region.h +++ b/src/sfizz/Region.h @@ -409,7 +409,7 @@ struct Region { uint8_t pitchKeycenter { Default::pitchKeycenter }; // pitch_keycenter bool pitchKeycenterFromSample { false }; int pitchKeytrack { Default::pitchKeytrack }; // pitch_keytrack - int pitchRandom { Default::pitchRandom }; // pitch_random + float pitchRandom { Default::pitchRandom }; // pitch_random int pitchVeltrack { Default::pitchVeltrack }; // pitch_veltrack int transpose { Default::transpose }; // transpose int tune { Default::tune }; // tune