humdrum-tools / verovio-humdrum-viewer

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

Add verovio parameters in URL #795

Closed craigsapp closed 1 year ago

craigsapp commented 1 year ago

Allow for verovio options to be passed in the URL to VHV.

craigsapp commented 1 year ago

Implemented with commit https://github.com/humdrum-tools/verovio-humdrum-viewer/commit/ca29a73bedef78ed8de53b2e6df20745e32743eb

Give verovio options using the v= CGI parameter key. Multiple options can be given, separated by | character (to be fully implemented later).

Example:

Highlight all C pitch classes in green:

http://127.0.0.1:4000/?file=chorales/chor001.krn&v=svgCss%20g.note.pname-c%7Bcolor%3Alimegreen%3Bfill%3Alimegreen%7D

The verovio option:

v=svgCss%20g.note.pname-c%7Bcolor%3Alimegreen%3Bfill%3Alimegreen%7D

which is decoded from the URL as:

svgCss g.note.pname-c{color:limegreen;fill:limegreen}
Screenshot 2023-02-28 at 10 29 13 AM
craigsapp commented 1 year ago

Adding evenNoteSpacing option for maximally compressing space between notes:

https://verovio.humdrum.org/?file=jrp/Jos/Jos2721-La_Bernardina.krn&filter=cmr&v=evenNoteSpacing

Screenshot 2023-02-28 at 10 39 05 AM