-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Mnx import/export changes for schema version 15 #33236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rpatters1
wants to merge
13
commits into
musescore:master
Choose a base branch
from
rpatters1:mnx-schema-15
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8bbc01d
update to latest mnxdom with latest schema (15)
rpatters1 d7606ed
refactored existing code to latest mnx schema changes
rpatters1 bc3d7e5
implement bow direction (with tests)
rpatters1 1f56823
import fermatas
rpatters1 d904056
export working (with test)
rpatters1 cfc84ce
fix breath marks
rpatters1 414201b
code formatting issues
rpatters1 b260154
coderabbit review changes
rpatters1 b82f951
add clarifying comment about barline fermata exports
rpatters1 3410eed
update comment about solitary sequences to match revised code behavior
rpatters1 567eeb6
improve test coverage for breath marks, with fixes
rpatters1 64a0cd5
better fermata test coverage and code cleanup
rpatters1 3b9e219
coderabbit fixes:
rpatters1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_fermatais called in a loop — only the last fermata survives.set_fermatais a setter, not an appender. If the end-barline segment carries more than oneFermataannotation (e.g. one per track), every iteration overwrites the previous call and all but the last are silently discarded.The import side confirms that MNX v15 supports exactly one global-measure fermata (
std::optional<mnx::Fermata>inmnximportmarkings.cpp:844), and the importer always assignstrack(0)with a///@todo`` for multiples. The export should be consistent: prefer the first fermata found (or filter for track 0 to match import semantics), then break.🛡️ Proposed fix — export the first fermata, consistent with import track-0 semantics
for (const EngravingItem* item : seg->annotations()) { IF_ASSERT_FAILED(item) { continue; } if (item->isFermata()) { const Fermata* fermata = toFermata(item); - DO_ASSERT(fermata); - if (fermata) { + IF_ASSERT_FAILED(fermata) { + break; + } + if (fermata->track() == 0) { // match importer's track-0 assumption mnxMeasure.set_fermata(MnxExporter::mnxFermataFromFermata(fermata)); + break; // MNX global measure supports only one fermata } } }If keeping the loop track-agnostic is intentional (e.g. always take whatever is first), a plain
breakafterset_fermatais the minimal fix to make the "first wins" policy explicit.🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't really matter if we export the first found or the last found. The current code stays clean in case we need to add other types of annotations. But I will add a note about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpatters1, that makes sense — keeping the loop open for future annotation types is a reasonable design choice, and a comment clarifying the "last wins" behaviour (along with a note that MNX v15 supports only one global-measure fermata) will be sufficient for readers. Thanks for the context!(ᵔ◡ᵔ)🐰
🧠 Learnings used