MuseJazz: Double barline distance is much too small

• Nov 14, 2018 - 10:24
Reported version
3.0
Priority
P1 - High
Type
Graphical (UI)
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
closed
Regression
No
Workaround
Yes
Project

In MuseJazz the Double barline distance is set to 0.30sp, but the Double barline thickness is also set to 0.30sp. This results in one thick barline of 0.60sp instead of two barlines (see screenshot).

I would suggest a default value of 0.45sp for the MusJeazz Double barline distance.

Attachment Size
MuseJazzDoubleBarline.PNG 3.41 KB

Comments

Yes, but they are still wrong :-)

Who has the authority to change these values? Can I create a PR myself? (After signing the CLA, which may take it's time, as I need the permission form my company.)

Your are right, this is a Bug in MuseScore in the interpretation of barlineSeparation. I f we look in the SMuFL spec we see:

"barlineSeparation": The default distance between multiple barlines when locked together, e.g. between two thin barlines making a double barline, or a thin and a thick barline making a final barline, measured from the right-hand edge of the left barline to the left-hand edge of the right barline.

MuseScore seems to take the distance as distance between the left edge and left edge. This means we have to add one thinBarlineThickness to this distance to get it right,

something like this?

@@ -1267,6 +1267,9 @@ void EditStyle::valueChanged(int i)
                  cs->undo(new ChangeStyleVal(cs, Sid::endBarDistance,
                    cs->styleV(Sid::endBarDistance).toDouble()
                    + (cs->styleV(Sid::barWidth).toDouble() + cs->styleV(Sid::endBarWidth).toDouble()) * .5));
+                 cs->undo(new ChangeStyleVal(cs, Sid::doubleBarDistance,
+                   cs->styleV(Sid::doubleBarDistance).toDouble()
+                   + (cs->styleV(Sid::barWidth).toDouble() + cs->styleV(Sid::barWidth).toDouble()) * .5));
 
                  // guess the repeat dot width = spatium * .3
                  cs->undo(new ChangeStyleVal(cs, Sid::repeatBarlineDotSeparation,

"Use The Source Luke" :-)

I was wrong, looking in barline.cpp one sees, that MuseScore measures the distance between the centers of the barlines. Therefore it is ok for an end bar to add half of a thin barline thickness and half of a thick barline distance. For a double barline we have to add two half of thin barline, which ends up in:

cs->undo(new ChangeStyleVal(cs, Sid::doubleBarDistance,
cs->styleV(Sid::doubleBarDistance).toDouble()
+ cs->styleV(Sid::barWidth).toDouble() ));

BTW: Exists anywhere some documentation how to format a comment?

Maybe I'm stupid, but why not measure the right distance to begin with? (I.e. from the right side of the left barline to the left side of the right barline instead of from the center of the lines)

Well, it probably has been that way in MuseScore a long time before SMuFL did it differently. And when drawing simple lines, then change their thickness, it is notmal that they widen to either side, so measure from center to center comes quite naturally

We draw one barline, then move a distance D and them draw the next barline. At each time the current position is used as the center of the pen. Therefore I said, that MuseScore measures D from center to center. And this makes is naturally for the Software Developer.

But if you asked someone, who is not a Software Developer or a Mathematician, what is the distance between two houses, he/she will measure from wall to wall, not from the center of one house to the center of the next house. This makes the definition of SMuFL the natural definition for the normal user. Even I (both Mathematician and Software Developer) assumed this definition of distance when I first opened the barline style editor. This means, I vote for the idea of Louis.

Changing this would mean, that we "only" have to move the formulas from editstyle.cpp to barline.cpp. And that we change back all these many constants in this large number of files :-(

@Jojo: Sorry for this comment :-)

By the way, this would also solve the repeat dots issue. Current code in barline.cpp:

        case BarLineType::START_REPEAT: {
              qreal lw2 = score()->styleP(Sid::endBarWidth) * mag();
              painter->setPen(QPen(curColor(), lw2, Qt::SolidLine, Qt::FlatCap));
              qreal x = lw2 * .5;
              painter->drawLine(QLineF(x, y1, x, y2));

              qreal lw = score()->styleP(Sid::barWidth) * mag();
              painter->setPen(QPen(curColor(), lw, Qt::SolidLine, Qt::FlatCap));
              x  += score()->styleP(Sid::endBarDistance) * mag();
              painter->drawLine(QLineF(x, y1, x, y2));

              x += score()->styleP(Sid::repeatBarlineDotSeparation) * mag();
              x -= symBbox(SymId::repeatDot).width() * .5;  // === LOOK HERE ===
              drawDots(painter, x);

              if (score()->styleB(Sid::repeatBarTips))
                    drawTips(painter, false, 0.0);
              }
              break;
Status PR created fixed

Fixed in branch master, commit 524d30e2e0

fix #278219: MuseJazz: Double barline distance is much too small

this is a Bug in MuseScore in the interpretation of barlineSeparation.
If we look in the SMuFL spec we see:

"barlineSeparation": The default distance between multiple barlines when
locked together, e.g. between two thin barlines making a double barline,
or a thin and a thick barline making a final barline, measured from the
right-hand edge of the left barline to the left-hand edge of the right
barline.

MuseScore takes the distance as distance between the center of these.
This means we have to add one thinBarlineThickness to
this distance to get it right.

and related to fix #277991: adjust barline style defaults to those of
Emmentaler and its metadata.json, so changing a way from and back to
Emmentaler doesn't change the barline styles