MusicXML export moves lower-staff text to staff 1 when no note or rest starts at its tick
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start in src/importexport/musicxml/internal/export/exportmusicxml.cpp, especially annotationsWithoutNote() and its call to commonAnnotations() when no note or rest starts at the annotation tick. The report identifies the fallback staff number as the source; trace how the annotation track maps to a part-relative staff. Done when the reproduction exports <staff>2</staff> for the lower-staff text and it remains on staff 2 after reimport.
Written by the indexing model from the issue text.
Description
Issue type
Import/export issue
Description with steps to reproduce
- Save the complete MusicXML below as
lower-staff-text.musicxmland open it in MuseScore Studio. The textLower staff onlybelongs to the lower staff, at beat 2 (where neither staff has a new note or rest). - Export the score as uncompressed MusicXML and inspect the
<direction>for that text. - Open the exported MusicXML in MuseScore Studio.
Expected: The exported direction contains <staff>2</staff>, and the text remains on the lower staff at beat 2 after reimport.
Actual: The exported direction contains <staff>1</staff>. On reimport the text belongs to the upper staff. I checked the native score model before export and after reimport: the text changes from staff 2 to staff 1; the notes stay where they were.
Supporting files, videos and screenshots
Complete, schema-validated, one-measure reproduction (no other files needed):
<?xml version="1.0" encoding="UTF-8"?>
<score-partwise version="4.0">
<part-list>
<score-part id="P1"><part-name>Piano</part-name></score-part>
</part-list>
<part id="P1">
<measure number="1">
<attributes>
<divisions>4</divisions>
<time><beats>4</beats><beat-type>4</beat-type></time>
<staves>2</staves>
<clef number="1"><sign>G</sign><line>2</line></clef>
<clef number="2"><sign>F</sign><line>4</line></clef>
</attributes>
<note>
<pitch><step>C</step><octave>5</octave></pitch>
<duration>16</duration><voice>1</voice><type>whole</type><staff>1</staff>
</note>
<backup><duration>16</duration></backup>
<direction placement="above">
<direction-type><words>Lower staff only</words></direction-type>
<offset sound="no">4</offset>
<staff>2</staff>
</direction>
<note>
<pitch><step>C</step><octave>3</octave></pitch>
<duration>16</duration><voice>5</voice><type>whole</type><staff>2</staff>
</note>
</measure>
</part>
</score-partwise>
In which versions of MuseScore Studio is this issue present?
Reproduced in 4.7.7 (revision b750c43). The same fallback is present in main at 6da159d; no nightly build was run.
Regression
I was unable to check.
Operating system
Windows 11
Additional context
In annotationsWithoutNote(), if there is no note or rest track for the annotation at that tick, commonAnnotations() is called with staves > 1 ? 1 : 0. In a multi-staff part that fallback writes staff 1 rather than deriving the part-relative staff from the annotation's own track. This concerns ordinary <direction><direction-type><words> staff text, not the chord symbols in #23240 or the voice-number issue #25663.
- Dominant language
- C++
- Stars
- 15.5k
- Forks
- 3.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 124
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from musescore/MuseScore
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Edit string data dialog opens empty, with no strings and 0 frets, from "Instrument/Staff properties"Possibly taken @igorkorsukov claimed this 2 days ago. OpenP2 regression nightly UX/interaction
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
musescore/MuseScore#35829 · 1 assignee ·
Maintainers usually reply within 1 day
-
MusicXML export: overlapping dashed text lines (<dashes>) are all exported with duplicate number="1"Opencommunity MusicXML
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
MusicXML import loses explicit slur direction when the stop precedes the start in document orderOpenneeds review
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
needs review
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
All issues in musescore/MuseScore
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
eclipse-score/logging#531 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
azahar-emu/azahar#2944 ·
Maintainers usually reply within 1 day
-
upstream update
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
conan-io/conan-center-index#31637 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Niko1221/Strata#7777 · 1 reaction ·
Maintainers usually reply within 4 days