Main Page: Difference between revisions
No edit summary |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
This is a MediaWiki instance running 1.39 LTS, mainly for testing the [https://www.mediawiki.org/wiki/Extension:Score Score extension] and anything else I might be working on. | |||
Using the excellent skin from the [https://starcitizen.tools/ Star Citizen] wiki. | |||
== Score Extension == | == Score Extension == | ||
'''''See also:''''' ''[[ | '''''See also:''''' ''for more SVG music output testing, see testing pages: [[score examples]], [[Tim paste]].'' | ||
Using a patched version of the Score extension to render music as SVG; see [https://phabricator.wikimedia.org/T49578 T49578] and the [https://gitlab.com/doctorlard/mediawiki-extension-score/-/merge_requests/2/diffs patch] mirrored on GitLab. LilyPond version [https://gitlab.com/lilypond/lilypond/-/releases/v2.23.82 2.23.82] (a release candidate for the 2.24 release, scheduled for December 2022) includes libcairo support for producing SVG and PNG directly, rather than via PS, GhostScript, and ImageMagick. | |||
;Note: To yoink Lilypond snippets from Wikipedia articles, see [https://en.wikipedia.org/wiki/Special:PagesWithProp?propname=score&namespace=0 Special:PagesWithProp] and search for the "score" property in Article space. | ;Note: To yoink Lilypond snippets from Wikipedia articles, see [https://en.wikipedia.org/wiki/Special:PagesWithProp?propname=score&namespace=0 Special:PagesWithProp] and search for the "score" property in Article space. | ||
Here's | Here's a Wagner excerpt for [https://en.wikipedia.org/wiki/Contrabass_trombone contrabass trombone], from Wikipedia. | ||
First, the score block looks like this: | First, the score block looks like this: | ||
Line 31: | Line 30: | ||
Which normally generates a PNG image: | Which normally generates a PNG image: | ||
[[File:Score.png|none|Standard PNG output, using Lilypond 2.22 --ps | [[File:Score.png|none|Standard PNG output, using PostScript from Lilypond 2.22 --ps rendered by GhostScript|class=mw-ext-score]] | ||
The patch produces good SVG output: | |||
<score lang="lilypond"> | <score lang="lilypond"> | ||
Line 47: | Line 46: | ||
</score> | </score> | ||
With a PNG fall-back generated using Lilypond's built-in libcairo support. As you can see, it almost identical; I think it is slightly | With a PNG fall-back generated using Lilypond's built-in libcairo support. As you can see, it almost identical; I think it is slightly clearer and more fine-grained than the GhostScript output: | ||
[[File:nku68xzt.png|none|New PNG output, directly using Lilypond 2.24 directly with --png and libcairo|class=mw-ext-score]] | [[File:nku68xzt.png|none|New PNG output, directly using Lilypond 2.24 directly with --png and libcairo|class=mw-ext-score]] | ||
Cropping is done with the new LilyPond ''-dno-use-paper-size-for-page'' option ([https://lilypond.org/doc/v2.23/Documentation/usage/command_002dline-usage#advanced-command-line-options-for-lilypond docs]), which precludes having to do it the old way with an extra ImageMagick ''convert'' shell command, and achieves the same result. | Cropping is done with the new LilyPond ''-dno-use-paper-size-for-page'' option ([https://lilypond.org/doc/v2.23/Documentation/usage/command_002dline-usage#advanced-command-line-options-for-lilypond docs]), which precludes having to do it the old way with an extra ImageMagick ''convert'' shell command, and achieves the same result. |
Latest revision as of 02:41, 15 December 2022
This is a MediaWiki instance running 1.39 LTS, mainly for testing the Score extension and anything else I might be working on. Using the excellent skin from the Star Citizen wiki.
Score Extension
See also: for more SVG music output testing, see testing pages: score examples, Tim paste.
Using a patched version of the Score extension to render music as SVG; see T49578 and the patch mirrored on GitLab. LilyPond version 2.23.82 (a release candidate for the 2.24 release, scheduled for December 2022) includes libcairo support for producing SVG and PNG directly, rather than via PS, GhostScript, and ImageMagick.
- Note
- To yoink Lilypond snippets from Wikipedia articles, see Special:PagesWithProp and search for the "score" property in Article space.
Here's a Wagner excerpt for contrabass trombone, from Wikipedia.
First, the score block looks like this:
<score lang="lilypond">
\layout { ragged-right = ##t \context { \Score \omit BarNumber } }
\relative g {
\override DynamicTextSpanner.style = #'none
\override Hairpin.minimum-length = #5
\clef bass \key c \major
g2~ \ff g8 f8 e8. d16
c4 b a g f e d c4 \break
b a g f e1~ \dim\! << e1~ { s2 s4 s4 \> } >> e4 \! \p r4 r2
}
</score>
Which normally generates a PNG image:
The patch produces good SVG output:
With a PNG fall-back generated using Lilypond's built-in libcairo support. As you can see, it almost identical; I think it is slightly clearer and more fine-grained than the GhostScript output:
Cropping is done with the new LilyPond -dno-use-paper-size-for-page option (docs), which precludes having to do it the old way with an extra ImageMagick convert shell command, and achieves the same result.