humdrum-tools / verovio-humdrum-viewer

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

Do not add spaces to single letter sub-syllables in elisions #856

Closed craigsapp closed 1 year ago

craigsapp commented 1 year ago

Elision sub-syllables that contain a single letter are having a non-breaking spaced added to them (see issue https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/853).

The spaces in the sub-syllables should be supporessed when they are part of an elision.

Example:

Screenshot 2023-10-04 at 08 53 43

View in VHV

Click to view current MEI conversion ```xml </titleStmt> <pubStmt /> </fileDesc> <encodingDesc> <appInfo> <application isodate="2023-10-04T08:55:12" version="4.1.0-dev-82197ef-dirty"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="m1trolyl"> <score xml:id="s2soktr"> <scoreDef xml:id="s1dmutra" midi.bpm="400.000000"> <staffGrp xml:id="s1syczfm"> <staffDef xml:id="staffdef-L1F1" n="1" lines="5"> <clef xml:id="c1o84dtu" shape="G" line="2" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" right="invis"> <staff xml:id="staff-L1F1" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L2F1" dur="1" oct="4" pname="c" accid.ges="n"> <verse xml:id="verse-L2F2" n="1"> <syl xml:id="syl-L2F2" con="b"> a</syl> <syl xml:id="syl-L2F2S2"> b</syl> </verse> </note> <note xml:id="note-L3F1" dur="1" oct="4" pname="c" accid.ges="n"> <verse xml:id="verse-L3F2" n="1"> <syl xml:id="syl-L3F2" con="b">aa</syl> <syl xml:id="syl-L3F2S2"> b</syl> </verse> </note> <note xml:id="note-L4F1" dur="1" oct="4" pname="c" accid.ges="n"> <verse xml:id="verse-L4F2" n="1"> <syl xml:id="syl-L4F2" con="b"> a</syl> <syl xml:id="syl-L4F2S2">bb</syl> </verse> </note> <note xml:id="note-L5F1" dur="1" oct="4" pname="c" accid.ges="n"> <verse xml:id="verse-L5F2" n="1"> <syl xml:id="syl-L5F2" con="b">aa</syl> <syl xml:id="syl-L5F2S2">bb</syl> </verse> </note> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>Target rendering without padding spaces:</p> <img width="666" alt="Screenshot 2023-10-04 at 08 56 53" src="https://github.com/humdrum-tools/verovio-humdrum-viewer/assets/3487289/944dfffe-8fc5-4d90-8bf8-6887f5d2a173"> <details> <summary> Click to view MEI conversion 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 /> </fileDesc> <encodingDesc> <appInfo> <application isodate="2023-10-04T08:56:35" version="4.1.0-dev-82197ef-dirty"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="m1r1adps"> <score xml:id="s1ee12ii"> <scoreDef xml:id="sfaz0mp" midi.bpm="400.000000"> <staffGrp xml:id="s1ccvctc"> <staffDef xml:id="staffdef-L1F1" n="1" lines="5"> <clef xml:id="cami135" shape="G" line="2" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" right="invis"> <staff xml:id="staff-L1F1" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L2F1" dur="1" oct="4" pname="c" accid.ges="n"> <verse xml:id="verse-L2F2" n="1"> <syl xml:id="syl-L2F2" con="b">a</syl> <syl xml:id="syl-L2F2S2">b</syl> </verse> </note> <note xml:id="note-L3F1" dur="1" oct="4" pname="c" accid.ges="n"> <verse xml:id="verse-L3F2" n="1"> <syl xml:id="syl-L3F2" con="b">aa</syl> <syl xml:id="syl-L3F2S2">b</syl> </verse> </note> <note xml:id="note-L4F1" dur="1" oct="4" pname="c" accid.ges="n"> <verse xml:id="verse-L4F2" n="1"> <syl xml:id="syl-L4F2" con="b">a</syl> <syl xml:id="syl-L4F2S2">bb</syl> </verse> </note> <note xml:id="note-L5F1" dur="1" oct="4" pname="c" accid.ges="n"> <verse xml:id="verse-L5F2" n="1"> <syl xml:id="syl-L5F2" con="b">aa</syl> <syl xml:id="syl-L5F2S2">bb</syl> </verse> </note> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/craigsapp"><img src="https://avatars.githubusercontent.com/u/3487289?v=4" />craigsapp</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>Implemented with commit <a href="https://github.com/rism-digital/verovio/commit/b3d4df4918cbb77eebcacecd01be3da8d62b10c5">https://github.com/rism-digital/verovio/commit/b3d4df4918cbb77eebcacecd01be3da8d62b10c5</a></p> <p>Example, where the red note is the only case where a space should be added:</p> <img width="1068" alt="Screenshot 2023-10-04 at 09 23 55" src="https://github.com/humdrum-tools/verovio-humdrum-viewer/assets/3487289/28672d31-9a25-4492-8c00-3877d2e0f897"> <pre><code class="language-tsv">**kern **text 1c a b 1c aa b 1c a bb 1c aa bb 1c@ a 1c aa *- *- !!!RDF**kern: @ = marked note</code></pre> <details> <summary> Click to view MEI conversion of above Humdrum data </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 /> </fileDesc> <encodingDesc> <appInfo> <application isodate="2023-10-04T09:24:55" version="4.1.0-dev-82197ef-dirty"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> <extMeta> <frames xmlns="http://www.humdrum.org/ns/humxml"> <metaFrame n="8" token="!!!RDF**kern: @ = marked note" xml:id="L9"> <frameInfo> <startTime float="24" /> <frameType>reference</frameType> <referenceKey>RDF**kern</referenceKey> <referenceValue>@ = marked note</referenceValue> </frameInfo> </metaFrame> </frames> </extMeta> </meiHead> <music> <body> <mdiv xml:id="m1gx1hrc"> <score xml:id="s1nisoj1"> <scoreDef xml:id="s1m5f58j" midi.bpm="400.000000"> <staffGrp xml:id="sc4nbow"> <staffDef xml:id="staffdef-L1F1" n="1" lines="5"> <clef xml:id="c171vf53" shape="G" line="2" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" right="invis"> <staff xml:id="staff-L1F1" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L2F1" dur="1" oct="4" pname="c" accid.ges="n"> <verse xml:id="verse-L2F2" color="black" n="1"> <syl xml:id="syl-L2F2" con="b">a</syl> <syl xml:id="syl-L2F2S2">b</syl> </verse> </note> <note xml:id="note-L3F1" dur="1" oct="4" pname="c" accid.ges="n"> <verse xml:id="verse-L3F2" color="black" n="1"> <syl xml:id="syl-L3F2" con="b">aa</syl> <syl xml:id="syl-L3F2S2">b</syl> </verse> </note> <note xml:id="note-L4F1" dur="1" oct="4" pname="c" accid.ges="n"> <verse xml:id="verse-L4F2" color="black" n="1"> <syl xml:id="syl-L4F2" con="b">a</syl> <syl xml:id="syl-L4F2S2">bb</syl> </verse> </note> <note xml:id="note-L5F1" dur="1" oct="4" pname="c" accid.ges="n"> <verse xml:id="verse-L5F2" color="black" n="1"> <syl xml:id="syl-L5F2" con="b">aa</syl> <syl xml:id="syl-L5F2S2">bb</syl> </verse> </note> <note xml:id="note-L6F1" type="color-marked" dur="1" oct="4" pname="c" color="red" accid.ges="n"> <verse xml:id="verse-L6F2" color="black" n="1"> <syl xml:id="syl-L6F2"> a</syl> </verse> </note> <note xml:id="note-L7F1" dur="1" oct="4" pname="c" accid.ges="n"> <verse xml:id="verse-L7F2" color="black" n="1"> <syl xml:id="syl-L7F2">aa</syl> </verse> </note> </layer> </staff> </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>