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

Tight kerning interaction with trills #2261

Closed craigsapp closed 3 years ago

craigsapp commented 3 years ago

The new tighter kerning for the music is great, but here is an example of where it goes too far:

Screen Shot 2021-06-22 at 5 15 02 PM

Original typesetting:

Screen Shot 2021-06-22 at 5 16 43 PM

The kerned note should not obstruct the visual connection of the trill to the note to which is applies. The current view is confusing since it almost seems as if the tr belongs to the previous note.

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="2021-06-22T17:15:13" version="3.5.0-dev-f4e4021">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
  <extMeta>
   <frames xmlns="http://www.humdrum.org/ns/humxml">
    <metaFrame n="24" token="!!!RDF**kern: > = above" xml:id="L25">
     <frameInfo>
      <startTime float="2" />
      <frameType>reference</frameType>
      <referenceKey>RDF**kern</referenceKey>
      <referenceValue>&gt; = above</referenceValue>
     </frameInfo>
    </metaFrame>
    <metaFrame n="25" token="!!!RDF**kern: &lt; = below" xml:id="L26">
     <frameInfo>
      <startTime float="2" />
      <frameType>reference</frameType>
      <referenceKey>RDF**kern</referenceKey>
      <referenceValue>&lt; = below</referenceValue>
     </frameInfo>
    </metaFrame>
   </frames>
  </extMeta>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000002128796117">
    <score xml:id="score-0000000454367149">
     <scoreDef xml:id="scoredef-0000000021343960" midi.bpm="80">
      <staffGrp xml:id="staffgrp-0000001841551654" bar.thru="true" symbol="brace">
       <staffDef xml:id="staffdef-0000000197068714" n="1" lines="5">
        <clef xml:id="clef-L2F2" shape="G" line="2" />
        <keySig xml:id="keysig-L3F2" pname="a" mode="major" sig="3s" />
        <meterSig xml:id="metersig-L5F2" count="2" unit="4" />
       </staffDef>
       <staffDef xml:id="staffdef-0000002029752761" n="2" lines="5">
        <clef xml:id="clef-L2F1" shape="F" line="4" />
        <keySig xml:id="keysig-L3F1" pname="a" mode="major" sig="3s" />
        <meterSig xml:id="metersig-L5F1" count="2" unit="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <pb xml:id="pb-0000000546391569" />
      <measure xml:id="measure-L1" n="47">
       <staff xml:id="staff-0000000799772086" n="1">
        <layer xml:id="layer-L1F2N1" n="1">
         <tuplet xml:id="tuplet-L9F2-L11F2" num="3" numbase="2" num.visible="false" bracket.visible="false" num.format="count">
          <beam xml:id="beam-L9F2-L11F2">
           <note xml:id="note-L9F2" dur="16" oct="5" pname="e" accid.ges="n" />
           <note xml:id="note-L10F2" dur="16" oct="5" pname="g" accid.ges="s" />
           <note xml:id="note-L11F2" dur="16" oct="5" pname="a" accid.ges="n" />
          </beam>
         </tuplet>
         <tuplet xml:id="tuplet-L12F2-L14F2" num="3" numbase="2" num.visible="false" bracket.visible="false" num.format="count">
          <beam xml:id="beam-L12F2-L14F2">
           <note xml:id="note-L12F2" dur="16" oct="5" pname="a" accid.ges="n" />
           <note xml:id="note-L13F2" dur="16" oct="5" pname="g" accid.ges="s" />
           <note xml:id="note-L14F2" dur="16" oct="5" pname="a" accid.ges="n">
            <artic xml:id="artic-L14F2" artic="stacciss" />
           </note>
          </beam>
         </tuplet>
         <note xml:id="note-L15F2" dur="4" oct="5" pname="e" accid.ges="n" />
         <note xml:id="note-L21F2" dur="16" oct="5" pname="d" grace="acc" accid="s" />
        </layer>
       </staff>
       <staff xml:id="staff-0000001412157761" n="2">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L9F1" dur="4" oct="4" pname="c" accid.ges="s" />
         <tuplet xml:id="tuplet-L15F1-L17F1" num="3" numbase="2" num.visible="false" bracket.visible="false" num.format="count">
          <beam xml:id="beam-L15F1-L17F1">
           <note xml:id="note-L15F1" dur="16" oct="3" pname="e" accid.ges="n" />
           <note xml:id="note-L16F1" dur="16" oct="3" pname="g" accid.ges="s" />
           <note xml:id="note-L17F1" dur="16" oct="3" pname="b" accid.ges="n" />
          </beam>
         </tuplet>
         <tuplet xml:id="tuplet-L18F1-L20F1" num="3" numbase="2" num.visible="false" bracket.visible="false" num.format="count">
          <beam xml:id="beam-L18F1-L20F1">
           <note xml:id="note-L18F1" dur="16" oct="3" pname="g" accid.ges="s" />
           <note xml:id="note-L19F1" dur="16" oct="3" pname="b" accid.ges="n" />
           <note xml:id="note-L20F1" dur="16" oct="4" pname="d" accid.ges="n" />
          </beam>
         </tuplet>
        </layer>
       </staff>
       <slur xml:id="slur-L12F2-L14F2" staff="1" startid="#note-L12F2" endid="#note-L14F2" />
       <dir xml:id="dir-L15F3" staff="1" tstamp="2.000000">cresc.</dir>
       <trill xml:id="trill-L15F2" staff="1" startid="#note-L15F2" endid="#note-L21F2" />
      </measure>
      <sb xml:id="sb-L23F1" type="z" />
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

Example in situ: https://verovio.humdrum.org/?file=haydn/sonatas/sonata12-1.krn#mh47

lpugin commented 3 years ago

Working of a fix. image

Should also improves other cases. For example, the spacing of notes remains regular here (before / after) image

image

lpugin commented 3 years ago

Fixed with #2258