humdrum-tools / verovio-humdrum-viewer

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

Editorial clefs are not displayed properly #808

Closed jacekiwaszko1 closed 1 year ago

jacekiwaszko1 commented 1 year ago

Encoding of editorial clefs discussed and implemented in issue #188 doesn't work. Example from this comment:

**kern
*clefG2
=1-
1cc
=
!LO:CL:ed
*clefF4
1C
=
!LO:CL:color=chartreuse
*clefG2
1cc
=
!LO:CL:ed:color=hotpink
*clefC3
1c
==
*-

is now rendered as

image

instead of

old-example

And since there's an option to render the clef in brackets (clef@enclose="brack"), maybe that would be a good thing to implement as a default behavior? Example below

**kern
*clefG2
=1-
1cc
=
!LO:CL:ed
*clefF4
1C
==
*-

could be rendered then as

image

Click for MEI encoding proposal ```xml </titleStmt> <pubStmt /> </fileDesc> <encodingDesc> <appInfo> <application isodate="2023-04-14T16:36:09" version="3.16.0-dev-c126866-dirty"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="m6kwczh"> <score xml:id="s1gwvao3"> <scoreDef xml:id="s1ovmpu7" midi.bpm="400.000000"> <staffGrp xml:id="sdp3fq5"> <staffDef xml:id="staffdef-L1F1" n="1" lines="5"> <clef xml:id="clef-L2F1" shape="G" line="2" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" n="1"> <staff xml:id="staff-L1F1" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L4F1" dur="1" oct="5" pname="c" accid.ges="n" /> </layer> </staff> </measure> <scoreDef xml:id="sbt7lqd"> <staffGrp xml:id="s1e5run7"> <staffDef xml:id="s170d45g" n="1"> <clef xml:id="clef-L7F1" shape="F" line="4" type="editorial" enclose="brack" /> </staffDef> </staffGrp> </scoreDef> <measure xml:id="measure-L5" right="end"> <staff xml:id="staff-L5F1N1" n="1"> <layer xml:id="layer-L5F1N1" n="1"> <note xml:id="note-L8F1" dur="1" oct="3" pname="c" accid.ges="n" /> </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>It would be good for using brackets for editorial clefs as a default style (and the default color would be black unless a color is given. Maybe have some parameter to hide the brackets.</p> <p>An interesting behavior is that the C3 clef will become colored if it is at the start of the music:</p> <img width="615" alt="Screenshot 2023-04-14 at 5 47 30 PM" src="https://user-images.githubusercontent.com/3487289/232174820-66ecc231-ec9d-4709-b206-10c82ad281d4.png"> </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>The clef is colored if in the middle of the measure:</p> <img width="732" alt="Screenshot 2023-04-14 at 5 50 18 PM" src="https://user-images.githubusercontent.com/3487289/232174909-3a230929-03bd-4d54-8fbe-8403e7cdc452.png"> <p>Sometimes shows with gray:</p> <img width="914" alt="Screenshot 2023-04-14 at 5 51 43 PM" src="https://user-images.githubusercontent.com/3487289/232174957-e2f545d0-fa03-41e8-8243-4c60413498c9.png"> <p>Clef changes are typically displayed before a barline, so the bass clef is small if placed before the barline:</p> <img width="766" alt="Screenshot 2023-04-14 at 5 52 34 PM" src="https://user-images.githubusercontent.com/3487289/232175031-6c613c09-2a9b-4248-8811-80eb8a6d75c4.png"> </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/fafb9ec324e1794ecccd97bb75b98e27b9f2de36">https://github.com/rism-digital/verovio/commit/fafb9ec324e1794ecccd97bb75b98e27b9f2de36</a></p> <p>Test example:</p> <pre><code class="language-tsv">**kern *clefG2 =1 1c !LO:CL:ed *clefF4 =2 1c !LO:CL:ed:color=royalblue *clefG2 =3 1c =4 !LO:CL:ed *clefF4 1c =5 !LO:CL:ed:color=orange *clefG2 1c == *-</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/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-04-14T18:32:34" version="3.16.0-dev-9880298"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="m1w7my97"> <score xml:id="s1oawbyu"> <scoreDef xml:id="s1qkv2e1" midi.bpm="400.000000"> <staffGrp xml:id="syglkdy"> <staffDef xml:id="staffdef-L1F1" n="1" lines="5"> <clef xml:id="clef-L2F1" shape="G" line="2" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" n="1"> <staff xml:id="staff-L1F1" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L4F1" dur="1" oct="4" pname="c" accid.ges="n" /> <supplied xml:id="sr3nry"> <clef xml:id="clef-L6F1" type="editorial" shape="F" enclose="brack" line="4" /> </supplied> </layer> </staff> </measure> <measure xml:id="measure-L7" n="2"> <staff xml:id="staff-L7F1N1" n="1"> <layer xml:id="layer-L7F1N1" n="1"> <note xml:id="note-L8F1" dur="1" oct="4" pname="c" accid.ges="n" /> <supplied xml:id="s1tt1au7"> <clef xml:id="clef-L10F1" type="editorial" shape="G" color="royalblue" enclose="brack" line="2" /> </supplied> </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="c" accid.ges="n" /> </layer> </staff> </measure> <scoreDef xml:id="s1wcv499"> <staffGrp xml:id="s18tf5kk"> <staffDef xml:id="soften5" n="1"> <clef xml:id="clef-L15F1" type="editorial" shape="F" enclose="brack" line="4" /> </staffDef> </staffGrp> </scoreDef> <measure xml:id="measure-L13" n="4"> <staff xml:id="staff-L13F1N1" n="1"> <layer xml:id="layer-L13F1N1" n="1"> <note xml:id="note-L16F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <scoreDef xml:id="s1lfg3w8"> <staffGrp xml:id="sbzc7zu"> <staffDef xml:id="sczw6h8" n="1"> <clef xml:id="clef-L19F1" type="editorial" shape="G" color="orange" enclose="brack" line="2" /> </staffDef> </staffGrp> </scoreDef> <measure xml:id="measure-L17" right="end" n="5"> <staff xml:id="staff-L17F1N1" n="1"> <layer xml:id="layer-L17F1N1" n="1"> <note xml:id="note-L20F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>Rendering:</p> <img width="788" alt="Screenshot 2023-04-14 at 6 31 48 PM" src="https://user-images.githubusercontent.com/3487289/232176766-892a1a21-7f51-42f5-8cad-4439ce45eaaa.png"> </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>