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

Combined display of mensural and cmn notation #3574

Open craigsapp opened 9 months ago

craigsapp commented 9 months ago

It would be useful to display both mensural an CMN notation in the same score.

The current idea is to use @tstamp (and/or @startid) to link the mensural notes (& etc.) to link to CMN content.

Here is some basic example data:

Screenshot 2024-01-21 at 23 49 18
Click to view MEI data for above example ```xml </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-21T23:47:45" 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="m1nwdsx9"> <score xml:id="s6q5cyl"> <scoreDef xml:id="ssds15j" midi.bpm="400.000000"> <staffGrp xml:id="sj8jzz"> <staffDef xml:id="staffdef-L1F1" n="1" lines="5"> <clef xml:id="clef-L2F1" shape="C" line="3" /> <meterSig xml:id="metersig-L3F1" count="3" unit="1" visible="false" /> <mensur xml:id="mensur-L4F1" sign="O" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1"> <staff xml:id="staff-L1F1" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L6F1" dur="breve" oct="4" pname="c" accid.ges="n" /> <note xml:id="note-L7F1" dur="2" oct="4" pname="d" accid.ges="n" /> <note xml:id="note-L8F1" dur="2" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L9" n="2"> <staff xml:id="staff-L9F1N1" n="1"> <layer xml:id="layer-L9F1N1" n="1"> <note xml:id="note-L10F1" dots="1" dur="breve" oct="3" pname="b" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L11" n="3"> <staff xml:id="staff-L11F1N1" n="1"> <layer xml:id="layer-L11F1N1" n="1"> <note xml:id="note-L12F1" dur="1" oct="4" pname="d" accid.ges="n" /> <note xml:id="note-L13F1" dur="breve" oct="3" pname="b" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L14" right="end" n="4"> <staff xml:id="staff-L14F1N1" n="1"> <layer xml:id="layer-L14F1N1" n="1"> <note xml:id="note-L15F1" dots="1" dur="breve" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>Mensural equivalent:</p> <img width="357" alt="Screenshot 2024-01-21 at 23 51 29" src="https://github.com/rism-digital/verovio/assets/3487289/41b6934f-d563-4f52-ac7e-1a71b0aa3694"> <details> <summary> Click to view MEI data for above example </summary> ```xml <?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-21T23:50:32" version="4.2.0-dev-80ec72d"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> </meiHead> <music> <body> <mdiv xml:id="mymglpa"> <score xml:id="s9te1zv"> <scoreDef xml:id="s1y05sip" midi.bpm="280.000000"> <staffGrp xml:id="sdxra14"> <staffDef xml:id="staffdef-L1F1" n="1" notationtype="mensural.white" lines="5"> <clef xml:id="clef-L2F1" shape="C" line="3" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <staff xml:id="staff-L1F1" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <mensur xml:id="mensur-L4F1" modusmaior="2" modusminor="2" prolatio="2" tempus="3" sign="O" /> <note xml:id="note-L6F1" dur="brevis" dur.quality="imperfecta" oct="4" pname="c" /> <note xml:id="note-L7F1" dur="minima" oct="4" pname="d" /> <note xml:id="note-L8F1" dur="minima" oct="4" pname="c" /> <note xml:id="note-L10F1" dur="brevis" oct="3" pname="b" /> <dot xml:id="d8utdje" form="div" /> <note xml:id="note-L12F1" dur="semibrevis" oct="4" pname="d" /> <note xml:id="note-L13F1" dur="brevis" dur.quality="imperfecta" oct="3" pname="b" /> <note xml:id="note-L15F1" dur="brevis" dur.quality="perfecta" oct="4" pname="c" /> <barLine xml:id="barline-L16F1" form="dbl" /> </layer> </staff> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>The CMN would be on the bottom staff (in this two-staff example), with the mensural music above it.</p> <p>Ideally the CMN music would have solid barlines through the staff as shown above, and optionally dashed line going up to the bottom staff line of the mensural staff (a form of <a rel="noreferrer nofollow" target="_blank" href="https://en.wikipedia.org/wiki/Mensurstrich">Mensurstrich</a> but using dashed connecting line rather than a solid line. The Mensurstricht would be useful since ideally this would be used with scores containing multiple pairs of staves in CMN and mensural music (which would be interleaved in pairs).</p> <p>The dot of division/augmentation in the mensural notation needs to be considered. If the <code>@tstamp</code> is the same as a note, then the dot should be moved to be after the note (as opposed to overstriking the note). In this case the dot could be given a <code>@tstamp</code> of 2 to place somewhere after the note which precedes it.</p> <p>Or maybe <code>@startid</code> will be more convenient, particularly if <code><barLine></code> is used instead of <code><measure></code>. (Mensural notes will often cross barlines, so a bit difficult to use <code><measure></code> for the mensural content. But then there will likely be problems for placing items that are not attached to a note such as the <code><dot></code> in this example. Perhaps these elements could be placed automatically between adjacent items which are linked with <code>@startid</code>...</p> <p>@pero can also comment on how this might be implemented.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/lpugin"><img src="https://avatars.githubusercontent.com/u/689412?v=4" />lpugin</a> commented <strong> 1 month ago</strong> </div> <div class="markdown-body"> <p>This is now simpler with the refactoring of the duration alignment prepared in the <a href="https://github.com/rism-digital/verovio/pull/3806">PR</a>.</p> <p>Mensural notation in tempus imperfectum and prolatio minor aligns automatically (i.e., aligning whole notes with semibrevis and so on for durations up and down)</p> <p>Of course, this still requires the mensural notation to be put in measures, so this change is only about the alignment of the duration themselves.</p> <p><em>(edited)</em></p> <img width="964" alt="image" src="https://github.com/user-attachments/assets/15b57648-0219-4d84-a508-30d368260bc8"> <details> ```xml <?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>CMN aligned with mensural notation in tempus imperfectum and prolatio minor Verovio

Transcoded from Humdrum

```

With tempus perfectum and or prolatio maior, then duration shorter than a breve in CMN need to be put into tuplets with the appropriate adjustments. See here num="3" and numbase="2" for the whole notes num="9" and numbase="4" for the half notes and shorter.

image
```xml CMN aligned with mensural notation in tempus perfectum and prolatio maior Verovio

Transcoded from Humdrum

```