Skip to content

[4.7.5] Fix incorrect masking behind pitch name noteheads when they revert to default - #34244

Closed
Jojo-Schmitz wants to merge 2195 commits into
musescore:4.7from
Jojo-Schmitz:4.7-named-noteheads
Closed

Jojo-Schmitz wants to merge 2195 commits into
musescore:4.7from
Jojo-Schmitz:4.7-named-noteheads

Conversation

@Jojo-Schmitz

Copy link
Copy Markdown
Contributor

Resolves: #34229
Backport of #34242

miiizen and others added 30 commits June 30, 2026 16:01
as long as it is multi-line text
RemoveNoteParenthesisInfo and RemoveElement were both being used and taking ownership of the Parenthesis object leading to 2 deletes on closing the score
…mation

Automation - fix assertion when opening empty score page
…onts

Fix finding external Musical Text Fonts and their metadata.json files
…data-parameter

Remove `EditData` parameter from undo/redo methods
- fixes shared libraries search paths on linux
- fixes local debug builds on windows
- improves warnings handling
Allow framed texts' frames to not demand width greater than  (or equal to) height
…dth as a property instead of casting the StyledTabButton tabBar.
…e PropertiesPanelTabBar. Protect truncatedItemWidth computation against negative values.
RomanPudashkin and others added 20 commits July 15, 2026 19:21
…wing and steal-time-previous attributes (if present)
Automation: fix curve rendering, interaction, and sync issues
…rty using getProperty and setProperty instead of getting it through visible() (to ensure that they both go through property delegates, if any)
Fix musicXML imports containing start-end repeat barlines from Noteflight
MusicXML import: tighten the assumption of grace-after notes based on slurs
Fix spanners' `visible` property propagation to new segments in Spanner::add()
Add notehead schemes for pitch names without alterations
@Jojo-Schmitz Jojo-Schmitz changed the title Fix incorrect masking behind pitch name noteheads when they revert to default [4.7.5] Fix incorrect masking behind pitch name noteheads when they revert to default Jul 17, 2026
@Jojo-Schmitz
Jojo-Schmitz force-pushed the 4.7-named-noteheads branch from 5954519 to 1f8a0d6 Compare July 17, 2026 10:39
@Jojo-Schmitz
Jojo-Schmitz changed the base branch from main to 4.7 July 17, 2026 10:41
@Jojo-Schmitz
Jojo-Schmitz force-pushed the 4.7-named-noteheads branch from 1f8a0d6 to 08d04d7 Compare July 17, 2026 10:42
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Extended Note::noteHead pitch-name scheme handling for TPCs representing double and triple accidentals. These values now select the corresponding natural notehead groups for degrees A–G, with German notation retaining its special handling for B-related degrees.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only lists the issue and backport; it omits the required summary and checklist items from the template. Add a short change summary and complete the template checklist items, including CLA, testing, and unnecessary-changes review.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the bug fix and matches the pitch-name notehead fallback change.
Linked Issues check ✅ Passed The code change matches #34229 by handling unsupported pitch-name noteheads and preserving German special-casing.
Out of Scope Changes check ✅ Passed The change is confined to note.cpp and aligns with the stated pitch-name notehead fallback fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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

🧹 Nitpick comments (1)
src/engraving/dom/note.cpp (1)

468-499: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider using a switch statement for TPC mapping.

The if-else if chain for mapping TPCs to notehead groups has grown quite large. Converting the entire block (lines 351-500) into a switch (tpc) statement would improve readability and slightly improve execution performance.

🤖 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 `@src/engraving/dom/note.cpp` around lines 468 - 499, Convert the complete
TPC-to-notehead-group mapping block in the surrounding notehead-group selection
function into a switch statement on tpc. Add cases for each existing Tpc value,
preserve the german-specific B/B-sharp handling and all current group
assignments, and retain the existing fallback behavior.
🤖 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/note.cpp`:
- Around line 488-489: Update the TPC_B_BB and TPC_B_BBB branch in the note-head
grouping logic to assign NoteHeadGroup::HEAD_H instead of HEAD_B, matching the
German notation fallback used for TPC_B_SS.

---

Nitpick comments:
In `@src/engraving/dom/note.cpp`:
- Around line 468-499: Convert the complete TPC-to-notehead-group mapping block
in the surrounding notehead-group selection function into a switch statement on
tpc. Add cases for each existing Tpc value, preserve the german-specific
B/B-sharp handling and all current group assignments, and retain the existing
fallback behavior.
🪄 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: d47a9daf-3cbf-4cfb-921a-3013070c5fe9

📥 Commits

Reviewing files that changed from the base of the PR and between 4d3e04e and 1f8a0d62bb2bffdea9972da2fa59830672469224.

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

Comment thread src/engraving/dom/note.cpp Outdated
Comment on lines +488 to +489
} else if (tpc == Tpc::TPC_B_BB || tpc == Tpc::TPC_B_BBB) {
group = NoteHeadGroup::HEAD_B;

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Handle German notation for B double/triple flats.

In German notation, B double flat is "Heses", which derives from the base note "H" (B natural). When stripping accidentals for these unsupported TPCs, the group should fall back to HEAD_H instead of HEAD_B. The current code maps to HEAD_B unconditionally, which is inconsistent with the handling of TPC_B_SS on lines 470-475.

🐛 Proposed fix
-        } else if (tpc == Tpc::TPC_B_BB || tpc == Tpc::TPC_B_BBB) {
-            group = NoteHeadGroup::HEAD_B;
+        } else if (tpc == Tpc::TPC_B_BB || tpc == Tpc::TPC_B_BBB) {
+            if (german) {
+                group = NoteHeadGroup::HEAD_H;
+            } else {
+                group = NoteHeadGroup::HEAD_B;
+            }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} else if (tpc == Tpc::TPC_B_BB || tpc == Tpc::TPC_B_BBB) {
group = NoteHeadGroup::HEAD_B;
} else if (tpc == Tpc::TPC_B_BB || tpc == Tpc::TPC_B_BBB) {
if (german) {
group = NoteHeadGroup::HEAD_H;
} else {
group = NoteHeadGroup::HEAD_B;
}
🤖 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 `@src/engraving/dom/note.cpp` around lines 488 - 489, Update the TPC_B_BB and
TPC_B_BBB branch in the note-head grouping logic to assign NoteHeadGroup::HEAD_H
instead of HEAD_B, matching the German notation fallback used for TPC_B_SS.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right you are! Will get fixed in #34245 and #34242

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.

Incorrect masking behind pitch name noteheads when they revert to default