Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lyrics overlap when placed in different layers #3843

Open
axgeertinger opened this issue Nov 1, 2024 · 5 comments
Open

Lyrics overlap when placed in different layers #3843

axgeertinger opened this issue Nov 1, 2024 · 5 comments

Comments

@axgeertinger
Copy link

axgeertinger commented Nov 1, 2024

When syllables belonging to the same verse are placed across different layers due to rhythmic variants, the spacing algorithm does not seem to be aware of collisions.

overlapping lyrics

MEI:

<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0">
 <meiHead xml:id="m1kany1y">
  <fileDesc xml:id="f11e8pzr">
   <titleStmt xml:id="tov514c">
    <title/>
   </titleStmt>
   <pubStmt xml:id="pi9o7k5">
    <date isodate="2024-11-01" type="encoding-date">2024-11-01</date>
   </pubStmt>
  </fileDesc>
 </meiHead>
 <music meiversion="5.0">
  <body>
   <mdiv xml:id="mvtoi16">
    <score xml:id="sh0ehz8">
     <scoreDef xml:id="sclg8qy">
      <staffGrp xml:id="s19aaxt5">
       <staffDef xml:id="P1" n="1" lines="5" ppq="4">
        <clef xml:id="cdia6if" shape="G" line="2"/>
        <meterSig xml:id="m1x2yam7" count="2" unit="4"/>
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="s1y139no">
      <measure xml:id="m1dgssja" n="1">
       <staff xml:id="s1m0q1i3" n="1">
        <layer xml:id="ljltyox" n="1">
         <note xml:id="n13nnjt9" dur.ppq="4" dur="4" oct="5" pname="c" stem.dir="up" accid.ges="s">
          <verse xml:id="v1f3qkbi" n="1">
           <syl xml:id="s15eld9x" con="s" wordpos="s">ei</syl>
          </verse>
         </note>
         <beam xml:id="bjh0pw7">
          <note xml:id="n1dxmf41" dur.ppq="2" dur="8" oct="4" pname="b" stem.dir="up">
           <verse xml:id="vh6l6a5" n="1">
            <syl xml:id="s19k1vdt" con="d" wordpos="i">gjen</syl>
           </verse>
           <verse xml:id="v1vajskt" n="2">
            <syl xml:id="smud4jd" con="d" wordpos="i">gjen</syl>
           </verse>
          </note>
          <note xml:id="n1qtrg5u" dur.ppq="2" dur="8" oct="4" pname="f" stem.dir="up" accid.ges="s">
           <verse xml:id="vjoavut" n="1">
            <syl xml:id="s1a0m8jh" con="s" wordpos="t">nem</syl>
           </verse>
           <verse xml:id="v12dsqhw" n="2">
            <syl xml:id="s1cyzw32" con="s" wordpos="t">nem</syl>
           </verse>
          </note>
         </beam>
        </layer>
        <layer xml:id="l1yots0t" n="2">
         <beam xml:id="b1q92ev0">
          <note xml:id="niyj1az" dots="1" dur.ppq="3" dur="8" oct="5" pname="c" stem.dir="down" accid.ges="s">
           <verse xml:id="v1d20tg2" n="2">
            <syl xml:id="s1m59zst" con="d" wordpos="i">al</syl>
           </verse>
          </note>
          <note xml:id="ndap39j" dur.ppq="1" dur="16" oct="5" pname="c" stem.dir="down" accid.ges="s">
           <verse xml:id="v1alumos" n="2">
            <syl xml:id="sketyg2" con="s" wordpos="t">drig</syl>
           </verse>
          </note>
         </beam>
         <space xml:id="s15sypgc" dur.ppq="4" dur="4"/>
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>
@lpugin
Copy link
Contributor

lpugin commented Nov 19, 2024

What would be the expected order? Do you have some publication examples?

@craigsapp
Copy link
Contributor

I would expect this layout:

Screenshot 2024-11-19 at 04 31 33

The main thing is that the first syllable of the second verse does not have an offset (unlike the first note of the second verse).

