Fix #86151 - Articulation of ornamented note sound events #2281
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.
Reference: original issue with details and screen shots: https://musescore.org/en/node/86151
Issue: When a note is realized with multiple MIDI events (typically an ornamented note):
Each individual event, including the last one, is given the time gate which the note as a whole should receive (either the instrument default time gate or determined by an articulation sign, like staccato, etc.)
The note as whole is not articulated properly, but is articulated by the articulation of its last event.
This fix:
applies to the note as a whole the proper time gate;
generates all intermediate events as legato
Notes:
If the note is significantly shortened by the articulation (like staccato), less alternations are generated for 'long' ornaments like trills.
The current implementation skips entirely an ornament if there is no room to fit all its minimum required events. As the total note duration is in most cases shortened, this might now happen in some more cases than before, in particular with 'long' ornaments (trills) over very short notes.
No change to the logic of ornament realization (which events for which notes), only timing is changed.
Only one code file is changed,
libmscore/rendermidi.cpp
; all the other changed files are test reference files.