MusicXML export: a staff hidden at a system start is never shown again (no print-object="yes")

Open
#35,871 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@yuzeguitarist is already working on this.

Since Dec 2, 2026.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
69/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
backend

Research direction

Start by tracing the MusicXML export code that writes <staff-details print-object="no"/> at system starts, using the reported cases and related issues #17398, #22098, and #25660 as context. Check for a regression test covering a staff hidden for one system and shown in the next. Done means the third system exports <staff-details print-object="yes"/> for that staff, and the previously cited exports can be read without keeping it hidden.

Written by the indexing model from the issue text.

Description

Issue type

Import/export issue

Description with steps to reproduce

Since #26190 (the fix for #17398), the MusicXML export writes <staff-details print-object="no"/> at the first measure of every system in which a staff is hidden. Nothing is written where the staff is shown again: the first measure of that system has only <print new-system="yes"/>.

In MusicXML, staff-details belongs to <attributes>, and its values stay in force until they are changed. A reader that follows the specification therefore keeps the staff hidden from the first system where it was hidden to the end of the piece, and everything the staff plays after that is not shown. #17398 asked for print-object="yes" or "no" at each point where a staff is shown or hidden; the "yes" half is missing.

I have not run these steps in MuseScore Studio myself; the OpenScore exports below show the result.

  1. Make a score with two staves and turn on Hide empty staves.
  2. Leave the second staff empty in the second system only.
  3. Export as MusicXML.

Actual behaviour: the first measure of the second system has <staff-details print-object="no"/> for the second staff, and the first measure of the third system has no staff-details for it.

Expected behaviour: the first measure of the third system has <staff-details print-object="yes"/> for the second staff.

Supporting files, videos and screenshots

OpenScore's own MusicXML exports, with the scores they were exported from:

  • Schubert, Im Gegenwärtigen Vergangenes, D. 710, exported by MuseScore Studio 4.6.3: lc28789279.mxl (score: lc28789279.mscz). Tenore II has print-object="no" at the systems starting at measures 5, 10, 14, 17, 20, 23, 26, 29 and 33. The systems starting at measure 38 and at the measure numbered X1, where Tenore II starts singing, write no staff-details for it. The file has 61 print-object="no" and no print-object="yes", so a reader that follows the specification hides Tenore II from measure 5 to the end, including all 93 measures in which it sings.
  • Berg, String Quartet Op. 3, exported by MuseScore Studio 4.7.4: sq8955300.mxl (score: sq8955300.mscz): 110 print-object="no", no print-object="yes".

Tenore II in D. 710, where it is hidden and where it comes back:

<measure number="33">
  <print new-system="yes"></print>
  <attributes>
    <staff-details print-object="no"/>
  </attributes>
  ...
</measure>
...
<measure number="38">
  <print new-system="yes"></print>
  ...
</measure>
In which versions of MuseScore Studio is this issue present?

4.6.3 - 4.7.4 (seen in exports from 4.6.3, 4.6.5 and 4.7.4; not checked in a nightly build)

Regression

No.

Operating system

Not OS-specific as far as I can tell (export code); the files above were exported by OpenScore.

Additional context

Across the OpenScore Lieder and String Quartets exports: 4.6.3 writes print-object="no" 104 times, 4.6.5 122 times and 4.7.4 116 times, and none of these files contains print-object="yes". Related: #17398, #22098, #25660.

Checklist
  • This report follows the guidelines for reporting bugs and issues
  • I have verified that this issue has not been logged before, by searching the issue tracker for similar issues
  • I have attached all requested files and information to this report (linked above: the files are public in the OpenScore repositories)
  • I have attempted to identify the root problem as concisely as possible, and have used minimal reproducible examples where possible
Dominant language
C++
Stars
15.5k
Forks
3.5k
Avg merge
2d 19h
Merged PRs (30d)
124

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from musescore/MuseScore

All issues in musescore/MuseScore

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.