Often the first two notes for the second verse will be cue sized to increase readability.

@axgeertinger
Copy link
Author

@craigsapp Exactly. This is the printed source.
samson_pigens_sang

@lpugin
Copy link
Contributor

lpugin commented Nov 21, 2024

Unfortunately fixing this will require some in-depth refactoring of the lyric layout algorithm.

In the meantime, the best work-around I can think of is to put the beam in the second layer. This is clearly not optimal, but at least the rendering outcome it correct.

image
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0">
   <meiHead xml:id="m1kany1y">
      <fileDesc xml:id="f11e8pzr">
         <titleStmt xml:id="tov514c">
            <title/>
         </titleStmt>
         <pubStmt xml:id="pi9o7k5">
            <date isodate="2024-11-01" type="encoding-date">2024-11-01</date>
         </pubStmt>
      </fileDesc>
   </meiHead>
   <music meiversion="5.0">
      <body>
         <mdiv xml:id="mvtoi16">
            <score xml:id="sh0ehz8">
               <scoreDef xml:id="sclg8qy">
                  <staffGrp xml:id="s19aaxt5">
                     <staffDef xml:id="P1" n="1" lines="5" ppq="4">
                        <clef xml:id="cdia6if" shape="G" line="2"/>
                        <meterSig xml:id="m1x2yam7" count="2" unit="4"/>
                     </staffDef>
                  </staffGrp>
               </scoreDef>
               <section xml:id="s1y139no">
                  <measure xml:id="m1dgssja" n="1">
                     <staff xml:id="s1m0q1i3" n="1">
                        <layer xml:id="ljltyox" n="1">
                           <note xml:id="n13nnjt9" dur.ppq="4" dur="4" oct="5" pname="c" stem.dir="up" accid.ges="s">
                              <verse xml:id="v1f3qkbi" n="1">
                                 <syl xml:id="s15eld9x" con="s" wordpos="s">ei</syl>
                              </verse>
                           </note>
                           <space dur="4"></space>
                        </layer>
                        <layer xml:id="l1yots0t" n="2">
                           <beam xml:id="b1q92ev0">
                              <note xml:id="niyj1az" dots="1" dur.ppq="3" dur="8" oct="5" pname="c" stem.dir="down" accid.ges="s">
                                 <verse xml:id="v1d20tg2" n="2">
                                    <syl xml:id="s1m59zst" con="d" wordpos="i">al</syl>
                                 </verse>
                              </note>
                              <note xml:id="ndap39j" dur.ppq="1" dur="16" oct="5" pname="c" stem.dir="down" accid.ges="s">
                                 <verse xml:id="v1alumos" n="2">
                                    <syl xml:id="sketyg2" con="s" wordpos="t">drig</syl>
                                 </verse>
                              </note>
                           </beam>
                           <beam xml:id="bjh0pw7">
                              <note xml:id="n1dxmf41" dur.ppq="2" dur="8" oct="4" pname="b" stem.dir="up">
                                 <verse xml:id="vh6l6a5" n="1">
                                    <syl xml:id="s19k1vdt" con="d" wordpos="i">gjen</syl>
                                 </verse>
                                 <verse xml:id="v1vajskt" n="2">
                                    <syl xml:id="smud4jd" con="d" wordpos="i">gjen</syl>
                                 </verse>
                              </note>
                              <note xml:id="n1qtrg5u" dur.ppq="2" dur="8" oct="4" pname="f" stem.dir="up" accid.ges="s">
                                 <verse xml:id="vjoavut" n="1">
                                    <syl xml:id="s1a0m8jh" con="s" wordpos="t">nem</syl>
                                 </verse>
                                 <verse xml:id="v12dsqhw" n="2">
                                    <syl xml:id="s1cyzw32" con="s" wordpos="t">nem</syl>
                                 </verse>
                              </note>
                           </beam>
                        </layer>
                     </staff>
                  </measure>
               </section>
            </score>
         </mdiv>
      </body>
   </music>
</mei>

@axgeertinger
Copy link
Author

Okay, thanks. I'll do that for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants