loop: fix the crossfade seam's residual discontinuity, plus six review minors
Normalizes crossfadeWeight over crossfade-1 so the last rendered frame lands at exactly the incoming tap instead of a residual step; corrects the CLAUDE.md invariant and seam test to match. Shares lerpSource/crossfadedSource/maxCrossfade, fixes stale docs/constants, and clears crossfade on the loop-OFF gesture.
This commit is contained in:
@@ -199,9 +199,8 @@ void Voice::start(int note, int velocity, const SampleData& sample, bool declick
|
||||
// seam would put the click back one window into the note.
|
||||
primeBuf_[static_cast<std::size_t>(i)] =
|
||||
(q < frameCount)
|
||||
? crossfadedSource(pcmCh, q,
|
||||
instrument::engine::loop::crossfadeWeight(
|
||||
loop_, static_cast<double>(q)))
|
||||
? crossfadedSource(pcmCh, loop_, q, crossfadeWeight(loop_,
|
||||
static_cast<double>(q)))
|
||||
: 0.0f;
|
||||
++q;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user