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

line break in tempo marking interaction with square brackets #869

Open
craigsapp opened this issue Jan 12, 2024 · 2 comments
Open

line break in tempo marking interaction with square brackets #869

craigsapp opened this issue Jan 12, 2024 · 2 comments
Assignees

Comments

@craigsapp
Copy link
Member

In this example:

**kern
*clefF4
!!LO:TX:tempo:a:t=Più mosso\n[quarter-dot]=66
*M3/8
=38
4C
4D/
4E
4F
=
1G
==
*-
Screenshot 2024-01-12 at 09 23 27

There should be a line break after mosso, but the square bracket is preventing the linebreak:

**kern
*clefF4
!!LO:TX:tempo:a:t=Più mosso\nquarter-dot]=66
*M3/8
=38
4C
4D/
4E
4F
=
1G
==
*-
Screenshot 2024-01-12 at 09 24 09
@craigsapp craigsapp self-assigned this Jan 12, 2024
craigsapp added a commit to rism-digital/verovio that referenced this issue Jan 23, 2024
@craigsapp
Copy link
Member Author

craigsapp commented Jan 23, 2024

Commit rism-digital/verovio@55ec0f8 forces text with newline (<lb>) to be enclosed in a <rend>. This may be required (although this now seems to be optional in verovio).

However there is a strange behavior in verovio: when converting from Humdrum into verovio directly, the <lb> is ignored whether the text is enclosed in a <rend> or not.

When converting Humdrum data into MEI and then loading that MEI data into verovio, the <lb> is not ignored (whether the text is enclosed in a <rend> or not.

Example:

**kern
!LO:TX:a:t=Allegro\n[quarter]=120
1c
*-

Direct rendering with verovio:

Screenshot 2024-01-22 at 22 55 01
Click to view MEI data for above example (output conversion from Humdrum data)
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/5.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/5.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt>
    <unpub>This MEI file was created by Verovio's Humdrum converter. When published, this unpub element should be removed, and the enclosing pubStmt element should be properly filled out.</unpub>
   </pubStmt>
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2024-01-22T22:55:51" version="4.2.0-dev-80ec72d">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <extMeta>
   <frames xmlns="http://www.humdrum.org/ns/humxml" />
  </extMeta>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="m1h8vudq">
    <score xml:id="scqoc7k">
     <scoreDef xml:id="sls267m" midi.bpm="400.000000">
      <staffGrp xml:id="stnyj44">
       <staffDef xml:id="staffdef-L1F1" n="1" lines="5">
        <clef xml:id="cpnl3w7" shape="G" line="2" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" right="invis">
       <staff xml:id="staff-L1F1" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L3F1" dur="1" oct="4" pname="c" accid.ges="n" />
        </layer>
       </staff>
       <tempo xml:id="tempo-L3F1" place="above" staff="1" tstamp="1.000000">
        <rend xml:id="rgi3w8m">Allegro<lb xml:id="lsqb6fi" />
         <symbol xml:id="swk2v3e" glyph.auth="smufl" glyph.name="metNoteQuarterUp" fontsize="70.00%" /> = 120</rend>
       </tempo>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

If the converted MEI is then loaded into verovio, the line break is present as expected in the output SVG:

Screenshot 2024-01-22 at 22 57 25

If a space is added before the [quarter] symbol in the Humdrum data:

**kern
!LO:TX:a:t=Allegro\n [quarter]=120
1c
*-

The direct conversion from Humdrum to SVG with verovio will add the linebreak:

Screenshot 2024-01-22 at 22 58 52
Click to view MEI conversion of above Humdrum data
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/5.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/5.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt>
    <unpub>This MEI file was created by Verovio's Humdrum converter. When published, this unpub element should be removed, and the enclosing pubStmt element should be properly filled out.</unpub>
   </pubStmt>
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2024-01-22T23:01:11" version="4.2.0-dev-80ec72d">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <extMeta>
   <frames xmlns="http://www.humdrum.org/ns/humxml" />
  </extMeta>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="m18tw7lh">
    <score xml:id="s1ssfxay">
     <scoreDef xml:id="svpalys" midi.bpm="400.000000">
      <staffGrp xml:id="seln8j8">
       <staffDef xml:id="staffdef-L1F1" n="1" lines="5">
        <clef xml:id="c1iou3zg" shape="G" line="2" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" right="invis">
       <staff xml:id="staff-L1F1" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L3F1" dur="1" oct="4" pname="c" accid.ges="n" />
        </layer>
       </staff>
       <tempo xml:id="tempo-L3F1" place="above" staff="1" tstamp="1.000000">
        <rend xml:id="rjuj5r1">Allegro<lb xml:id="lg8e0nj" /> <symbol xml:id="s1royt93" glyph.auth="smufl" glyph.name="metNoteQuarterUp" fontsize="70.00%" /> = 120</rend>
       </tempo>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

The converted <tempo> contents for the first example:

       <tempo xml:id="tempo-L3F1" place="above" staff="1" tstamp="1.000000">
        <rend xml:id="rgi3w8m">Allegro<lb xml:id="lsqb6fi" />
         <symbol xml:id="swk2v3e" glyph.auth="smufl" glyph.name="metNoteQuarterUp" fontsize="70.00%" /> = 120</rend>
       </tempo>

And the converted <tempo> contents for the second example with the added whitespace before the symbol:

       <tempo xml:id="tempo-L3F1" place="above" staff="1" tstamp="1.000000">
        <rend xml:id="rjuj5r1">Allegro<lb xml:id="lg8e0nj" /> <symbol xml:id="s1royt93" glyph.auth="smufl" glyph.name="metNoteQuarterUp" fontsize="70.00%" /> = 120</rend>
       </tempo>

One possible solution is to force a space after a newline when processing Humdrum data, although that will shift the text on the second line slightly to the right.

@craigsapp
Copy link
Member Author

See issue rism-digital/verovio#3576

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

No branches or pull requests

1 participant