musescore / musescore/MuseScore
Exported part scores still contain links to master score
Nobody has claimed this yet.
- 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:
- Export a score's parts using the command line, like:
mscore --score-parts score.mscz -o score-parts.json - List the parts using jq:
jq <score-parts.json '.parts' - Get an
msczof the first part:jq < score-parts.json -r '.partsBin[0]' | base64 --decode > part0.mscz - Open the
part0.msczfile 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
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.
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