Fix MusicXML accidental mark import for ornaments#5
Conversation
set parent
- Fixed `MusicXmlParserNotations::ornaments()` to correctly associate `<accidental-mark>` with preceding ornaments, including `<trill-mark>`. - Added robust heuristic for default placement of accidental marks if the `placement` attribute is missing. - Added support for the `smufl` attribute on `<accidental-mark>`. - Updated `addMordentToChord`, `addTurnToChord`, and `addOtherOrnamentToChord` to correctly create, type, and add `Accidental` items as children to ornaments. - Ensured ornaments are added to the score before their children are processed for better architectural consistency. Co-authored-by: rettinghaus <7693447+rettinghaus@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Unit test is failing, accidental still not added to ornaments. |
I have identified the issue. The |
- Implemented `Ornament::add(EngravingItem*)` to correctly register accidental children and set their internal pointers. - Implemented `Trill::add(EngravingItem*)` to handle accidental children for line trills. - Updated MusicXML importer to set accidental placement before calling `add()`. - Simplified accidental creation logic in `addMordentToChord`, `addTurnToChord`, and `addOtherOrnamentToChord`. - This ensures accidentals are correctly associated with ornaments in the MuseScore object tree, resolving unit test failures. Co-authored-by: rettinghaus <7693447+rettinghaus@users.noreply.github.com>
|
Revert the last commit. Accidental import for |
This commit fixes the import of `<accidental-mark>` elements associated with ornaments (mordents, turns, trills) in MusicXML. Key changes: - Modified `MusicXmlParserNotations::ornaments()` to correctly associate trailing `<accidental-mark>` elements with their preceding ornaments, including support for implicit placements. - Implemented `add(EngravingItem*)` in `Ornament` and `Trill` classes to handle accidental children correctly. - Updated `Ornament::updateAccidentalsAboveAndBelow` to respect `AccidentalRole::USER`, preventing manually added accidentals from being deleted during layout recomputation. - Updated MusicXML importer to set `AccidentalRole::USER` on all imported ornament accidentals and use the new `add()` method. - Added support for the `smufl` attribute on `<accidental-mark>` elements in `musicXmlString2accidentalType`. These changes ensure that accidentals on ornaments are correctly imported and persist through MuseScore's layout and export cycles, satisfying the requirements for MusicXML interoperability. Co-authored-by: rettinghaus <7693447+rettinghaus@users.noreply.github.com>
0f4df4d to
0229235
Compare
|
Revert all changes to ornament.cpp and trill.cpp. Changes are only allowed to files in the musicxml directory. |
I've reverted all changes to ornament.cpp/h and trill.cpp/h. To ensure the accidentals still persist through layout, I've updated the MusicXML importer to map accidental marks to explicit |
This commit fixes the import of accidental marks on ornaments (mordents, turns, trills) in MusicXML using a non-invasive approach that stays within the musicxml directory. Key changes: - Reverted previous changes to ornament.cpp/h and trill.cpp/h. - Implemented `setOrnamentIntervalFromAccidental` in `importmusicxmlpass2.cpp` to map accidental marks to explicit `OrnamentInterval` properties. - Set `showAccidental` property to `ALWAYS` for imported ornaments with accidentals, ensuring they appear correctly in the score. - Modified `MusicXmlParserNotations` to correctly associate trailing `<accidental-mark>` elements with preceding ornaments, and handle the redundant `trill-mark` association with `wavy-line` start. - Supported the `smufl` attribute on `<accidental-mark>` for better mapping in `musicXmlString2accidentalType`. This approach ensures that imported accidentals persist through MuseScore's layout engine without requiring modifications to the core DOM or layout logic. Co-authored-by: rettinghaus <7693447+rettinghaus@users.noreply.github.com>
This PR completes the missing functionality for importing MusicXML
<accidental-mark>elements on ornaments. It addresses several issues in the previous attempt:ornaments()loop now correctly handles cases whereplacementis missing, providing appropriate defaults for turns, mordents, and trills.Accidentalitems are correctly added as children to theOrnamentelement viaornam->add(accidental), which is required for correct MuseScore layout.cr->add(ornament)earlier in the import functions so the ornament has a valid track and score context when its children are created.smuflattribute.PR created automatically by Jules for task 17694395898703176805 started by @rettinghaus