Skip to content

Commit

Permalink
A deep overhaul of dynamics and expression
Browse files Browse the repository at this point in the history
1. Don't automatically flag as "other" dynamic with text. As long as the string contains the substring identifying the dynamic type, we should retain the type. NOTE: this also resolves the issue that dynamics with text don't have playback.

2. Keep dynamics aligned properly (i.e. dynamic under the notehead) when custom text is added. This is now the defaul, with an option to revert to old behaviour.

3. Offset dynamis laterally to avoide collision with barlines (with toggle/untoggle option).

In general, dynamics must be detached from text settings. Specifically:

4. Dynamics symbols now have the possibility to override the score music font (independently of text font)

5. Dynamics symbols can have custom size (independent from text size) expressed as a percentage of the default.

6. Dynamics text (i.e. text typed into a dynamic) must be treated as expression text, and it now takes all its defaults from there. The Style -> Text Styles -> Dynamics page has been removed.

7. Expressions have a new dedicated class of their own. "Old" expressions, i.e. staff text with an "expression" style, are mapped into the new expression item preserving the old layout.

8. Expressions entered on the same chord as a dynamic mark will automatically align to the dynamic (with toggle/untoggle option).

9. An expression + dynamics snapped pair is dragged together.

10. Long awaited quality-of-life improvement: when dropping (or clicking and entering) a new dynamic onto an existing one, it will replace the old one with the new one (instead of having to delete and re-enter to change a dynamic).

11. A new inspector panel for Dynamics, containing all the relevant applicable settings. Some of these settings are moved here from the Text inspector panel, mainly the Above - Below and the Frame Settings.

12. The Text inspector panel is not shown when a "pure" dynamic is selected. It is only shown when a dynamic+custom text is selected, and the options only refer to the text part.

13. New options in the Style -> Dynamics submenu.

14. A new inspector panel for Expressions, containing (for now) only the "Snap to dynamics" option.
  • Loading branch information
mike-spa committed Apr 28, 2023
1 parent b633317 commit efeae29
Show file tree
Hide file tree
Showing 62 changed files with 1,934 additions and 344 deletions.
Binary file modified fonts/mscore/MusescoreIcon.ttf
Binary file not shown.
18 changes: 16 additions & 2 deletions src/engraving/layout/layoutsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,8 @@ void LayoutSystem::layoutSystemElements(const LayoutOptions& options, LayoutCont
if (e->isDynamic()) {
Dynamic* d = toDynamic(e);
d->layout();

if (d->autoplace()) {
d->manageBarlineCollisions();
d->autoplaceSegmentElement(false);
dynamics.push_back(d);
}
Expand All @@ -970,7 +970,6 @@ void LayoutSystem::layoutSystemElements(const LayoutOptions& options, LayoutCont
}

// add dynamics shape to skyline

for (Dynamic* d : dynamics) {
if (!d->addToSkyline()) {
continue;
Expand All @@ -981,6 +980,21 @@ void LayoutSystem::layoutSystemElements(const LayoutOptions& options, LayoutCont
system->staff(si)->skyline().add(d->shape().translate(d->pos() + s->pos() + m->pos()));
}

//-------------------------------------------------------------
// Expressions
// Must be done after dynamics. Remember that expressions may
// also snap into alignment with dynamics.
//-------------------------------------------------------------
for (Segment* s : sl) {
Measure* m = s->measure();
for (EngravingItem* e : s->annotations()) {
if (e->isExpression()) {
e->layout();
system->staff(e->staffIdx())->skyline().add(e->shape().translate(e->pos() + s->pos() + m->pos()));
}
}
}

//-------------------------------------------------------------
// layout SpannerSegments for current system
// voltas and tempo change lines are collected here, but laid out later
Expand Down
1 change: 1 addition & 0 deletions src/engraving/libmscore/chordrest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ EngravingItem* ChordRest::drop(EditData& data)
// fall through
case ElementType::TEMPO_TEXT:
case ElementType::DYNAMIC:
case ElementType::EXPRESSION:
case ElementType::FRET_DIAGRAM:
case ElementType::TREMOLOBAR:
case ElementType::SYMBOL:
Expand Down
Loading

0 comments on commit efeae29

Please sign in to comment.