humdrum-tools / verovio-humdrum-viewer

Verovio Humdrum Viewer
http://verovio.humdrum.org
37 stars 9 forks source link

Add mensural refinement to **mens #530

Closed craigsapp closed 3 years ago

craigsapp commented 3 years ago

Mensuration signs indicate the tempus (breve) and prolation (semibreve) rhythmic levels split into notes at the next shorter rhythmic level. Sometimes the minor modus is given as well, but not consistently.

@martha-thomae suggest using the following system to give explicit qualification of the mensuration, which are currently implemented in Muret (correct @davidrizo?):

In other words, the explicit rhythmic level splits can be given after the mensuration sign by prefixing an underscore and then for digits that give the explicit number of notes in the next shorter rhythmic level that add up to get the next higher level. The order of the digits is as above (major mode -- how many longs make one maxima; minor mode -- how many breves make one long; tempus -- how many semibreves make a breve; and prolation -- how many minims make one semibreve).

A mensuration sign such as C typically has the rhythmic splits as listed above. @matha-thomae: should I guess at these parameters based on the expected splits for common mensuration signs if they are unspecified? In other words, should *met(C) be interpreted as *met(C)_2222?

*met(C), etc. already include an implicit assignment for mensur@tempus and mensur@prolatio:

Screen Shot 2021-01-17 at 11 10 29 PM
**mens
*clefC3
*met(C)
Sc
Sc
sd
se
*-

Current MEI conversion:

<?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="2021-01-17T23:12:03" version="3.2.0-dev-219f1ca-dirty">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000000380326102">
    <score xml:id="score-0000000436289446">
     <scoreDef xml:id="scoredef-0000000801326946" midi.bpm="400">
      <staffGrp xml:id="staffgrp-0000000637758566">
       <staffDef xml:id="staffdef-0000000295394397" n="1" notationtype="mensural.white" lines="5">
        <clef xml:id="clef-L2F1" shape="C" line="3" />
        <mensur xml:id="mensur-L3F1" prolatio="2" tempus="2" sign="C" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <staff xml:id="staff-0000001865861324" n="1">
       <layer xml:id="layer-L1F1N1" n="1">
        <note xml:id="note-L4F1" dur="brevis" oct="4" pname="c" />
        <note xml:id="note-L5F1" dur="brevis" oct="4" pname="c" />
        <note xml:id="note-L6F1" dur="semibrevis" oct="4" pname="d" />
        <note xml:id="note-L7F1" dur="semibrevis" oct="4" pname="e" />
       </layer>
      </staff>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

The attributes mensur@modusmaior, mensur@modusminor, mensur@tempus and mensur@prolatio are in MEI 4: https://music-encoding.org/guidelines/v4/elements/mensur.html

mensur@tempus can be up to 9 in ars nova music.

craigsapp commented 3 years ago

Implemented in commit https://github.com/rism-ch/verovio/commit/917cad1a42e9f69b118f1403499b3a91385a9a87

Example:

**mens
*clefC3
*met(C)_3333
Lc
*-

Converts to:

<?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="2021-01-17T23:42:42" version="3.2.0-dev-219f1ca-dirty">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000001262624317">
    <score xml:id="score-0000001640979812">
     <scoreDef xml:id="scoredef-0000002007154205" midi.bpm="400">
      <staffGrp xml:id="staffgrp-0000000734524340">
       <staffDef xml:id="staffdef-0000001842688650" n="1" notationtype="mensural.white" lines="5">
        <clef xml:id="clef-L2F1" shape="C" line="3" />
        <mensur xml:id="mensur-L3F1" modusmaior="3" modusminor="3" prolatio="3" tempus="3" sign="C" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <staff xml:id="staff-0000001060051806" n="1">
       <layer xml:id="layer-L1F1N1" n="1">
        <note xml:id="note-L4F1" dur="longa" oct="4" pname="c" />
       </layer>
      </staff>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

If the rhythm-level split information is not given, the expected values are given (major and minor modes are added, but prolation and tempus were already added previously)

**mens
*clefC3
*met(C)
Lc
*-

Converts to:

<?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="2021-01-17T23:42:42" version="3.2.0-dev-219f1ca-dirty">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000001262624317">
    <score xml:id="score-0000001640979812">
     <scoreDef xml:id="scoredef-0000002007154205" midi.bpm="400">
      <staffGrp xml:id="staffgrp-0000000734524340">
       <staffDef xml:id="staffdef-0000001842688650" n="1" notationtype="mensural.white" lines="5">
        <clef xml:id="clef-L2F1" shape="C" line="3" />
        <mensur xml:id="mensur-L3F1" modusmaior="3" modusminor="3" prolatio="3" tempus="3" sign="C" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <staff xml:id="staff-0000001060051806" n="1">
       <layer xml:id="layer-L1F1N1" n="1">
        <note xml:id="note-L4F1" dur="longa" oct="4" pname="c" />
       </layer>
      </staff>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

Still to do: add documentation about explicit mensural information to the page http://doc.verovio.humdrum.org/humdrum/mens

craigsapp commented 3 years ago

If any of the four digits (primarily the first two for the modus maior and modus minor) is zero, then that means it is undefined, and should not be converted into an MEI conversion.

**mens
*clefC3
*met(C)_0022
Lc
*-
craigsapp commented 3 years ago

Updated implementation in https://github.com/rism-ch/verovio/commit/fbf8c9ce12ee8a904aa734dc9b73f7b99382d8f6

Now 0 in any of the four positions will mean that it is unknown/undefined for that rhythmic levels.

Also, the division numbers for each level are optional at the end, so for example *met(O)_32 would mean: