Help:Score

The  element in wikitext displays a musical score out of GNU LilyPond (the default) or ABC markup syntax. It also produces a MIDI file of the music and optionally displays an audio player that plays the music. It is implemented by the Score extension for MediaWiki, available across Wikipedia languages.

For LilyPond resources, see. , the extension on Wikipedia is using LilyPond v2.22.0 (check Special:Version for the current version). Changes to LilyPond since version 2.18 are documented here. Note that LilyPond's full syntax is available when the extension is invoked with the wikitext. A plain invokes a simplified implementation that is not fully consistent with the LilyPond documentation.

Element attributes
If there is a MIDI file or audio file of superior quality to the MIDI or audio generated by the Score extension, you can provide a  wikilink to it after the closing  tag.

Simple
gives Equivalent in ABC notation:

More elaborate
gives

Equivalent in ABC (pre-transposed due to differing semantics):

Syntax
The score section must be surrounded by . The notes must be within a set of curly braces.

Comments in the markup start with a percentage sign  and end at the end of the line.

Pitch
To display a note, type the letter ( etc.) Separate each letter with a space. The bare note name refers to the natural note irrespective of key signature (see "setting the key" below). These letters are as in English and Dutch, not as in German and many other continental languages (FYI: continental b means b flat and continental h means b - if you find that confusing, forget it).

Sharps and flats are formed by using the Dutch and German suffixes "is" and "es" respectively. To avoid "ees", the note E♭ is simply written as. The simple accidentals are thus  for the sharps and   for the flats. English language editors may prefer to include the line  in the script, after which   for sharp and   for flat can be used:   and. Double sharps are formed with the suffix  and double flats with , or in English notation with   or   and. Semi-sharps, -flats and sesqui-sharps and -flats are also supported in both English and German. See:.

By default, each note name refers to the note below middle C. For example,   would be displayed as  or.

Use the apostrophe to go up an octave and a comma  to go an octave down. Middle C would be  .

A much easier way is to use relative coding. If you include  before the braces, each note will refer to the note closest to the previous one, and the first one will refer to the note closest to the one mentioned after the   tag. ("Closest" ignores sharps and flats.) Use  to go up an extra octave and   to go down.

Setting the key
By default there is no key signature (no sharps or flats). You can indicate the key with,  , or even a mode such as   or. The key can be changed at any point.

Keep in mind that even with a key signature, you must still include sharps (-is) and flats (-es) for each individual note name. If you omit one, it will be considered a natural. For example, this is the key of Gb major:

Accidentals
Accidentals may be indicated by following the note name with the appropriate text:

Note that E♭ is "es" alone, rather than "ees". "q" and "tq" refer to "quarter" and "three-quarter" (rather than "hf" for "half flat" and "thf" for "three-half flat"), as in "quarter tone". However, the "quarter flat/sharp" is not a quarter of a flat/sharp, but instead half of a flat/sharp, and the "three-quarter flat/sharp" is 1.5 flats not 0.75 flats. Notes outside of the quarter-tone scale are not supported.

German:

English:

Both result in:

Transpose and transposition
If, for some reason, a piece needs to be transposed to a different key, it is possible to do so without having to transcribe it manually. This also affects the key signature. The syntax for this is: For example: Results in:

MIDI output can be transpositioned with the  command. The French horn (in C) motif from the opening of Schubert's last symphony, transpositioned one octave down: The  command is mainly intended for scores that incolve transposing instruments not set in concert pitch.

Rhythm
Note duration is indicated by a number following the pitch with no space between. Use the number 1 for a whole note (semibreve), 2 for a half note (minim), 4 for a quarter note (crotchet), 8 for an eighth note (quaver), and so on. If a note does not have an explicit duration, it will either default to a quarter note or use the duration of the note preceding it.

Rests are indicated by using the letter  instead of a pitch. Dotted notes are formed simply by following the duration number with a period.

Tuplets are indicated using the  command, for example   gives a triplet of three eight-notes (quavers).

Setting the time signature
The default time signature is 4/4. To set another time signature, one may use the  command. For example to set the time signature to cut-time one would use  and waltz time would be. The time signature may be changed at almost any point.

Removing the time signature
For some music examples, removing the time signature may be desirable; the code  can be used in that case:

Pick up measure
The code  will create a pickup measure (anacrusis) of one quarter note,   would create a pickup measure of two quarter notes, etc. See an example in the Adding Lyrics section of this article.

Customizing beams
The software occasionally combines beamed notes in places that are not desired or look awkward. To override the automatic beams, use  between the notes that would otherwise be beamed:. To turn off beaming for many notes, use  and then.

To manually beam notes, use square brackets inserting the first one after the first note to be beamed:. This would beam the notes b, c, d, and e, but leave the first and last notes without beams.

Adding lyrics
You can add lyrics to the score using. See the LilyPond Manual for more information about how to align the lyrics to the score.

Adding chord names
Chord names can be added as a separate ChordNames staff as follows:

The letter   can be used in the ChordNames staff in place of   (the code for a rest) when there is no chord.

An   will result in an explicit "No Chord" notation  whereas the   will result in correct spacing, but no chord name notation will appear.

Adding whitespace
The letter   followed by a note duration adds an appropriate amount of whitespace:

Accents and other symbols
There are a number of symbols to attach to notes, such as. There are also

producing

Color
produces

MIDI instruments
MIDI instrument sounds can be assigned with  as documented in section A6 of LilyPond's Notation Reference. Trial and error may be necessary: some instruments may not work unless the # is omitted, and some may not work with or without the #.
 * The sound of each midi-instrument supported by LilyPond can be heard at Music/Software/Lilypond/MIDI

Repeated sections and MIDI
To indicate a repeated section, prefix it with. The MIDI and audio will only play once unless you add, which will also "unfold" the score. To avoid this you must duplicate the score, once for layout and once for MIDI, for example:

Hiding tempo
Metronome marks, as shown above, may be hidden with.

Individual staff sizes
Individual staff sizes can be changed with. Using  after each instance of , the example above renders as: For more intricate details, see "Setting the staff size" in the LilyPond manual.

Alignment
Use Image frame to align scores to the left, center, or right.

For example: }} results in the image to the right.
 * width=|caption = Diatonic scale on C, a "white note" scale
 * width=|caption = Diatonic scale on C, a "white note" scale

Grouping
Image frame may also be used to group score images together. The text below creates the group of images to the right:

|width=300|caption=The three genera of the Dorian octave species on E}}