Files
sizzletracker-android/app/build.gradle.kts
Reactorcoremeltdown 3155caf3cc Fix stuck synth voices: release scaled by sustain level (v0.4.5)
The subtractive synth's amplitude-envelope release decremented at
`(dt / r) * s` — the rate was multiplied by the sustain level, floored
at 0.001. For any percussive patch (sustain≈0: Square Bass, Pulse Pluck,
Noise Perc), release ran ~1000× too slow, so a 0.2 s tail took minutes.
Since a voice's isActive follows its amp envelope, the voice never freed
and kept rendering (3 osc + filter) indefinitely.

That one bug produced all three reported symptoms:
 * missed note-offs / stuck notes needing panic — the note-off fires but
   the voice takes minutes to go silent, reading as ignored;
 * fast-tapping dropouts on every instrument — released-mid-envelope
   voices pile up (whole pool + 8 live audition voices) and CPU climbs
   until the audio callback overruns → xruns;
 * audition-then-play dropouts — audition notes are already stuck on the
   live pool before the sequencer stacks track voices on top.

Release now ramps to zero at a constant 1/r rate, reaching silence
within r seconds from any level (matching SampleVoice's behaviour). The
Sampler/SoundFont path already captured its release rate at note-off, so
it was less affected — but the shared synth voice pinned the CPU budget,
which is why the stutter showed across all instruments.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 02:04:14 +02:00

5.0 KiB