Skip to content

feat(editor): point users at Tempo Map when an import drifts from the audio - #82

Merged
byrongamatos merged 2 commits into
mainfrom
feat/tempo-map-discoverability
Jul 5, 2026
Merged

feat(editor): point users at Tempo Map when an import drifts from the audio#82
byrongamatos merged 2 commits into
mainfrom
feat/tempo-map-discoverability

Conversation

@ChrisBeWithYou

@ChrisBeWithYou ChrisBeWithYou commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Why

The community keeps hitting this: import a Guitar Pro tab + audio, and the chart starts synced but drifts (falls behind, catches up, gets ahead) — worst around section / time-signature changes. That's largely inherent: auto-sync interpolates between sync points, and a human performance never sits on one BPM. The editor already has the fix — an EOF-style Tempo Map editor (drag the measure sync points to fit the audio, set per-measure BPM + time signature, insert/delete points, choose whether all notes or just drums re-time). But nobody finds it — in the field the reaction is literally "surprised you can't edit the beatmap."

This is the discoverability fix, delivered at the moment it's needed.

What

  • Post-import status names the tool. After an audio-synced GP import, both outcomes now point at it:
    • warp: "Imported with per-bar audio sync. Drifting from the recording? Open 🎵 Tempo Map to drag the beat grid onto the audio."
    • offset fallback (GP3/4/5 repeats/jumps, degenerate anchors): the existing "applied start offset only" note + the same Tempo Map pointer.
  • Toolbar button tooltip now says what it's for: "…fix a chart drifting from the audio — drag the beat grid, edit BPM & time signatures."
  • No change to the import or the Tempo Map editor — pure discoverability. The message is extracted to a pure _syncAppliedMessagePure so it's unit-tested.

Not in scope (deliberately)

Whether there's a genuine time-signature bug on top of the inherent sparse-anchor drift (some users report 2/4-amid-4/4 bars throwing it off) — that needs a repro to confirm and is a separate change. This PR just makes the existing manual fix findable.

Tests

tests/tempo_map_guidance.test.js — 4 new cases (warp / offset-repeats / offset-other / no-sync). All 25 editor JS test files pass; node --check clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UR2Cr7GEu3yMY7SrfxH6c1

Summary by CodeRabbit

  • Bug Fixes
    • Improved Guitar Pro import completion status messages by generating clearer, more specific guidance when timing drift is detected, including cases for both per-bar sync and offset fallback behavior.
    • Updated guidance copy to direct users to correct drift via the Tempo Map when the imported audio sync can’t be applied as expected.
  • Documentation
    • Added an Unreleased guidance entry in the changelog, and expanded the Tempo Map tooltip to mention dragging the beat grid and editing BPM/time signatures.

… audio

