verovio icon indicating copy to clipboard operation
verovio copied to clipboard

Vertical beam placement error

Open craigsapp opened this issue 3 years ago • 2 comments

Here is an example of a highly frowned-upon placement of a beam:

Screen Shot 2021-01-22 at 2 36 28 AM
Click to view MEI data for above example.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="4.0.0">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2021-01-22T02:36:31" version="3.2.0-dev-80879e0-dirty">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000001665425960">
    <score xml:id="score-0000001456575599">
     <scoreDef xml:id="scoredef-0000001452809114">
      <staffGrp xml:id="staffgrp-0000000636955853">
       <staffDef xml:id="staffdef-0000002146836028" n="1" lines="5">
        <clef xml:id="clef-L2F1" shape="G" line="2" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1">
       <staff xml:id="staff-0000001589842027" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <beam xml:id="beam-L4F1-L7F1">
          <note xml:id="note-L4F1" dur="8" oct="3" pname="b" accid.ges="n" />
          <note xml:id="note-L5F1" dur="8" oct="4" pname="c" accid.ges="n" />
          <note xml:id="note-L6F1" dur="8" oct="4" pname="d" accid.ges="n" />
          <note xml:id="note-L7F1" dur="8" oct="4" pname="e" accid.ges="n" />
         </beam>
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

Beam endings are never allowed to be centered in a staff space (the right side of the example beam). I recently have not noticed any other such cases, but this one somehow slips though the the beam algorithms.

As background, there are two reasons this position is not allowed (1) it increases the visual activity which decreases readability, and (2) in traditional ink printing, the wedge underneath the beam would get filled in with ink, so on paper, the thin white wedge would most likely be filled in with ink, particularly as the horizontal spacing increases:

Screen Shot 2021-01-22 at 2 53 18 AM

The source of the problem may be related to the beam-flattening algorithm, but if so, it has a bug: the right side of the beam should not be raised about 1/2 a diatonic step as is happening here, because that would increase the slope of the beam.

The right side of the beam should sit on the 4th staff line (go down 1/2 a diatonic step).

And the left side should hang from the fourth staff line -- if applying slope reduction. But I would prefer that step-wise beamed notes not have slope reduction applied to their beams (this is somewhat a stylistic thing that could be debated). In such cases, having the beams and the stepwise notes in parallel makes them easier to read. It also makes adjacent beams on scalar passages better aligned rather than having a stepped look:

Screen Shot 2021-01-22 at 3 00 43 AM
Click to view MEI data for above example.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="4.0.0">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2021-01-22T03:01:43" version="3.2.0-dev-80879e0-dirty">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000000030891169">
    <score xml:id="score-0000001754275884">
     <scoreDef xml:id="scoredef-0000001452809114">
      <staffGrp xml:id="staffgrp-0000002125610720">
       <staffDef xml:id="staffdef-0000000384586359" n="1" lines="5">
        <clef xml:id="clef-L2F1" shape="G" line="2" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1">
       <staff xml:id="staff-0000002046928844" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <beam xml:id="beam-L4F1-L7F1">
          <note xml:id="note-L4F1" dur="16" oct="3" pname="b" accid.ges="n" />
          <note xml:id="note-L5F1" dur="16" oct="4" pname="c" accid.ges="n" />
          <note xml:id="note-L6F1" dur="16" oct="4" pname="d" accid.ges="n" />
          <note xml:id="note-L7F1" dur="16" oct="4" pname="e" accid.ges="n" />
         </beam>
         <beam xml:id="beam-L8F1-L11F1">
          <note xml:id="note-L8F1" dur="16" oct="4" pname="f" accid.ges="n" />
          <note xml:id="note-L9F1" dur="16" oct="4" pname="g" accid.ges="n" />
          <note xml:id="note-L10F1" dur="16" oct="4" pname="a" accid.ges="n" />
          <note xml:id="note-L11F1" dur="16" oct="4" pname="b" accid.ges="n" />
         </beam>
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

Compare to beams that are parallel to the notes:

Screen Shot 2021-01-22 at 3 10 30 AM
Click to view SCORE data for above example.
8 1 0 0 0 80
3 1 1.5
1 1 13.5 0 10 0 0.25
6 1 13.5 0 3 38.44 12
1 1 21.813 1 10 0 0.25
1 1 30.125 2 10 0 0.25
1 1 38.438 3 10 0 0.25
1 1 46.75 4 10 0 0.25
6 1 46.75 4 7 71.69 12
1 1 55.063 5 10 0 0.25
1 1 63.375 6 10 0 0.25
1 1 71.688 7 10 0 0.25
14 1 80 1

craigsapp avatar Jan 22 '21 11:01 craigsapp

Fixed as well? image image

Monceber avatar Jun 09 '22 17:06 Monceber

It is improved, but the current rendering unnecessarily violates basic rules about starting/ending beams in the middle of a staff space (which is happening with the 16th-note beams in the second beam of the bottom system above).

Here is the rule from Behind Bars (page 20) that should always be followed for 8th and 16th note beams (32nd and higher are difficult to avoid breaking this rule):

Screen Shot 2022-06-09 at 11 07 57 AM

Guidelines from page 18 for placing beam endpoints (outermost beam):

Screen Shot 2022-06-09 at 11 12 36 AM

Notice that the first beam in the example follows this rule (top of beam start centers on staff line) but the second one is violating these guidelines (top of beam start sits on a staff line, but this is only allowed for stem down beams).

Here are the correct stem-lengths for the second beam:

Screen Shot 2022-06-09 at 11 24 14 AM

or

Screen Shot 2022-06-09 at 11 43 49 AM

or

Screen Shot 2022-06-09 at 11 46 22 AM

I like the first option even though it has some tiny wedges that will get filled in with anti-aliasing. Then I like the third option the next best because the beam angles of both beams are the same (but the beam angle seems a little steeper than it needs to be).

So we can leave this issue open until verovio reproduces one of the above examples 😉

craigsapp avatar Jun 09 '22 18:06 craigsapp