Help:How can I add a LilyPond excerpt?

From ChoralWiki
Jump to navigation Jump to search

Hymn tune pages typically have the melody written out at the top of the page by means of a LilyPond excerpt. LilyPond is automated music engraving software. It can be used on this wiki with the MediaWiki LilyPond extension. Pages which have a LilyPond excerpt are categorised in the LilyPond excerpts category.

You can help CPDL by adding LilyPond excerpts to pages that require them, such as hymn tune pages. There is a category of pages for which users have requested a LilyPond excerpt. LilyPond is a very simple language to learn - you can pick up the basics in a few minutes. Try reading the cheat sheet to jump straight into editing, or you can view all the Documentation.

A step-by-step guide to adding a LilyPond excerpt on CPDL:

  1. Locate the page to which you wish to add the excerpt. You may wish to use the category above to find pages for which an extract has been requested.
  2. Log in (if you are not logged in already) and edit the page by clicking "edit" at the top.
  3. If there is a line which reads {{NoMelody}} then delete this.
  4. At the top of the page, type <lilypond> to open the tag for LilyPond code.
  5. Now enter the code, then close the tag by typing </lilypond>.
    Here is an example which is the first line of the famous tune "Old hundredth", commonly associated with the words "All people that on earth do dwell":

{\key g \major g2 g4 fis e d g2 a b b b4 b a g c2 b a}

The code is rendered thus:
<lilypond>{\key g \major g2 g4 fis e d g2 a b b b4 b a g c2 b a}</lilypond>
6.  Click "Show preview" to make sure that you have typed the code correctly (it may take some time for the image(s) to render). If you are happy with the output, move onto the next step, if not, alter the code and click "Show preview" again until it displays correctly.
7. Type an edit summary in the box such as "Added LilyPond melody" and save the page.

A few tips:

  • You don't need to add bar lines ( | ) but they can be useful if other users come to edit your code.
  • You will need to open a new tag (<lilypond>) for every line of music that you add. In the example above, Old hundredth, there are 2 lines. Open the page and click "edit" to see how the code is written.
  • Because you will open a new tag for each line, you will need to re-enter the key signature code and (in some cases) the time signature, in this example, \key g \major. The time signature in the example above is generated automatically. See the LilyPond documentation to learn how to enter a time signature manually.
  • If you don't manage to complete the tune or if there is some other problem, simply type {{Cleanup|Your problem here}} at the bottom of the page, substituting the text "Your problem here" with the actual problem. Someone will come along and fix it.


Thank you for taking the time to add a melody excerpt to CPDL!


This page is part of the CPDL Help system.
View main help index