Share a rng between voices

This commit is contained in:
Roland Rabien 2023-09-29 20:20:07 -07:00
commit cdd3fd99f3
3 changed files with 3 additions and 3 deletions

View file

@ -282,6 +282,7 @@ public:
CurTable curTables[Cfg::numOSCs];
juce::CriticalSection dspLock;
juce::Random rng;
private:
float getSmoothingTime (gin::Parameter*);

View file

@ -63,10 +63,10 @@ void WavetableVoice::noteStarted()
a.noteOn();
for (auto idx = 0; auto& l : modLFOs)
l.noteOn (proc.lfoParams[idx++].retrig->getBoolValue() ? -1 : rng.nextFloat());
l.noteOn (proc.lfoParams[idx++].retrig->getBoolValue() ? -1 : proc.rng.nextFloat());
modStepLFO.reset();
modStepLFO.noteOn (proc.stepLfoParams.retrig->getBoolValue() ? -1 : rng.nextFloat());
modStepLFO.noteOn (proc.stepLfoParams.retrig->getBoolValue() ? -1 : proc.rng.nextFloat());
adsr.reset();
adsr.noteOn();

View file

@ -55,7 +55,6 @@ public:
gin::StereoOscillator::Params noiseParams;
gin::EasedValueSmoother<float> noteSmoother;
juce::Random rng;
float ampKeyTrack = 1.0f;
};