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
660 stars 181 forks source link

Support for poetic text (`<div><lg>...</lg><div>`) #3749

Closed 00sapo closed 4 days ago

00sapo commented 2 weeks ago

Is your feature request related to a problem? Please describe. I'm working on a large database in the context of the ERC project Laudare. We really want to use MEI, but it's being hard to use them for visualization purpose. Our songs have no syllable-level alignment, but only verse-level alignment between music and text. Currently, we plan to show music and text separately, as in the original sources. This means that we need the text shown after the music as shown in the official docs

Describe the solution you'd like Just implement this feature

Additional context (from the official docs)

<mdiv>
   <score>
      <section>
         <!-- Score of Franz Liszt’s "Sonetto 104 del Petrarca" -->
      </section>
      <div>
         <!-- Text of Francesco Petrarca’s Sonett n. 104. -->
         <lg>
            <head>
               Sonetto 104
            </head>
            <l>L'aspectata vertù, che 'n voi fioriva</l>
            <l>quando Amor cominciò darvi bataglia,</l>
            <l>produce or frutto, che quel fiore aguaglia,</l>
            <l>et che mia speme fa venire a riva.</l>
            <!-- ... -->
         </lg>
      </div>
   </score>
</mdiv>
rettinghaus commented 2 weeks ago

I'm not getting why you need Verovio to show the text?

00sapo commented 2 weeks ago

Long story short, for the same reason why you want to have text as syllables below the staffs. The only difference here is that we don't know the syllable-level alignment.

For sure, this could be achieved with a different format for text (e.g. TEI or similar). But since for completeness the textual information will be encoded in the MEI files, it would be nice not to depend on external files to visualize texts.

Verovio is the most advanced MEI visualizer. I could theorethically convert to Lilypond, but it would be a little convoluted. I would prefere to keep things easy.

rettinghaus commented 2 weeks ago

You can use MEI files to store the lyrics and still show them without Verovio. There's no difference with TEI. And also#: Why would you want then convert it to Lilypond? Do you just want to render a PDF?

00sapo commented 2 weeks ago

You can use MEI files to store the lyrics and still show them without Verovio.

Sure, but this requires a bit of more coding, especially if you want to put the text in the same page as the music.

There's no difference with TEI. And also#: Why would you want then convert it to Lilypond? Do you just want to render a PDF?

Exactly

lpugin commented 2 weeks ago

Adding rendering or text blocs within Verovio is on the map. See for example this PR and the related discussions. However, this is meant to be used within music, or at least with music.

Could you post an example of the rendering you would want to have? Since there is no music at all in the snippet you posted, it is hard to understand your needs.

00sapo commented 2 weeks ago

Could you post an example of the rendering you would want to have?

image Full score here: https://www.cpdl.org/wiki/index.php/Quando_dal_proprio_sito_si_rimove_(Pietro_Vinci)

(I actually use neumatic notation)

lpugin commented 4 days ago

This looks more like a project specific development. You can contact me directly if you want to discuss a possible implementation.

00sapo commented 1 day ago

I understand your decision, yet seems strange to me: this formatting decision is an established practice for most of the repertoire for choir and/or voice.

lpugin commented 1 day ago

I am not against it. My main concern is that this is in my opinion a layout that is very much print oriented. If we try to reproduce this we might start making Verovio more and more a text layout engine, which is not the intention. For example, in the example above, we have two columns, which means that you need to layout text tables because the bloc layout I pointed to would not work with two blocs left aligned. Furthermore, SVG does not do automatic line breaks. These all need to be pre-calculated by the layout algorithm - not that it is a problem in this example, but I am sure one will follow. For these reasons, I consider it a low priority if the feature request is a general one about reproducing such print layouts. However, if a project has the resources to support some clearly defined developments, that is certainly possible. And so is a PR!