Extension:Score

What can this extension do?
This extension can render musical scores as PNG images using LilyPond.

Acknowledgements

 * The original Extension:LilyPond was written by Johannes E. Schindelin.
 * This extension is based on a code review of Extension:LilyPond by Tim Starling.
 * The original Extension:ABC was written by River Tarnell.

Usage
You can embed simple LilyPond notation into your wikitext using the  tags. For example: yields:



The lilypond software is also capable of creating MIDI files. Use

and the rendered image will be embedded into a hyperlink to an appropriate MIDI file. Use

and the rendered image will be embedded in an Ogg/Vorbis handler (provided you installed Extension:OggHandler, see below under ). Since the Vorbis file is created from the midi, the vorbis attribute implies the midi attribute. For more complex scores, you may supply a complete LilyPond file with

You may also combine the raw and midi attributes, but remember that in this case, you need to provide the necessary  block yourself.

The extension also supports the ABC music notation through LilyPond's abc2ly converter (see the documentation for  below). Use

to write music in ABC, for example

As you can see, you may combine the lang attribute with the midi attribute. The raw attribute will be ignored if lang is specified to be anything else than lilypond.

Prerequisites
This extension uses LilyPond to render score images, so you need a working LilyPond installation. If you want the extension to trim the score files for you, you will also need ImageMagick.

The extension is also capable of creating Ogg/Vorbis files from the MIDI files generated by LilyPond. If you want to make use of this functionality, you need to have Extension:OggHandler installed.

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

Download instructions
Use the extension distributor. You can also download a tarball from GitHub:, or as a zipped file:. The score master branch on GitHub works with a stable version of MediaWiki, but may not yet have the newest features in it.

Installation

 * 1) Change to the   directory of your MediaWiki installation.
 * 2) Create a new subdirectory named.
 * 3) Copy the files ,   and   from the distribution into the new subdirectory. Make sure they are readable by your webserver. If you do not create this directory, the Score extension will attempt to create it for you with the rights available to it.
 * 4) Create a subdirectory named   in your $wgUploadDirectory (usually the directory named   in in your MediaWiki directory). Make sure the directory is writable by your webserver.
 * 5) Add the following to LocalSettings.php:

Configuration parameters
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  ).

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

Remarks
This extension runs various binaries on a shell. You may have to increase $wgMaxShellMemory if you get out of memory errors.