Preserve MusicXML horizontal note positioning for simultaneous voices on import

Open
#35,691 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
data, desktop

Research direction

Start by tracing MusicXML import handling for note positioning attributes such as default-x and relative-x, then find the layout and import tests for simultaneous voices. Reproduce the report with the supplied one-measure fixture and compare the imported PDF and re-exported MusicXML against the control. Done when the specified separation is preserved while note onsets and durations remain unchanged, and unpositioned notes retain automatic layout.

Written by the indexing model from the issue text.

Description

needs review
Issue type

MusicXML import / layout compatibility

Steps to reproduce
  1. Save the original one-bar MusicXML fixture below as offset.musicxml and import it into MuseScore Studio 4.7.7 (b750c43e316cf6a00e70451870b231b12f400bda).
  2. Compare the PDF and immediate MusicXML export with a control in which both notes have default-x="25".
  3. As a second variant, set the upper note to default-x="25" relative-x="15" and leave the lower note unchanged.

Expected/request: Preserve the deliberate horizontal separation of the two simultaneously sounded, same-stem-direction notes, without changing their durations or onsets. MusicXML 4.0 defines the referenced positioning information; this report asks for import support for these optional layout attributes, not for breaking automatic layout for unpositioned notes.

Actual: All three first-import PDFs have identical glyph and vector geometry; both notes have re-exported default-x="80.23" in every case. The notes still belong to separate voices and start together. All three inputs pass MusicXML 4.0 schema validation. Tested on Windows via CLI; no claim about older builds or latest nightly.

<?xml version="1.0" encoding="UTF-8"?>
<score-partwise version="4.0">
  <part-list><score-part id="P1"><part-name>Test</part-name></score-part></part-list>
  <part id="P1">
    <measure number="1" width="180">
      <attributes>
        <divisions>1</divisions>
        <time><beats>2</beats><beat-type>4</beat-type></time>
        <clef><sign>G</sign><line>2</line></clef>
      </attributes>
      <note default-x="25">
        <pitch><step>D</step><octave>4</octave></pitch>
        <duration>2</duration><voice>1</voice><type>half</type><stem>up</stem>
      </note>
      <backup><duration>2</duration></backup>
      <note default-x="40">
        <pitch><step>A</step><octave>4</octave></pitch>
        <duration>2</duration><voice>3</voice><type>half</type><stem>up</stem>
      </note>
    </measure>
  </part>
</score-partwise>
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.