refactor(osc): support held-note parameter updates without phase reset
Add Oscillator::setParams() which updates detune, pan, and gain for already-initialised sub-voices without resetting their phases. This preserves phase continuity when unison or spread is LFO-modulated at control rate. noteOn() now just seeds phases and delegates to setParams(). Precompute panL/panR in SubVoice instead of calling cos/sin per sample. Add paramsValid and cachedParams to skip redundant work. Replace SynthVoice's lastUnisonA/B tracking with a single oscillatorsNeedNoteOn flag: noteOn sets it, render clears it after the first block. Add SubLevel and NoiseLevel to the per-voice modulation targets so they can be modulated like other parameters.
This commit is contained in:
+1
-1
@@ -87,7 +87,7 @@ private:
|
||||
bool released = false;
|
||||
juce::uint64 noteId = 0;
|
||||
|
||||
int lastUnisonA = 1, lastUnisonB = 1;
|
||||
bool oscillatorsNeedNoteOn = false;
|
||||
|
||||
juce::uint32 seed = 0;
|
||||
float noteRandom = 0.5f;
|
||||
|
||||
Reference in New Issue
Block a user