mirror of
https://codeberg.org/armin/wavetable.git
synced 2026-09-01 05:50:46 +02:00
Share a rng between voices
This commit is contained in:
parent
2ee96c80fb
commit
cdd3fd99f3
3 changed files with 3 additions and 3 deletions
|
|
@ -282,6 +282,7 @@ public:
|
||||||
CurTable curTables[Cfg::numOSCs];
|
CurTable curTables[Cfg::numOSCs];
|
||||||
|
|
||||||
juce::CriticalSection dspLock;
|
juce::CriticalSection dspLock;
|
||||||
|
juce::Random rng;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float getSmoothingTime (gin::Parameter*);
|
float getSmoothingTime (gin::Parameter*);
|
||||||
|
|
|
||||||
|
|
@ -63,10 +63,10 @@ void WavetableVoice::noteStarted()
|
||||||
a.noteOn();
|
a.noteOn();
|
||||||
|
|
||||||
for (auto idx = 0; auto& l : modLFOs)
|
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.reset();
|
||||||
modStepLFO.noteOn (proc.stepLfoParams.retrig->getBoolValue() ? -1 : rng.nextFloat());
|
modStepLFO.noteOn (proc.stepLfoParams.retrig->getBoolValue() ? -1 : proc.rng.nextFloat());
|
||||||
|
|
||||||
adsr.reset();
|
adsr.reset();
|
||||||
adsr.noteOn();
|
adsr.noteOn();
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@ public:
|
||||||
gin::StereoOscillator::Params noiseParams;
|
gin::StereoOscillator::Params noiseParams;
|
||||||
|
|
||||||
gin::EasedValueSmoother<float> noteSmoother;
|
gin::EasedValueSmoother<float> noteSmoother;
|
||||||
juce::Random rng;
|
|
||||||
|
|
||||||
float ampKeyTrack = 1.0f;
|
float ampKeyTrack = 1.0f;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue