Also make pitch_random real-valued
This commit is contained in:
parent
283a7a39c7
commit
afc0b3fc56
3 changed files with 4 additions and 4 deletions
|
|
@ -199,8 +199,8 @@ namespace Default
|
||||||
constexpr uint8_t pitchKeycenter { 60 };
|
constexpr uint8_t pitchKeycenter { 60 };
|
||||||
constexpr int pitchKeytrack { 100 };
|
constexpr int pitchKeytrack { 100 };
|
||||||
constexpr Range<int> pitchKeytrackRange { -1200, 1200 };
|
constexpr Range<int> pitchKeytrackRange { -1200, 1200 };
|
||||||
constexpr int pitchRandom { 0 };
|
constexpr float pitchRandom { 0 };
|
||||||
constexpr Range<int> pitchRandomRange { 0, 9600 };
|
constexpr Range<float> pitchRandomRange { 0, 9600 };
|
||||||
constexpr int pitchVeltrack { 0 };
|
constexpr int pitchVeltrack { 0 };
|
||||||
constexpr Range<int> pitchVeltrackRange { -9600, 9600 };
|
constexpr Range<int> pitchVeltrackRange { -9600, 9600 };
|
||||||
constexpr int transpose { 0 };
|
constexpr int transpose { 0 };
|
||||||
|
|
|
||||||
|
|
@ -1714,7 +1714,7 @@ float sfz::Region::getBasePitchVariation(float noteNumber, float velocity) const
|
||||||
{
|
{
|
||||||
ASSERT(velocity >= 0.0f && velocity <= 1.0f);
|
ASSERT(velocity >= 0.0f && velocity <= 1.0f);
|
||||||
|
|
||||||
std::uniform_int_distribution<int> pitchDistribution { -pitchRandom, pitchRandom };
|
fast_real_distribution<float> pitchDistribution { -pitchRandom, pitchRandom };
|
||||||
auto pitchVariationInCents = pitchKeytrack * (noteNumber - pitchKeycenter); // note difference with pitch center
|
auto pitchVariationInCents = pitchKeytrack * (noteNumber - pitchKeycenter); // note difference with pitch center
|
||||||
pitchVariationInCents += tune; // sample tuning
|
pitchVariationInCents += tune; // sample tuning
|
||||||
pitchVariationInCents += config::centPerSemitone * transpose; // sample transpose
|
pitchVariationInCents += config::centPerSemitone * transpose; // sample transpose
|
||||||
|
|
|
||||||
|
|
@ -409,7 +409,7 @@ struct Region {
|
||||||
uint8_t pitchKeycenter { Default::pitchKeycenter }; // pitch_keycenter
|
uint8_t pitchKeycenter { Default::pitchKeycenter }; // pitch_keycenter
|
||||||
bool pitchKeycenterFromSample { false };
|
bool pitchKeycenterFromSample { false };
|
||||||
int pitchKeytrack { Default::pitchKeytrack }; // pitch_keytrack
|
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 pitchVeltrack { Default::pitchVeltrack }; // pitch_veltrack
|
||||||
int transpose { Default::transpose }; // transpose
|
int transpose { Default::transpose }; // transpose
|
||||||
int tune { Default::tune }; // tune
|
int tune { Default::tune }; // tune
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue