add per-oscillator detune (detune1); fix ASR attack handoff

This commit is contained in:
Armin 2026-09-10 02:25:20 +02:00
commit 2a79067a1c
5 changed files with 21 additions and 11 deletions

View file

@ -125,7 +125,8 @@ void SynthEngine::render (const VParams& p, float* left, float* right, int num)
const float glideRate = p.glide <= 0.001f ? 1.0f
: 1.0f - std::exp (-1.0f / (p.glide * (float) sr));
const float detuneRatio = std::exp2f (p.detune / 1200.0f);
const float detuneRatio2 = std::exp2f (p.detune / 1200.0f);
const float detuneRatio1 = std::exp2f (p.detune1 / 1200.0f);
const float tuneRatio = std::exp2f (p.tune / 12.0f);
const float maxFc = 0.4f * (float) sr;
const float minFc = 30.0f;
@ -175,8 +176,8 @@ void SynthEngine::render (const VParams& p, float* left, float* right, int num)
bendSmooth += (bendCents - bendSmooth) * 0.08f;
freq *= std::exp2f (bendSmooth / 1200.0f);
const float d1 = (float) (freq / sr);
const float d2 = d1 * detuneRatio;
const float d1 = (float) (freq / sr) * detuneRatio1;
const float d2 = (float) (freq / sr) * detuneRatio2;
v.ph1 += d1; if (v.ph1 >= 1.0) v.ph1 -= 1.0;
v.ph2 += d2; if (v.ph2 >= 1.0) v.ph2 -= 1.0;