rism-digital / verovio

🎵 Music notation engraving library for MEI with MusicXML and Humdrum support and various toolkits (JavaScript, Python)
https://www.verovio.org
GNU Lesser General Public License v3.0
656 stars 180 forks source link

wrong note ordering with altered unison #3206

Open frakel opened 1 year ago

frakel commented 1 year ago

The rendering of altered unisons in Verovio is not correct: image

Click here for the MEI code

```xml K. 284/01, m34-35

```

The altered unison note should be after the tied unaltered note like so: image

s.a. Behind Bars, p. 53 Offsetting unison and adjacent noteheads

cividini commented 1 year ago

I do agree with @frakel : In this special case the general rule for offsetting unison noteheads in Behind Bars (correctly applied in Verovio so far), p. 53 ("Offset the lower part to the right") does not apply for altered unisons, s. Behind Bars, S. 91 (bar 3 in the example below):

grafik

In this special case the lower part has to be offset to the left so that it is clear which accidental belongs to which part.

o-sapov commented 1 year ago

Relates to #1656

lpugin commented 1 year ago

A good workaround is to change the order of the layers in the MEI

image
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/4.0.1/mei-CMN.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/4.0.1/mei-CMN.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei meiversion="5.0.0-dev" xmlns="http://www.music-encoding.org/ns/mei">
  <meiHead>
    <fileDesc>
      <titleStmt>
        <title label="NMA digital" type="unit">K. 284/01, m34-35</title>
      </titleStmt>
      <pubStmt/>
    </fileDesc>
  </meiHead>
  <music>
    <body>
      <mdiv n="1" xml:id="mdiv_72">
        <score xml:id="score_78">
          <scoreDef key.mode="major" key.pname="d" key.sig="2s" meter.count="2" meter.sym="common" meter.unit="8" xml:id="scoreDef_01">
            <staffGrp xml:id="staffGrp_01">
              <staffDef clef.line="2" clef.shape="G" key.sig="2s" lines="5" n="1" xml:id="staffDef_P1"/>
            </staffGrp>
          </scoreDef>
          <section xml:id="section_A_m1-1">
            <measure n="34" xml:id="m34_k284_001">
              <staff n="1" xml:id="staff_10932">
                <layer n="1" xml:id="layer_10938">
                  <rest dur="8" xml:id="rest_10992"/>
                  <note accid.ges="s" dur="8" oct="5" pname="f" xml:id="note_10998">
                    <supplied xml:id="supplied_11004">
                      <artic artic="spicc" xml:id="artic_11010"/>
                    </supplied>
                  </note>
                </layer>
                <layer n="2" xml:id="layer_11016">
                  <note accid.ges="n" dur="4" oct="5" pname="d" xml:id="note_11034"/>
                </layer>
              </staff>
              <tie color="red" endid="#note_11370" staff="1" startid="#note_11034" xml:id="tie_11232"/>
            </measure>
            <measure n="35" xml:id="m35_k284_001">
              <staff n="1" xml:id="staff_11244">
                <layer n="2" xml:id="layer_11364">
                  <note accid.ges="n" color="red" dur="4" oct="5" pname="d" xml:id="note_11370"/>
                </layer>
                <layer n="1" xml:id="layer_11250">
                  <beam xml:id="beam_11256">
                    <note accid="s" color="blue" dur="8" oct="5" pname="d" xml:id="note_11262"/>
                    <note accid.ges="n" dur="8" oct="5" pname="e" xml:id="note_11268">
                      <supplied xml:id="supplied_11274">
                        <accid accid="n" xml:id="accid_11280"/>
                      </supplied>
                    </note>
                  </beam>
                </layer>
              </staff>
              <slur endid="#note_11268" staff="1" startid="#note_11262" xml:id="slur_11556"/>
            </measure>
          </section>
        </score>
      </mdiv>
    </body>
  </music>
</mei>
frakel commented 1 year ago

interesting and good to know! But then you have to keep in mind (or better add it to your documentation) the very unintuitive rule that the layer with the tied note comes always first even if it is layer-2 or 3 !? It is at least a workaround... thanks for this hint.

frakel commented 1 year ago

however, in some cases this workaround has some rendering drawbacks. As you can see here, the spacing between the quarter notes in layer-1 one is wrong: image

(Click here to see the code)

```xml note-layer order dime

```