forked from TheCount/score
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
60 lines (40 loc) · 2.02 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Score, a MediaWiki extension for rendering musical scores with 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.
This extension was tested with MediaWiki 1.18.0 and LilyPond 2.12.3.
Setup
=====
1. Change to the "extensions" directory of your MediaWiki installation.
2. Create a new subdirectory named "Score".
3. Copy the files Score.php, Score.body.php and Score.i18n.php into the new
subdirectory. Make sure they are readable by your webserver.
4. Create a subdirectory named "lilypond" in your $wgUploadDirectory (usually
the directory named "images" in in your MediaWiki directory). Make sure
the directory is writable 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.
5. Add the lines
require_once("$IP/extensions/Score/Score.php");
$wgLilyPond = '/path/to/your/lilypond/executable'; /* required */
$wgScoreTrim = true; /* Set to false if you don't want score trimming */
to your LocalSettings.php file. If you get unexpected out-of-memory errors,
you may also have to increase $wgMaxShellMemory (see
https://www.mediawiki.org/wiki/Manual:$wgMaxShellMemory
for more information.
Usage
=====
After setup, you can use the <score>…</score> tags in your wiki markup.
For a simple score, use e.g.
<score>\relative c' { f d f a d f e d cis a cis e a g f e }</score>
This will render the appropriate score as a PNG image. The lilypond software
is also capable of creating MIDI files. Use
<score midi="1">…</score>
and the rendered image will be embedded into a hyperlink to an appropriate
MIDI file. For more complex scores, you may supply a complete lilypond file
with
<score raw="1">…</score>
You may also combine the "raw" and "midi" attributes, but remember that in
this case, you need to provide the necessary \midi block yourself.