humdrum-tools / verovio-humdrum-viewer

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

Add cdata labels that match those of text verse labels #834

Closed craigsapp closed 10 months ago

craigsapp commented 10 months ago

Example:

Screenshot 2023-09-15 at 20 25 49

Encode as:

**kern  **cdata **text
*M4/4   *   *
*   *v:harm:    *v:text:
=   =   =
1c  data    lyrics
=   =   =
*-  *-  *-

Target MEI conversion:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/dev/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.0-dev">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2023-09-15T20:15:31" version="3.17.0-dev-98a9f2d-dirty">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="m6ghpm5">
    <score xml:id="s7epfdy">
     <scoreDef xml:id="s1ks3x1i" midi.bpm="400.000000">
      <staffGrp xml:id="sl4nsqa">
       <staffDef xml:id="staffdef-L1F1" n="1" lines="5">
        <clef xml:id="cg522jk" shape="G" line="2" />
        <meterSig xml:id="metersig-L2F1" count="4" unit="4" />
       </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-L5F1" dur="1" oct="4" pname="c" accid.ges="n">
          <verse xml:id="verse-L5F3" n="1">
           <label xml:id="l1grmerc">text:</label>
           <syl xml:id="syl-L5F3">lyrics</syl>
          </verse>
         </note>
        </layer>
       </staff>
       <harm place="below" staff="1" tstamp="1" n="2">
        <rend>data</rend>
       </harm>
       <harm  place="below" staff="1" tstamp="1" n="2">
         <rend halign="right">harm:</rend>
       </harm>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

Extra non-breaking space should be added after the colon in "harm:data".

craigsapp commented 10 months ago

Implemented with commit https://github.com/rism-digital/verovio/commit/888b56567edce0a2d9b56a14a8c71b952ae592da

Example:

Screenshot 2023-09-16 at 15 45 39
Click to view MEI conversion ```xml </titleStmt> <pubStmt /> </fileDesc> <encodingDesc> <appInfo> <application isodate="2023-09-16T15:46:12" version="3.17.0-dev-98a9f2d-dirty"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="m1iqk3l3"> <score xml:id="s1h6efs2"> <scoreDef xml:id="s12lijio" midi.bpm="400.000000"> <staffGrp xml:id="sianend"> <staffDef xml:id="staffdef-L1F1" n="1" lines="5"> <clef xml:id="c1jhrib2" shape="G" line="2" /> <meterSig xml:id="metersig-L2F1" count="4" unit="4" /> </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-L5F1" dur="1" oct="4" pname="c" accid.ges="n"> <verse xml:id="verse-L5F3" n="1"> <label xml:id="l2a8l0g">text:</label> <syl xml:id="syl-L5F3">lyrics</syl> </verse> </note> </layer> </staff> <harm xml:id="harm-L5F2" place="below" staff="1" tstamp="1.000000" n="2"> <rend xml:id="r1rovg7r">data</rend> </harm> <harm xml:id="h1wxdbi9" type="key-label" place="below" staff="1" tstamp="1.000000" n="2"> <rend xml:id="r1y21t4y" halign="right"> <rend xml:id="r1guvnc0">harm:</rend> </rend> </harm> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>