Skip to content

Commit f34d7d1

Browse files
committed
KeyComparisonEffect: fix instant start and add first-quarter snap
1 parent 7ec2fc9 commit f34d7d1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/effects/backends/builtin/keycomparisoneffect.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,12 @@ void KeyComparisonEffect::processChannel(
263263

264264
if (enableState == EffectEnableState::Enabling) {
265265
if (shouldSync && hasBeatInfo) {
266-
// In sync mode, wait silently for the first beat.
266+
// If the user enabled within the first quarter of a beat they
267+
// were just a split second late — fire immediately so it feels
268+
// like it started on the downbeat. Otherwise wait for the next beat.
269+
const bool justMissedBeat =
270+
*groupFeatures.beat_fraction_buffer_end < 0.25;
271+
pGroupState->m_fireImmediately = justMissedBeat;
267272
pGroupState->m_srcFramePos =
268273
static_cast<double>(pianoSample.size());
269274
pGroupState->framesSinceLastNote = pianoSample.size();

0 commit comments

Comments
 (0)