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 on chords: multiple display #287

Closed
jacekiwaszko1 opened this issue Mar 10, 2020 · 3 comments
Closed

Lyrics on chords: multiple display #287

jacekiwaszko1 opened this issue Mar 10, 2020 · 3 comments

Comments

@jacekiwaszko1
Copy link
Collaborator

When lyrics are apended to chord, Verovio displays syllable twice:

**kern	**text
2c	one
=	=
2e 2c	two
=	=
2c	three
==	==
*-	*-

chord-lyrics1

In MEI code there's syllable for each note in chord:

<?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-03-10T16:53:02" version="2.6.0-dev-bc81127">
                    <name>Verovio</name>
                    <p>Transcoded from Humdrum</p>
                </application>
            </appInfo>
        </encodingDesc>
        <workList>
            <work>
                <title />
            </work>
        </workList>
    </meiHead>
    <music>
        <body>
            <mdiv xml:id="mdiv-0000001855488581">
                <score xml:id="score-0000000464725958">
                    <scoreDef xml:id="scoredef-0000001515639713">
                        <staffGrp xml:id="staffgrp-0000001530442001">
                            <staffDef xml:id="staffdef-0000001992698726" n="1" lines="5">
                                <clef xml:id="clef-0000000192544557" shape="G" line="2" />
                            </staffDef>
                        </staffGrp>
                    </scoreDef>
                    <section xml:id="section-L1F1">
                        <measure xml:id="measure-L1">
                            <staff xml:id="staff-0000000438085554" n="1">
                                <layer xml:id="layer-L1F1N1" n="1">
                                    <note xml:id="note-L2F1" dur="2" oct="4" pname="c" accid.ges="n">
                                        <verse xml:id="verse-L2F2" n="1">
                                            <syl xml:id="syl-L2F2">one</syl>
                                        </verse>
                                    </note>
                                </layer>
                            </staff>
                        </measure>
                        <measure xml:id="measure-L3">
                            <staff xml:id="staff-L3F1N1" n="1">
                                <layer xml:id="layer-L3F1N1" n="1">
                                    <chord xml:id="chord-L4F1" dur="2">
                                        <note xml:id="note-L4F1S1" oct="4" pname="e" accid.ges="n">
                                            <verse xml:id="verse-L4F2" n="1">
                                                <syl xml:id="syl-L4F2">two</syl>
                                            </verse>
                                        </note>
                                        <note xml:id="note-L4F1S2" oct="4" pname="c" accid.ges="n">
                                            <verse xml:id="verse-L4F2" n="1">
                                                <syl xml:id="syl-L4F2">two</syl>
                                            </verse>
                                        </note>
                                    </chord>
                                </layer>
                            </staff>
                        </measure>
                        <measure xml:id="measure-L5" right="end">
                            <staff xml:id="staff-L5F1N1" n="1">
                                <layer xml:id="layer-L5F1N1" n="1">
                                    <note xml:id="note-L6F1" dur="2" oct="4" pname="c" accid.ges="n">
                                        <verse xml:id="verse-L6F2" n="1">
                                            <syl xml:id="syl-L6F2">three</syl>
                                        </verse>
                                    </note>
                                </layer>
                            </staff>
                        </measure>
                    </section>
                </score>
            </mdiv>
        </body>
    </music>
</mei>

I tried to attach syllable to chord in MEI, but I failed - it looks to me, that it is impossible but maybe I'm doing something wrong.

If that's true, attaching a syllable to only first (or last) note in chord looks like a solution:

