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:
2026-09-09 14:33:21 +02:00
parent 40dc0d4105
commit cd26beca42
4 changed files with 88 additions and 46 deletions
+1 -1
View File
@@ -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;