musescore / musescore/MuseScore

Exported part scores still contain links to master score

Open
#34,446 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P2 regression MS4
Dominant language
C++
Stars
15.1k
Forks
3.3k
Avg merge
2d 2h
Merged PRs (30d)
91

Description

Issue type

Import/export issue

Description with steps to reproduce

If you export a score's parts using the command line, the generated mscz files still contain linkedTo elements referring to the original master score, which no longer exists alongside the part.

When the newly-generated standalone part(s) is loaded into MSS, there are a lot of EID errors (~ one per engraving item?), which are apparently harmless since the load ignores them and continues successfully, but might be worth fixing:

17:22:03.449 | ERROR | main_thread     | TRead::readItemLink | ASSERT FAILED:    eid.isValid()    /Users/ajuncosa/src/MuseScore/release/src/engraving/rw/read460/tread.cpp:592
17:22:03.449 | ERROR | main_thread     | EIDRegister::itemFromEID | ASSERT FAILED:    iter != m_eidToItem.end()    /Users/ajuncosa/src/MuseScore/release/src/engraving/infrastructure/eidregister.cpp:84
17:22:03.449 | ERROR | main_thread     | TRead::readItemLink | ASSERT FAILED:    mainElement    /Users/ajuncosa/src/MuseScore/release/src/engraving/rw/read460/tread.cpp:595
17:22:03.449 | ERROR | main_thread     | TRead::readItemLink | Link failed: Main linked element not found for Staff at 0/1
...

Steps:

  1. Export a score's parts using the command line, like: mscore --score-parts score.mscz -o score-parts.json
  2. List the parts using jq: jq <score-parts.json '.parts'
  3. Get an mscz of the first part: jq < score-parts.json -r '.partsBin[0]' | base64 --decode > part0.mscz
  4. Open the part0.mscz file in MuseScore Studio

Actual: a bunch of EID errors are printed to the terminal (if in Debug build, the application stops at the first assert).
Expected: the score is loaded cleanly

Supporting files, videos and screenshots
In which versions of MuseScore Studio is this issue present?

4.6.5 - 4.7.5

Regression

Yes, this used to work in a previous version of MuseScore 4.x

Operating system

macOS 26.5

Additional context

No response

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
  • I have attempted to identify the root problem as concisely as possible, and have used minimal reproducible examples where possible

Contributor guide

Open the contributing guide

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.

Research direction

Reproduce the issue with the command-line --score-parts steps and inspect the generated part.mscz in MuseScore Studio. Start with the linkedTo data and the reported read paths in engraving/rw/read460/tread.cpp and engraving/infrastructure/eidregister.cpp. Done means exported standalone parts load cleanly without EID errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.