<?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-03-10T16:58:25" version="2.6.0-dev-bc81127">
                    <name>Verovio</name>
                    <p>Transcoded from Humdrum</p>
                </application>
            </appInfo>
        </encodingDesc>
        <workList>
            <work>
                <title />
            </work>
        </workList>
    </meiHead>
    <music>
        <body>
            <mdiv xml:id="mdiv-0000001497428971">
                <score xml:id="score-0000001269030020">
                    <scoreDef xml:id="scoredef-0000000656834710">
                        <staffGrp xml:id="staffgrp-0000000746850759">
                            <staffDef xml:id="staffdef-0000001208966410" n="1" lines="5">
                                <clef xml:id="clef-0000001972324105" shape="G" line="2" />
                            </staffDef>
                        </staffGrp>
                    </scoreDef>
                    <section xml:id="section-L1F1">
                        <measure xml:id="measure-L1">
                            <staff xml:id="staff-0000001096126289" n="1">
                                <layer xml:id="layer-L1F1N1" n="1">
                                    <note xml:id="note-L2F1" dur="2" oct="4" pname="c" accid.ges="n">
                                        <verse xml:id="verse-L2F2" n="1">
                                            <syl xml:id="syl-L2F2">one</syl>
                                        </verse>
                                    </note>
                                </layer>
                            </staff>
                        </measure>
                        <measure xml:id="measure-L3">
                            <staff xml:id="staff-L3F1N1" n="1">
                                <layer xml:id="layer-L3F1N1" n="1">
                                    <chord xml:id="chord-L4F1" dur="2">
                                        <note xml:id="note-L4F1S1" oct="4" pname="e" accid.ges="n">
                                            <verse xml:id="verse-L4F2" n="1">
                                                <syl xml:id="syl-L4F2">two</syl>
                                            </verse>
                                        </note>
                                        <note xml:id="note-L4F1S2" oct="4" pname="c" accid.ges="n" />
                                    </chord>
                                </layer>
                            </staff>
                        </measure>
                        <measure xml:id="measure-L5" right="end">
                            <staff xml:id="staff-L5F1N1" n="1">
                                <layer xml:id="layer-L5F1N1" n="1">
                                    <note xml:id="note-L6F1" dur="2" oct="4" pname="c" accid.ges="n">
                                        <verse xml:id="verse-L6F2" n="1">
                                            <syl xml:id="syl-L6F2">three</syl>
                                        </verse>
                                    </note>
                                </layer>
                            </staff>
                        </measure>
                    </section>
                </score>
            </mdiv>
        </body>
    </music>
</mei>

Target rendering:

chord-lyrics2

craigsapp added a commit to rism-digital/verovio that referenced this issue Mar 10, 2020
@craigsapp
Copy link
Member

The encoding method in MEI and rendering behavior in verovio of verses and chords keeps changing.

See issues rism-digital/verovio#969 and rism-digital/verovio#267

Relevant discussion from that issue:

Or a more rational thing to do is to allow <verse> to be attached to <chord> so that this problem is impossible to occur 😛

😜

In MEI 4.0, chords are now allowed to contain verses:

https://music-encoding.org/guidelines/v4/elements/chord.html

Screen Shot 2020-03-10 at 09 26 06

But this has not yet been updated in verovio. Previously it was required to duplicate the syllable on both notes in order to get the text to display in verovio, but there were misalignment problems with the overstruck text.

For now I have limited placement of the verses to the first note in a chord in commit rism-digital/verovio@606fd3b

Screen Shot 2020-03-10 at 09 58 27

MEI conversion, showing verse on first note of chord only:

<?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-03-10T09:58:50" version="2.6.0-dev-606fd3b">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000001255711147">
    <score xml:id="score-0000000208786641">
     <scoreDef xml:id="scoredef-0000001905825959">
      <staffGrp xml:id="staffgrp-0000000952426229">
       <staffDef xml:id="staffdef-0000000920969044" n="1" lines="5">
        <clef xml:id="clef-0000000033375364" shape="G" line="2" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1">
       <staff xml:id="staff-0000001332919464" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L2F1" dur="2" oct="4" pname="c" accid.ges="n">
          <verse xml:id="verse-L2F2" n="1">
           <syl xml:id="syl-L2F2">one</syl>
          </verse>
         </note>
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L3">
       <staff xml:id="staff-L3F1N1" n="1">
        <layer xml:id="layer-L3F1N1" n="1">
         <chord xml:id="chord-L4F1" dur="2">
          <note xml:id="note-L4F1S1" oct="4" pname="e" accid.ges="n">
           <verse xml:id="verse-L4F2" n="1">
            <syl xml:id="syl-L4F2">two</syl>
           </verse>
          </note>
          <note xml:id="note-L4F1S2" oct="4" pname="c" accid.ges="n" />
         </chord>
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L5" right="end">
       <staff xml:id="staff-L5F1N1" n="1">
        <layer xml:id="layer-L5F1N1" n="1">
         <note xml:id="note-L6F1" dur="2" oct="4" pname="c" accid.ges="n">
          <verse xml:id="verse-L6F2" n="1">
           <syl xml:id="syl-L6F2">three</syl>
          </verse>
         </note>
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

When verovio implements <verse> attached to <chord> then I will fix it again.

@craigsapp
Copy link
Member

See also rism-digital/verovio#1337

@craigsapp
Copy link
Member

Pull request rism-digital/verovio@098781c implements the MEI 4.0 feature of allowing <verse> to be attached directly to <chord> rather than <notes> only.

So now lyrics will attach to chords in the Humdrum-to-MEI conversion: rism-digital/verovio@098781c

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

2 participants