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
685 stars 185 forks source link

Partial layer + chord + rest interaction #1880

Closed craigsapp closed 2 years ago

craigsapp commented 3 years ago

In the following example, the chord in the first measure (marked in red) influences the quarter-note rest's vertical position in the first measure (marked in blue):

Screen Shot 2020-12-12 at 7 04 33 PM

When the chord is converted to a note, the rest moves to the correct position. The eighth-note rest is unaffected for some reason.

MEI test data:

<?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="2020-12-12T19:04:35" version="3.1.0-dev-6bf947d-dirty">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
  </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000001168176846">
    <score xml:id="score-0000001034531965">
     <scoreDef xml:id="scoredef-0000001775098597">
      <staffGrp xml:id="staffgrp-0000001200416965">
       <staffDef xml:id="staffdef-0000000980762042" n="1" lines="5">
        <clef xml:id="clef-L2F1" shape="F" line="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1">
       <staff xml:id="staff-0000000622993445" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <chord xml:id="chord-L5F1" dur="4">
          <note xml:id="note-L5F1S1" type="marked" oct="3" pname="e" color="red" accid.ges="n" />
          <note xml:id="note-L5F1S2" type="marked" oct="4" pname="c" color="red" accid.ges="n" />
         </chord>
         <note xml:id="note-L6F1" dur="8" oct="3" pname="a" accid.ges="n" />
         <space xml:id="space-L7F1" dots="1" dur="4" />
        </layer>
        <layer xml:id="layer-L2F1N2" n="2">
         <note xml:id="note-L5F2" dur="4" oct="2" pname="a" accid.ges="n" />
         <note xml:id="note-L6F2" dur="8" oct="2" pname="a" accid.ges="n" />
         <rest xml:id="rest-L7F2" dur="8" ploc="d" oloc="3" />
         <rest xml:id="rest-L8F2" dur="4" color="dodgerblue" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L10">
       <staff xml:id="staff-L10F1N1" n="1">
        <layer xml:id="layer-L10F1N1" n="1">
         <note xml:id="note-L12F1" type="marked" dur="4" oct="3" pname="e" color="red" accid.ges="n" />
         <note xml:id="note-L13F1" dur="8" oct="3" pname="a" accid.ges="n" />
         <space xml:id="space-L14F1" dots="1" dur="4" />
        </layer>
        <layer xml:id="layer-L12F2N2" n="2">
         <note xml:id="note-L12F2" dur="4" oct="2" pname="a" accid.ges="n" />
         <note xml:id="note-L13F2" dur="8" oct="2" pname="a" accid.ges="n" />
         <rest xml:id="rest-L14F2" dur="8" ploc="d" oloc="3" />
         <rest xml:id="rest-L15F2" dur="4" color="dodgerblue" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>
craigsapp commented 3 years ago

The reason that the eighth-note rest was not affected was that it was explicitly positioned on the center line. Removing the position information causes it to behave like the quarter-note rest:

Screen Shot 2020-12-16 at 12 09 32 AM
<?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="2020-12-12T19:04:35" version="3.1.0-dev-6bf947d-dirty">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
  </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000001168176846">
    <score xml:id="score-0000001034531965">
     <scoreDef xml:id="scoredef-0000001775098597">
      <staffGrp xml:id="staffgrp-0000001200416965">
       <staffDef xml:id="staffdef-0000000980762042" n="1" lines="5">
        <clef xml:id="clef-L2F1" shape="F" line="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1">
       <staff xml:id="staff-0000000622993445" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <chord xml:id="chord-L5F1" dur="4">
          <note xml:id="note-L5F1S1" type="marked" oct="3" pname="e" color="red" accid.ges="n" />
          <note xml:id="note-L5F1S2" type="marked" oct="4" pname="c" color="red" accid.ges="n" />
         </chord>
         <note xml:id="note-L6F1" dur="8" oct="3" pname="a" accid.ges="n" />
         <space xml:id="space-L7F1" dots="1" dur="4" />
        </layer>
        <layer xml:id="layer-L2F1N2" n="2">
         <note xml:id="note-L5F2" dur="4" oct="2" pname="a" accid.ges="n" />
         <note xml:id="note-L6F2" dur="8" oct="2" pname="a" accid.ges="n" />
         <rest xml:id="rest-L7F2" dur="8" />
         <rest xml:id="rest-L8F2" dur="4" color="dodgerblue" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L10">
       <staff xml:id="staff-L10F1N1" n="1">
        <layer xml:id="layer-L10F1N1" n="1">
         <note xml:id="note-L12F1" type="marked" dur="4" oct="3" pname="e" color="red" accid.ges="n" />
         <note xml:id="note-L13F1" dur="8" oct="3" pname="a" accid.ges="n" />
         <space xml:id="space-L14F1" dots="1" dur="4" />
        </layer>
        <layer xml:id="layer-L12F2N2" n="2">
         <note xml:id="note-L12F2" dur="4" oct="2" pname="a" accid.ges="n" />
         <note xml:id="note-L13F2" dur="8" oct="2" pname="a" accid.ges="n" />
         <rest xml:id="rest-L14F2" dur="8"  />
         <rest xml:id="rest-L15F2" dur="4" color="dodgerblue" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>
Monceber commented 2 years ago

image