Extension:Score

The Score extension allows the rendering of musical scores as PNG images using LilyPond and can also transform them into audio and MIDI files.

Acknowledgements

 * The original  was written by Johannes E. Schindelin.


 * This extension is based on a 1>Special:Code/MediaWiki/98414#c27299|code review of  by Tim Starling.


 * The original  was written by River Tarnell.

Usage
After setup, you can embed simple [http://lilypond.org/doc/Documentation/learning-big-page#common-notation LilyPond notation] into your wikitext inside a  tag. For example:

yields:

You may also specify attributes to the score tags in the general form

.

For example:

yields:

The following attributes are available:

The LilyPond language
Lyrics may be added like this:

For advanced users, the [http://lilypond.org/doc/Documentation/notation/using-midi-instruments  ] command can be used to change the MIDI instrument for the sound.

Prerequisites
This extension uses LilyPond to render score images, so you need a working LilyPond installation (Special:Version displays the LilyPond version). If you want the extension to trim score images for you, you will also need ImageMagick.

The extension is also capable of creating audio files from the MIDI files generated by LilyPond. If you want to make use of this functionality, you need to have </> installed.

Version 0.1 of this extension was tested with MediaWiki 1.18.0 and LilyPond 2.12.3. The current git snapshot might require a newer version of MediaWiki and/or LilyPond.

Download instructions
Use the extensiondistributor>Special:ExtensionDistributor/Score</>|extension distributor. You can also download a tarball from GitHub: <tvar|1></>; or as a zipped file: <tvar|2></>. The score master branch on GitHub works with a stable version of MediaWiki, but may not yet have the newest features in it.

Configuration
Currently, the extension has the following global configuration parameters.

$wgScoreLilyPond
Set  to the path to your LilyPond executable (typically   or  ).

$wgScoreTrim
The  is a boolean which defaults to the value of. If, the resulting score PNG images are trimmed with ImageMagick. If you don't want trimming, or don't want to install ImageMagick, set  to.

$wgScoreAbc2Ly
Set  to the path of your ABC to LilyPond converter executable (typically   or  ).

$wgScoreFluidsynth
Set  to the path of your Fluidsynth executable (typically   or  ).

$wgScoreSoundfont
Set  to the path of your soundfont file (typically   or  ).

$wgScoreTimidity
Set  to the path of your TiMidity++ executable (typically   or  ).

If  does not exist, TiMidity++ will be used as fallback instead.

$wgScoreLame
Set  to the path of your Lame executable (typically   or  ). Required if the generated audio file should be a MP3.

Remarks
This extension runs various binaries on a shell. You may have to increase <tvar|1></> if you get out of memory errors.

Finding scores
Pages with scores on them will have the "score" 1>Special:MyLanguage/Manual:page props table</>|page property set. Using <tvar|2>Special:PagesWithProp</>, you can find pages that have scores. ([<tvar|url>//en.wikipedia.org/wiki/Special:PagesWithProp?propname=score&propname-other=</> Example query for the English Wikipedia].)