Skip to content

fixed fret diagram transpose: linking Harmony, enharmonic fallback - #34498

Open
alexpavlov96 wants to merge 1 commit into
musescore:mainfrom
alexpavlov96:fret_diagrams
Open

fixed fret diagram transpose: linking Harmony, enharmonic fallback#34498
alexpavlov96 wants to merge 1 commit into
musescore:mainfrom
alexpavlov96:fret_diagrams

Conversation

@alexpavlov96

@alexpavlov96 alexpavlov96 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

PR eliminates 2 reasons why fret diagram cannot be transposed (empty):
Screenshot 2026-08-07 at 12 32 07 PM

  1. Harmony is stored on the same segment, but not as a child of Fret Diagram
  2. Fret diagram's data for enharmonic names (ex, E#) couldn't be found in the map

vtests: Harmony is moved, because now it's child of fret diagram
Screenshot 2026-08-07 at 11 52 25 AM

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change canonicalizes selected enharmonic TPC values before fret diagram pattern lookup and custom-diagram comparison. It adds FretDiagram::linkSiblingHarmonies to attach standalone same-staff harmonies to fret diagrams without harmonies. The read400, read410, and read460 measure readers invoke this processing. Tests and a MuseScore XML fixture cover enharmonic fallback and sibling harmony linking.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the problem and changes, but it omits the required issue reference and repository checklist. Add a Resolves issue reference, complete the required checklist, and include any relevant testing or prior-attempt details.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies the two main changes: linking Harmony objects and adding enharmonic fallback for fret diagrams.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/muse_framework.git.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@src/engraving/dom/fret.cpp`:
- Around line 841-849: Update isCustom() to canonicalize valid rootTpc and
bassTpc values with canonicalEnharmonicTpc(), matching the normalization already
shown near createHarmonyMapKey. Ensure isCustom("Fbdim7") and isCustom("Am/Fb")
classify standard fallback diagrams correctly, and add regression coverage for
both cases.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c70a647-2a8d-4449-8f37-79b6c8c31a54

📥 Commits

Reviewing files that changed from the base of the PR and between a7860f7 and 10a9c79.

📒 Files selected for processing (7)
  • src/engraving/dom/fret.cpp
  • src/engraving/dom/fret.h
  • src/engraving/rw/read400/measurerw.cpp
  • src/engraving/rw/read410/measureread.cpp
  • src/engraving/rw/read460/measureread.cpp
  • src/engraving/tests/fretdiagram_tests.cpp
  • src/engraving/tests/fretdiagrams_data/sibling_harmony.mscx

Comment thread src/engraving/dom/fret.cpp
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@alexpavlov96 alexpavlov96 added the vtests This PR produces approved changes to vtest results label Aug 7, 2026
@alexpavlov96
alexpavlov96 requested a review from miiizen August 7, 2026 09:34
return m_harmony ? m_harmony->displayText() : String();
}

void FretDiagram::linkSiblingHarmonies(Measure* measure)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This isn't the right way to do this. The user should be able to add as many independent fret diagrams and chord symbols to a segment as they want and we shouldn't try to link them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vtests This PR produces approved changes to vtest results

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants