3.7 Evolution - Early Music

• Oct 4, 2024 - 15:34

Ben Byram-Wigfield (aka benwiggy) created a SMuFL font "Valerio" for notating early music. (SIL Open Font License)
See Dorico forum:
https://forums.steinberg.net/t/valerio-a-16th-century-music-font/941064
This font can be used in 3.7 Evolution
Edit: New screenshot after fix by Jojo.
valerio.png

Howto: see https://github.com/Jojo-Schmitz/MuseScore/wiki/Musescore-3-Evolution-Fe…
Remember to rename (copy) Valerio.json to metadata.json.
Musescore 4 users are left in the cold.


Comments

In reply to by Jojo-Schmitz

Hmm, maybe not: looking at, for example, a quarter note, in the metadata there is no noteQuarterDown (down stem), just a noteQuarterUp, so there may be stuff missing?
OTOH: changing it's bBoxSW and bBoxNe doesn't seem to have any effect, neither has changing noteheadBlack (which might be the one used here for quarter notes, at least it looks right in the master palette's symbols palette)

In reply to by Jojo-Schmitz

More appropriate setting would be this (in Valerian's metadata.json):

"glyphsWithAnchors": {
    "noteheadBlack": {
        "stemUpSE": [
            0.768,
            0.62
        ],
        "stemDownNW": [
            0.632,
            -0.632
        ]
    },

Which looks correct. But changing the x-values there doesn't seem to have any effect, while changing the y-values does take effect.

So this does indeed point at MuseScore to be ignoring the x-values.

Looking at the code:

                  // move stem start to note attach point
                  Note* n  = up() ? chord()->downNote() : chord()->upNote();
                  if ((up() && !n->mirror()) || (!up() && n->mirror()))
                        y1 += n->stemUpSE().y();
                  else
                        y1 += n->stemDownNW().y();
                  rypos() = n->rypos();
                  }
...
      line.setLine(0.0, y1, 0.0, l);

seems to confirm this

In reply to by Jojo-Schmitz

Looks good with Valerio
valerio.png
with some code changes

$ git diff
diff --git a/libmscore/stem.cpp b/libmscore/stem.cpp
index d3177b9d7b..8836433aae 100644
--- a/libmscore/stem.cpp
+++ b/libmscore/stem.cpp
@@ -84,6 +84,7 @@ void Stem::layout()
       qreal _up  = up() ? -1.0 : 1.0;
       l         *= _up;
 
+      qreal x = 0.0;                            // horizontal displacement to match note attach point
       qreal y1 = 0.0;                           // vertical displacement to match note attach point
       const Staff* stf = staff();
       if (chord()) {
@@ -107,17 +108,22 @@ void Stem::layout()
             else {                              // non-TAB
                   // move stem start to note attach point
                   Note* n  = up() ? chord()->downNote() : chord()->upNote();
-                  if ((up() && !n->mirror()) || (!up() && n->mirror()))
+                  bool m = n->mirror();
+                  if ((up() && !m) || (!up() && m)) {
+                        x  -= n->stemUpSE().x() - lineWidthMag();
                         y1 += n->stemUpSE().y();
-                  else
+                        }
+                  else {
+                        x  += n->stemUpSE().x() - lineWidthMag();
                         y1 += n->stemDownNW().y();
+                        }
                   rypos() = n->rypos();
                   }
             }
 
       qreal lw5 = 0.5 * lineWidthMag();
 
-      line.setLine(0.0, y1, 0.0, l);
+      line.setLine(x, y1, x, l);
 
       // compute bounding rectangle
       QRectF r(line.p1(), line.p2());

But then looks bad with Leland
Leland.png
No idea why, that change doesn't touch the y-values at all

In reply to by Jojo-Schmitz

This seems to work properly for all fonts

$ git diff
diff --git a/libmscore/stem.cpp b/libmscore/stem.cpp
index d3177b9d7b..c1989de309 100644
--- a/libmscore/stem.cpp
+++ b/libmscore/stem.cpp
@@ -80,11 +80,11 @@ qreal Stem::stemLen() const
 
 void Stem::layout()
       {
-      qreal l    = _len + _userLen;
-      qreal _up  = up() ? -1.0 : 1.0;
-      l         *= _up;
-
-      qreal y1 = 0.0;                           // vertical displacement to match note attach point
+      qreal _up        = up() ? -1.0 : 1.0;
+      qreal l          = (_len + _userLen) * _up;
+      qreal x          = 0.0;                           // horizontal displacement to match note attach point
+      qreal y1         = 0.0;                           // vertical displacement to match note attach point
+      qreal lw5        = 0.5 * lineWidthMag();          // half a stem's width
       const Staff* stf = staff();
       if (chord()) {
             setMag(chord()->mag());
@@ -107,17 +107,30 @@ void Stem::layout()
             else {                              // non-TAB
                   // move stem start to note attach point
                   Note* n  = up() ? chord()->downNote() : chord()->upNote();
-                  if ((up() && !n->mirror()) || (!up() && n->mirror()))
-                        y1 += n->stemUpSE().y();
-                  else
-                        y1 += n->stemDownNW().y();
+                  bool m = n->mirror();
+                  if ((up() && !m) || (!up() && m)) {
+                        x  = n->stemUpSE().x();
+                        if (score()->styleSt(Sid::musicalSymbolFont) == "Bravura") // we can't really change this font
+                              x += lw5;
+                        else if (score()->styleSt(Sid::musicalSymbolFont) == "Gonville")
+                              ;
+                        else if (score()->styleSt(Sid::musicalSymbolFont) == "Emmentaler")
+                              x -= 6 * lw5; // ?!?
+                        else // seems all other fonts agree on this
+                              x -= lw5;
+                        y1 = n->stemUpSE().y();
+                        }
+                  else {
+                        x  = n->stemDownNW().x();
+                        x += lw5;
+                        y1 = n->stemDownNW().y();
+                        }
+                  rxpos() = n->rxpos();
                   rypos() = n->rypos();
                   }
             }
 
-      qreal lw5 = 0.5 * lineWidthMag();
-
-      line.setLine(0.0, y1, 0.0, l);
+      line.setLine(x, y1, x, l);
 
       // compute bounding rectangle
       QRectF r(line.p1(), line.p2());
(

At least with quarter notes... others yet to be tested

In reply to by Jojo-Schmitz

Not sure either. A 'usual' musicxml file mentions 'font' in:

<word-font font-family="FreeSerif" font-size="10"/>
 <lyric-font font-family="FreeSerif" font-size="11"/>
 <credit-words default-x="600.172" default-y="1611.03" justify="center" valign="top" font-family="MuseJazz Text" font-size="24">La Valse m39-58</credit-words>

EDIT: In the Valerio musicxcml file there is not a single mention of font (?!)

In reply to by Jojo-Schmitz

I found this problem with the AloisenGrooveU font.
aloisenGrooveU.png

I guess (almost) nobody uses this font, and it can be ignored?
The 'beam' problem also exist in Dorico. But are beams needed in 16th century printed music?

Any suggestions about a good companion text font?

In reply to by Jojo-Schmitz

OK here's how the Aloisen fonts look (with my PR in its current form)
stems-3.7-AloisenU.png
stems-3.7-AloisenGrooveU.png
Seems to be bad metadata for noteheadBlack and noteheadHalf's stemUpSE, very bad (on the wrong side of the heads) for AloisenGrooveU, only a stemwidth off for AloisenU, similar to Bravura.
Actualy the Aloisen fonts don't have a stemUpSE at all!?!

In reply to by Jojo-Schmitz

The glyphBBoxes stuff bBoxSW and bBoxNE seems to be Finale specific.
https://w3c.github.io/smufl/latest/specification/glyphbboxes.html
This data is provided primarily for MakeMusic Finale, which requires bounding box data for certain graphical and spacing calculations performed by the software.
Deleting this complete block doesn't change anything.

I also noticed that the x values do not have any effect, while the y values do work

Do you still have an unanswered question? Please log in first to post your question.