Skip to content

Fix transposition of chord symbols in parts#33771

Open
miiizen wants to merge 3 commits into
musescore:mainfrom
miiizen:33339-chordTransposition
Open

Fix transposition of chord symbols in parts#33771
miiizen wants to merge 3 commits into
musescore:mainfrom
miiizen:33339-chordTransposition

Conversation

@miiizen

@miiizen miiizen commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Resolves: #33339
Resolves: #30746
Resolves: #32901

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f105c3b8-657d-4f14-88a6-b4f06ba845f3

📥 Commits

Reviewing files that changed from the base of the PR and between f4e0473 and 90f20a9.

📒 Files selected for processing (1)
  • src/engraving/dom/excerpt.cpp

📝 Walkthrough

Walkthrough

This PR adds TextBase::textWasEdited(EditData&) and uses it in TextBase::endEdit and PlayCountText::endEdit. Harmony::endEdit now skips when text wasn't changed and applies linked-harmony transpositions via undoable Transpose commands (with command merging). Transpose gained reusable doUndoTransposeHarmony/doUndoTransposeHarmonyDiatonic helpers used by undo flips. Excerpt cloning now invokes transpose logic when copying harmonies between scores with differing concert-pitch settings.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description lists three resolved issues (#33339, #30746, #32901) but lacks detailed implementation description, testing notes, and checklist completion as required by the repository template. Complete the PR description template: add motivation/implementation details, check all CLA/code quality items, and confirm manual testing and unit tests were completed.
Docstring Coverage ⚠️ Warning Docstring coverage is 21.05% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix transposition of chord symbols in parts' clearly describes the main change: addressing transposition issues for chord symbols when working with musical parts.
Linked Issues check ✅ Passed The code changes implement fixes for all three linked issues: #33339 (repetitive transposition via textWasEdited check), #30746 (custom parts transposition via excerpt.cpp), and #32901 (correct transposed display via harmony transposition refactoring).
Out of Scope Changes check ✅ Passed All changes are directly related to fixing chord symbol transposition in parts: textWasEdited extraction, harmony transposition refactoring, and excerpt cloning logic align with the three linked issue objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Linked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. 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 and usage tips.

@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/excerpt.cpp`:
- Around line 872-883: Change transposeHarmony so cloned harmonies are skipped
when no transposition is required and compute the transposition interval using
the instrument in effect at the harmony's tick instead of the part default: if
the Harmony is a clone (e.g., harmony->isCloned() or harmony->cloned() flag) and
needsTransposition is false, return immediately; obtain the instrument active at
the harmony tick (e.g., via Staff::instrumentAt(harmony->tick()) or
Part::instrumentAt) and use its transpose() to build the Interval (fall back to
part()->instrument() only if needed); then apply the flip when
!scoreConcertPitch and call Transpose::doUndoTransposeHarmony(harmony,
interval).
🪄 Autofix (Beta)

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

Run ID: d49cd5e2-7537-44e9-985f-dad1e4ef41c5

📥 Commits

Reviewing files that changed from the base of the PR and between 48746b6 and f4e0473.

📒 Files selected for processing (3)
  • src/engraving/dom/excerpt.cpp
  • src/engraving/editing/transpose.cpp
  • src/engraving/editing/transpose.h

Comment thread src/engraving/dom/excerpt.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants