Skip to content

단노트 길이 일관성 유지 활성화 시 롱노트 끝부분이 threshold만큼 짧게 표시되는 버그 #78

@engp114

Description

@engp114

버그 설명

단노트 길이 일관성 유지 기능을 활성화한 상태에서 노트 이펙트를 사용할 때, 오버레이에 표시되는 롱노트의 끝부분이 단노트 구분 시간 (threshold) 만큼 짧게 표시되는 문제가 있습니다.

단노트 길이 일관성 유지 기능을 활성화하면 단노트와 롱노트를 구분하기 위해 keydown 직후 즉시 노트를 생성하지 않고, threshold만큼 기다린 뒤 노트를 표시합니다.
하지만 현재 구현에서는 롱노트를 표시할 때 시작 시점만 threshold만큼 지연되고, keyup 시점에는 즉시 종료 처리됩니다.

그 결과 실제 키 입력 시간보다 오버레이에 표시되는 롱노트의 길이가 짧아집니다.

버그 시연

세팅

  • 단노트 최소 길이: 18
  • 단노트 구분 시간: 150
  • 키 표시 지연: 650

영상

2026-06-10.20-41-48.mp4

원인

useNoteSystem.tsscheduleNoteFinalization()에서 delayed mode의 롱노트 종료 시간을 계산할 때, 실제 keydown 시각이 아니라 지연 후 생성된 노트의 startTime을 기준으로 duration을 계산하고 있습니다.

현재 delayed mode에서는 노트 생성 시점이 다음처럼 보정됩니다.

const overrideStart = state.downTime! + state.delayMs!;
createNote(keyName, overrideStart);
state.startTime = overrideStart;

하지만 종료 계산에서는 state.startTime 이후부터 keyup까지의 시간만 표시 길이로 사용됩니다.

const baselineStart =
  noteRef?.startTime ?? state.startTime ?? state.downTime ?? releaseTime;

const holdDurationFromStart = Math.max(0, releaseTime - clampedStart);
const targetEndTime = state.startTime + safeDuration;

이 경우 delayed mode의 롱노트는 실질적으로 다음과 같이 계산됩니다.

targetEndTime = releaseTime

따라서 표시 시작은 늦어졌지만 종료는 늦어지지 않아, 전체 표시 길이가 threshold만큼 짧아집니다.

해결 방안

delayed mode 활성화 상태에서 롱노트는 실제 키 입력 유지 시간, 즉 releaseTime - downTime을 기준으로 표시 길이를 계산합니다.

const desiredDuration = (() => {
  if (forceMinLength) {
    return minLengthMs;
  }

  if (state.useDelay && state.downTime != null) {
    // 롱노트 지연 표시 보정: 롱노트 시작을 threshold만큼 늦추었으므로 롱노트 종료도 동일하게 늦춤
    const physicalHoldDuration = Math.max(0, releaseTime - state.downTime);
    return Math.max(minLengthMs, physicalHoldDuration);
  }

  return Math.max(minLengthMs, holdDurationFromStart);
})();

이렇게 하면 delayed mode에서 롱노트 종료 시각은 다음과 같이 계산됩니다.

targetEndTime = state.startTime + (releaseTime - state.downTime)

그리고 state.startTime = state.downTime + threshold이므로:

targetEndTime = releaseTime + threshold

즉 롱노트의 시작과 종료가 동일하게 지연되어, 실제 입력 길이와 표시 길이가 일관되게 유지됩니다.

테스트

2026-06-10.20-38-54.mp4

수정 범위

  • src/renderer/hooks/overlay/useNoteSystem.ts

    • scheduleNoteFinalization()의 desiredDuration 계산 보정

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions