MeasuringPolyphony / mp_editor

https://editor.measuringpolyphony.org
5 stars 2 forks source link

Key signatures are absent in the MEI file #83

Closed martha-thomae closed 3 years ago

martha-thomae commented 3 years ago

I entered the following characters to enter the key: k f # k c # k g # It is shown correctly in the MP-Editor and it is also encoded in the **mens (Humdrum) file.

Screen Shot 2021-02-04 at 4 53 17 PM

**mens  **text
*black  *
*clefC3 *
*k[f#c#g#]  *
sA  .
sB  .
sc  .
Sd  .
=-  =-
*-  *-
!!!RDF**kern: @ = marked note

However, it never gets into the MEI file. This is how it looks for parts:

<body>
    <mdiv>
        <parts>
            <part>
                <scoreDef>
                    <staffGrp>
                        <staffDef n="1" lines="5" notationtype="mensural.black" notationsubtype="Ars_antiqua" label="triplum" xml:id="triplum">
                            <mensur modusminor="2" tempus="3" prolatio="2"/>
                        </staffDef>
                    </staffGrp>
                </scoreDef>
                <section>
                    <staff n="1">
                        <layer n="1">
                            <pb facs="#m-408615cb-5031-4a0f-972c-9e5638dfe223" xml:id="m-ced378df-bc73-46b3-b7d3-76e4993bac8c"/>
                            <sb facs="#ma87fff54-140d-4a82-a612-30cf2cbcd074" xml:id="m-7128ca7d-1ea0-4d4d-aa32-0a4424ee210b"/>
                            <clef xml:id="m-b395c861-735e-45e4-a260-cf50cced98b0" shape="C" line="3"/>
                            <note xml:id="m-5d1d7a7f-3c0e-49e8-a05f-b96f22771680" dur="semibrevis" oct="3" pname="a"/>
                            <note xml:id="m-0a269bf8-ba59-461c-b374-e6123a99ed7c" dur="semibrevis" oct="3" pname="b"/>
                            <note xml:id="m-32a43aea-3031-4d54-aa4a-6560bfab4b55" dur="semibrevis" oct="4" pname="c"/>
                            <note xml:id="m-8e7846ac-72d6-4d20-9c17-58eb049a19af" dur="brevis" oct="4" pname="d"/>
                        </layer>
                    </staff>
                </section>
            </part>
        </parts>
    </mdiv>
</body>

These should be encoded according to the documentation on the keySig element

It should be encoded within <layer>, just after the <clef> element (following the <sb> since the clef and the key signature are given for each system in a voice):

<body>
    <mdiv>
        <parts>
            <part>
                <scoreDef>
                    <staffGrp>
                        <staffDef n="1" lines="5" notationtype="mensural.black" notationsubtype="Ars_antiqua" label="triplum" xml:id="triplum">
                            <mensur modusminor="2" tempus="3" prolatio="2"/>
                        </staffDef>
                    </staffGrp>
                </scoreDef>
                <section>
                    <staff n="1">
                        <layer n="1">
                            <pb facs="#m-408615cb-5031-4a0f-972c-9e5638dfe223" xml:id="m-ced378df-bc73-46b3-b7d3-76e4993bac8c"/>
                            <sb facs="#ma87fff54-140d-4a82-a612-30cf2cbcd074" xml:id="m-7128ca7d-1ea0-4d4d-aa32-0a4424ee210b"/>
                            <clef xml:id="m-b395c861-735e-45e4-a260-cf50cced98b0" shape="C" line="3"/>
                            <keySig sig="3s"/>
                            <note xml:id="m-5d1d7a7f-3c0e-49e8-a05f-b96f22771680" dur="semibrevis" oct="3" pname="a"/>
                            <note xml:id="m-0a269bf8-ba59-461c-b374-e6123a99ed7c" dur="semibrevis" oct="3" pname="b"/>
                            <note xml:id="m-32a43aea-3031-4d54-aa4a-6560bfab4b55" dur="semibrevis" oct="4" pname="c"/>
                            <note xml:id="m-8e7846ac-72d6-4d20-9c17-58eb049a19af" dur="brevis" oct="4" pname="d"/>
                        </layer>
                    </staff>
                </section>
            </part>
        </parts>
    </mdiv>
</body>
craigsapp commented 3 years ago

Below is the raw **mens-to-MEI conversion.

The key is there, but it is stored in the staffDef and not in the layer. I could move it to where you want according to the example. This should fix the problem, but if not, then Juliette would probably need to adjust the post-processing of the raw MEI input to preserve the keySig.

<?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-02-04T14:38:00" version="3.2.0-dev-8f1ece3-dirty">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000001354928528">
    <score xml:id="score-0000001012096771">
     <scoreDef xml:id="scoredef-0000001943024447" midi.bpm="400">
      <staffGrp xml:id="staffgrp-0000001578987368">
       <staffDef xml:id="staffdef-0000002014978026" n="1" notationtype="mensural.black" lines="5">
        <clef xml:id="clef-L3F1" shape="C" line="3" />
        <keySig xml:id="keysig-L4F1" sig="3s" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <staff xml:id="staff-0000001340314594" n="1">
       <layer xml:id="layer-L1F1N1" n="1">
        <note xml:id="note-L5F1" dur="semibrevis" oct="3" pname="a" />
        <note xml:id="note-L6F1" dur="semibrevis" oct="3" pname="b" />
        <note xml:id="note-L7F1" dur="semibrevis" oct="4" pname="c" />
        <note xml:id="note-L8F1" dur="brevis" oct="4" pname="d" />
       </layer>
      </staff>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>