Auto-sync can only approximate a human performance between sync points, so an
imported GP chart often starts aligned and then drifts -- and the #1 confusion in
the field is not realizing the beatmap is editable at all. The Tempo Map editor
(drag sync points, per-measure BPM + time signature, insert/delete, drum-vs-all
ride scope) already exists, but nobody finds it ("surprised you can't edit the
beatmap").

Make the fix discoverable at the moment it's needed: the post-import status now
names it for both the per-bar 'warp' and the scalar 'offset' fallback
(repeats/jumps, degenerate anchors), ending with "Drifting from the recording?
Open Tempo Map to drag the beat grid onto the audio." The toolbar button tooltip
now reads "...fix a chart drifting from the audio -- drag the beat grid, edit BPM
& time signatures."

No change to the import or the Tempo Map editor itself. The message is extracted
to the pure _syncAppliedMessagePure so it's unit-tested. All 25 editor JS test
files pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UR2Cr7GEu3yMY7SrfxH6c1
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9823fea0-ef47-4fed-9c0e-7477d5b0d028

📥 Commits

Reviewing files that changed from the base of the PR and between 2a27fac and 386341d.

📒 Files selected for processing (1)
  • CHANGELOG.md

📝 Walkthrough

Walkthrough

Introduces a pure helper for GP import sync status messaging, wires it into the import flow, updates the Tempo Map tooltip, and adds tests plus a changelog note.

Changes

Tempo Map guidance messaging

Layer / File(s) Summary
Pure helper and call site integration
screen.js
Adds _syncAppliedMessagePure(sync_applied, sync_reason) and replaces inline warp/offset conditional logic in the GP import completion flow.
Tooltip and changelog update
screen.js, CHANGELOG.md
Updates the Tempo Map button tooltip to reference dragging the beat grid and editing BPM/time signatures; updates the changelog Unreleased→Changed entry accordingly.
Test coverage for helper
tests/tempo_map_guidance.test.js
Exposes _syncAppliedMessagePure via the test API factory and adds tests for warp, offset (mode-specific and generic), and empty-input cases.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ScreenJS as editorDoCreate
  participant API as convert-gp API
  participant Helper as _syncAppliedMessagePure

  User->>ScreenJS: Import Guitar Pro file
  ScreenJS->>API: POST /api/plugins/editor/convert-gp
  API-->>ScreenJS: sync_applied, sync_reason
  ScreenJS->>Helper: _syncAppliedMessagePure(sync_applied, sync_reason)
  Helper-->>ScreenJS: status message or ''
  ScreenJS-->>User: Display status (if non-empty)
Loading

Possibly related PRs

  • got-feedBack/feedBack-plugin-editor#71: The _syncAppliedMessagePure logic directly consumes the sync_applied/sync_reason values (warp vs offset) computed by the convert-gp behavior introduced there.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main user-facing change: guiding users to Tempo Map when imported audio drifts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tempo-map-discoverability

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
CHANGELOG.md (1)

56-62: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Orphaned/malformed changelog entry.

The new Tempo Map bullet at Line 56 ends cleanly with the test reference, but Line 57 immediately continues with unrelated, mid-sentence text — "centre line), which hid the signal's actual shape and went blocky on zoom." — that clearly belongs to the previous waveform-envelope entry. This entry's own bullet title/opening appears to have been overwritten by the new insertion, leaving orphaned continuation text with no heading, which corrupts the rendered changelog.

Suggested fix
 ### Changed
-- **Point people at Tempo Map when an import drifts from the audio.** Auto-sync can only approximate a *human* performance between sync points, so an imported chart often starts aligned and then drifts (falls behind / gets ahead) — and the `#1` confusion in the field is not realizing the **beatmap is editable at all**. The post-import status now names the fix in both cases: per-bar `warp` and the scalar `offset` fallback (GP3/4/5 repeats/jumps, degenerate anchors) each end with *"Drifting from the recording? Open 🎵 Tempo Map to drag the beat grid onto the audio."*, and the toolbar button's tooltip now reads "…fix a chart drifting from the audio — drag the beat grid, edit BPM & time signatures." No behavior change to the import itself; the Tempo Map editor (drag sync points, per-measure BPM + time signature, insert/delete, drum-vs-all ride scope) already existed. Tests: `tests/tempo_map_guidance.test.js` (`_syncAppliedMessagePure`).
-  centre line), which hid the signal's actual shape and went blocky on zoom.
-  It now renders the true signed **min→max peak envelope** with a brighter
-  **RMS body** inside it (Audacity-style), built from a high-resolution
-  per-bin min/max/RMS cache (~3 ms/bin) and aggregated per pixel column so the
-  shape stays sharp at any zoom. Same lane, same seek behaviour — no layout or
-  API change. Pure helper `_buildWaveformPeaks` covered by tests.
+- **Point people at Tempo Map when an import drifts from the audio.** Auto-sync can only approximate a *human* performance between sync points, so an imported chart often starts aligned and then drifts (falls behind / gets ahead) — and the `#1` confusion in the field is not realizing the **beatmap is editable at all**. The post-import status now names the fix in both cases: per-bar `warp` and the scalar `offset` fallback (GP3/4/5 repeats/jumps, degenerate anchors) each end with *"Drifting from the recording? Open 🎵 Tempo Map to drag the beat grid onto the audio."*, and the toolbar button's tooltip now reads "…fix a chart drifting from the audio — drag the beat grid, edit BPM & time signatures." No behavior change to the import itself; the Tempo Map editor (drag sync points, per-measure BPM + time signature, insert/delete, drum-vs-all ride scope) already existed. Tests: `tests/tempo_map_guidance.test.js` (`_syncAppliedMessagePure`).
+- **Waveform lane now renders a true peak envelope instead of a flat
+  centre line**, which hid the signal's actual shape and went blocky on zoom.
+  It now renders the true signed **min→max peak envelope** with a brighter
+  **RMS body** inside it (Audacity-style), built from a high-resolution
+  per-bin min/max/RMS cache (~3 ms/bin) and aggregated per pixel column so the
+  shape stays sharp at any zoom. Same lane, same seek behaviour — no layout or
+  API change. Pure helper `_buildWaveformPeaks` covered by tests.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CHANGELOG.md` around lines 56 - 62, The changelog entry is malformed because
the new Tempo Map note in CHANGELOG.md is followed by leftover continuation text
from the waveform-envelope entry, leaving an orphaned sentence with no heading.
Reconstruct the two adjacent bullets so the Tempo Map item ends cleanly after
the `_syncAppliedMessagePure` test reference, and move the waveform-related
sentence back under its own `_buildWaveformPeaks` entry with its original
heading. Keep the surrounding changelog text readable and ensure each entry is
self-contained.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@CHANGELOG.md`:
- Around line 56-62: The changelog entry is malformed because the new Tempo Map
note in CHANGELOG.md is followed by leftover continuation text from the
waveform-envelope entry, leaving an orphaned sentence with no heading.
Reconstruct the two adjacent bullets so the Tempo Map item ends cleanly after
the `_syncAppliedMessagePure` test reference, and move the waveform-related
sentence back under its own `_buildWaveformPeaks` entry with its original
heading. Keep the surrounding changelog text readable and ensure each entry is
self-contained.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c62c61a9-55e4-44c0-b54f-7efe5e160605

📥 Commits

Reviewing files that changed from the base of the PR and between 5d60b11 and 2a27fac.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • screen.js
  • tests/tempo_map_guidance.test.js

The Tempo Map discoverability bullet was pasted over the 'real waveform' entry's
header + first sentence. Restore the waveform entry and keep the Tempo Map note
as its own bullet.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@byrongamatos
byrongamatos merged commit 347d8b8 into main Jul 5, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants