Skip to content

[Metronome] Adaptive debounce for ictus detection at high BPM #28

Description

@hakaru

問題

`ConductorMotionActor.debounceNs = 200_000_000` (200ms) が固定で、高BPMでビート取りこぼしが発生する。

計算

BPM 拍間隔 200ms debounce の余裕
300 200ms 0ms(上限と一致、取りこぼし必至)
240 250ms 50ms のみ
180 333ms 133ms

300 BPM で振れないのは UX 的に問題。合奏で速いパッセージに対応できない。

改善方針

直近の拍間隔に基づく adaptive refractory:

```swift
let currentInterval = ... // 前2拍から推定
let refractory = max(80_000_000, min(currentInterval * 45 / 100, 200_000_000))
```

  • 下限 80ms(生理的な速さの限界)
  • 最新 interval の 45% をデフォルト
  • 上限 200ms(cold start 用)

重要度

Medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions