Skip to content

[MusicXML] improve export of tablature#33903

Open
rettinghaus wants to merge 5 commits into
musescore:mainfrom
rettinghaus:xml/tabvis
Open

[MusicXML] improve export of tablature#33903
rettinghaus wants to merge 5 commits into
musescore:mainfrom
rettinghaus:xml/tabvis

Conversation

@rettinghaus

Copy link
Copy Markdown
Contributor

This PR makes sure that for tablature invisble notations, like all key signatures always, in some cases times signatures, rests, etc., are correctly marked with print-object="no".

@coderabbitai

coderabbitai Bot commented Jun 22, 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: 37521877-31d0-45e3-85ab-e64b0160393d

📥 Commits

Reviewing files that changed from the base of the PR and between cca88ac and 52da3c2.

📒 Files selected for processing (2)
  • src/importexport/musicxml/internal/export/exportmusicxml.cpp
  • src/importexport/musicxml/tests/data/testHarmony7_ref.xml
✅ Files skipped from review due to trivial changes (1)
  • src/importexport/musicxml/tests/data/testHarmony7_ref.xml
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/importexport/musicxml/internal/export/exportmusicxml.cpp

📝 Walkthrough

Walkthrough

The MusicXML export logic in ExportMusicXml is updated to derive visibility of <key>, <time>, rest <note>, and <clef> elements from staff-type settings rather than external parameters. The keysig() method signature removes the visible parameter and now internally queries isTabStaff() and KeySig::visible(). Time signature suppression is extended to check genTimesig(), rest suppression checks showRests on tab staves, and clef suppression checks genClef() in two export paths. writeStaffDetails() gains show-frets="letters" for letter-fret tab staves. keysigTimesig() is updated to evaluate shared key/time eligibility across staves and marks fallback tick=0 key signatures invisible on tab staves. Existing reference XML test fixtures are updated to reflect print-object="no" on affected elements, and a new testTabs fixture with five tablature and pitched parts is added along with a tablature6 test case.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is minimal and does not follow the required template structure. Required checklist items are missing, no issue reference is provided, and commit messages are not documented. Complete the template by adding an issue reference (Resolves: #NNNNN), CLA confirmation, commit message descriptions, and checking all applicable checklist items per repository requirements.
Docstring Coverage ⚠️ Warning Docstring coverage is 70.00% 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 '[MusicXML] improve export of tablature' directly describes the main purpose of the PR, which is to improve how tablature is exported in MusicXML format.
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.

✏️ 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: 2

🤖 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/importexport/musicxml/internal/export/exportmusicxml.cpp`:
- Around line 2208-2209: The current condition in the timesig visibility check
at line 2208-2209 applies staff 0's visibility to all staffs when merging
signatures into a single unnumbered export, which causes incorrect visibility
for mixed standard+tab parts with different visibility settings. Modify the
logic to detect when staff print visibility or genTimesig() settings differ
across staffs and force per-staff numbered exports in those cases instead of
merging them. This should also apply to the C-major fallback key signature
export path to ensure consistency across all signature export paths when staff
0's tab visibility does not represent all staves.
- Line 2448: The condition checking ks->staff()->isTabStaff() on line 2448 uses
a hardcoded tick value of Fraction(0, 1) instead of the key signature's actual
tick position, causing key signatures after staff-type changes to inherit
incorrect visibility. Replace the hardcoded Fraction(0, 1) argument with
ks->tick() to use the key signature's own tick when determining tab staff
visibility, consistent with how time signature, rest, and clef checks handle
staff-type visibility.
🪄 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: 7d496064-5a3d-4547-876f-9e8d02cacb36

📥 Commits

Reviewing files that changed from the base of the PR and between 9fa3891 and 5f9b86a.

📒 Files selected for processing (14)
  • src/importexport/musicxml/internal/export/exportmusicxml.cpp
  • src/importexport/musicxml/tests/data/testGuitarBends_ref.xml
  • src/importexport/musicxml/tests/data/testHarmony7_ref.xml
  • src/importexport/musicxml/tests/data/testNegativeOctave_ref.xml
  • src/importexport/musicxml/tests/data/testStringData.xml
  • src/importexport/musicxml/tests/data/testTablature1.xml
  • src/importexport/musicxml/tests/data/testTablature2.xml
  • src/importexport/musicxml/tests/data/testTablature3.xml
  • src/importexport/musicxml/tests/data/testTablature4.xml
  • src/importexport/musicxml/tests/data/testTablature5.xml
  • src/importexport/musicxml/tests/data/testTablature5_ref.xml
  • src/importexport/musicxml/tests/data/testTabs.mscx
  • src/importexport/musicxml/tests/data/testTabs_ref.xml
  • src/importexport/musicxml/tests/musicxml_tests.cpp

Comment thread src/importexport/musicxml/internal/export/exportmusicxml.cpp
Comment thread src/importexport/musicxml/internal/export/exportmusicxml.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

Development

Successfully merging this pull request may close these issues.

3 participants