humdrum-tools / verovio-humdrum-viewer

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

Implement multi-option verovio options #799

Closed craigsapp closed 1 year ago

craigsapp commented 1 year ago

Issue https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/795 implements single verovio options at a time in the VHV urls. Implement multi-option input as well as multi-option !!!verovio: lines.

Each option should be separated by a pipe character (|):

!!!verovio: evenNoteSpacing|adjustPageHeight|pageWidth 1600

which is equivalent to:

!!!verovio: evenNoteSpacing
!!!verovio: adjustPageHeight
!!!verovio: pageWidth 1600

If there is a | in a parameter operand, then it must be escaped with \|. Spaces should optionally be allowed around the pipes:

!!!verovio: evenNoteSpacing | adjustPageHeight | pageWidth 1600
craigsapp commented 1 year ago

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

Example:

Screenshot 2023-03-10 at 7 44 59 PM
**kern
4c#
1d-
2e##
==
*-
!!!verovio: evenNoteSpacing | adjustPageHeight | adjustPageWidth
!!!verovio: svgCss g.note{fill:hotpink} g.accid{fill:royalblue}
Click to view MEI conversion of above Humdrum data ```xml </titleStmt> <pubStmt /> </fileDesc> <encodingDesc> <appInfo> <application isodate="2023-03-10T19:42:53" version="3.16.0-dev-0f59ac3"> <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="6" token="!!!verovio: evenNoteSpacing | adjustPageHeight | adjustPageWidth" xml:id="L7"> <frameInfo> <startTime float="7" /> <frameType>reference</frameType> <referenceKey>verovio</referenceKey> <referenceValue>evenNoteSpacing | adjustPageHeight | adjustPageWidth</referenceValue> </frameInfo> </metaFrame> <metaFrame n="7" token="!!!verovio: svgCss g.note{fill:hotpink} g.accid{fill:royalblue}" xml:id="L8"> <frameInfo> <startTime float="7" /> <frameType>reference</frameType> <referenceKey>verovio</referenceKey> <referenceValue>svgCss g.note{fill:hotpink} g.accid{fill:royalblue}</referenceValue> </frameInfo> </metaFrame> </frames> </extMeta> </meiHead> <music> <body> <mdiv xml:id="m66z29y"> <score xml:id="s1ec5mxg"> <scoreDef xml:id="sqfu29m" midi.bpm="400.000000"> <staffGrp xml:id="swa55s7"> <staffDef xml:id="staffdef-L1F1" n="1" lines="5"> <clef xml:id="cl734gi" shape="G" line="2" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" right="end"> <staff xml:id="staff-L1F1" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L2F1" dur="4" oct="4" pname="c" accid="s" /> <note xml:id="note-L3F1" dur="1" oct="4" pname="d" accid="f" /> <note xml:id="note-L4F1" dur="2" oct="4" pname="e" accid="x" /> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>URL with multiple verovio options:</p> <p><a href="https://verovio.humdrum.org/?t=KiprZXJuCjRjIwoxZC0KMmUjIwo9PQoqLQo=&v=evenNoteSpacing|adjustPageHeight|adjustPageWidth|svgCss%20g.note{fill:hotpink}%20g.accid{fill:royalblue">https://verovio.humdrum.org/?t=KiprZXJuCjRjIwoxZC0KMmUjIwo9PQoqLQo=&v=evenNoteSpacing|adjustPageHeight|adjustPageWidth|svgCss%20g.note{fill:hotpink}%20g.accid{fill:royalblue</a>}</p> <img width="1067" alt="Screenshot 2023-03-10 at 9 00 22 PM" src="https://user-images.githubusercontent.com/3487289/224465878-3bff7867-8e28-44ab-888d-0fb3a7729386.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>