Software: LilyPond

LilyPond Logo

On this page:

About LilyPond

LilyPond:
  • Is music notation software that can create sheet music in Clairnote DN music notation.
  • Is free to download and use.
  • Runs on all major desktop operating systems (Windows, macOS, and GNU/Linux).
  • Can be used via web apps like LilyBin + Clairnote (also HackLily and LilyBin).
  • Can convert MusicXML, ABC, and MIDI files into LilyPond files.
  • Is highly customizable, making it an excellent tool for creating sheet music in alternative notation systems.
  • Is "devoted to producing the highest-quality sheet music possible".
  • Is free software and part of the GNU project.

LilyPond has a text-based interface rather than a graphical user interface. (Like LaTeX but for sheet music.) LilyPond files are simply plain text files written in LilyPond syntax and named using the ".ly" file extension. Learn more about LilyPond at lilypond.org.

Popular graphical applications like the free and open-source MuseScore (also Finale, Sibelius, and Dorico) can export MusicXML files that can be converted into LilyPond files to produce sheet music in Clairnote DN. For details on using this approach see:

Creating Clairnote DN Sheet Music with LilyPond

Here are two ways to use LilyPond to create Clairnote DN sheet music:

  • Use LilyBin, a website interface for LilyPond
  • Install LilyPond

LilyBin lets you try LilyPond before installing it and lets you use LilyPond from a tablet or phone. For more extensive use, install LilyPond. Both work for converting existing LilyPond files and for creating new ones from scratch.

Option 1: Use LilyBin

1. Go to LilyBin + Clairnote (lilybin.clairnote.org) a version of LilyBin that supports Clairnote DN music notation.

2. Near the top of the LilyPond file, delete the % in the line % clairnote-type = dn. This uncomments the line, which sets the clairnote-type variable to dn. (Leave the \include "clairnote.ly" line as it is.)

3. Edit and engrave your file (click "Preview") and it will be rendered in Clairnote DN music notation.

Option 2: Install LilyPond

1. Download and install LilyPond (version 2.20 or later).

2. Download and install Frescobaldi (optional but highly recommended). Frescobaldi is an editor designed specifically for use with LilyPond that offers a lot of nice features like PDF preview, text highlighting, auto-complete, midi playback, etc. It helps make LilyPond easier to use and learn.

3. Download the following file (right-click on the link):

clairnote.ly
Released under the GNU General Public License version 3 (html txt).
Development: git repo.

(If you are still using LilyPond 2.18.2 you can download this earlier version of clairnote.ly.)

4. Open a LilyPond music file (.ly) (using Frescobaldi) and add the following line near the top. (They must be in this order.)

clairnote-type = dn
\include "clairnote.ly"

This sets the clairnote-type variable to dn and includes theclairnote.ly file in your LilyPond file, providing additional code that allows LilyPond to render/engrave the file in Clairnote DN music notation. Including a file works the same as if you had cut and pasted the contents of one file into another file (see \include).

5. Place the clairnote.ly file in the same directory as your LilyPond file(s) or somewhere else where LilyPond can access it (see \include). In Frescobaldi you can designate a directory that contains files that you want to include and then you can always include those files when using Frescobaldi. To set this up go to Preferences > LilyPond Preferences.

6. Edit your LilyPond file and engrave it with LilyPond. It will be rendered in Clairnote DN music notation.

Note: if you are converting an existing LilyPond file (.ly), make sure it is for LilyPond version 2.19.49 or higher. (If you are still using LilyPond 2.18.2 then it can be 2.18.2 or higher.) Look for a \version statement that should be at the top of the file. If it is an earlier version, update the file using convert-ly. (The Mutopia Project offers LilyPond files for free download, but some will need to be updated.)

Clairnote DN Template Files

You may want to use one of these template files to get started. They are just variations on some of the official LilyPond Template Files. Note the line \include "clairnote.ly" at the top. Delete the % in the % clairnote-type = dn line to uncomment that line. (In a LilyPond file a "%" signals that the rest of the line is a comment, which is ignored when the score is rendered.)

By default these templates show Clairnote DN's alternative key signatures and accidental signs. If you would rather not use them, just delete the "%" at the beginning of the following line(s) in the template file:

% \remove Accidental_engraver
% \remove Key_engraver

Restore the "%" to show them again.

Staves Spanning More Than Two Octaves

The standard Clairnote DN staff spans two octaves. For music with a wider pitch range you can optionally use a larger staff with the \cnStaffOctaveSpan command. For example, you might use \cnStaffOctaveSpan 3 for guitar or \cnStaffOctaveSpan 4 for piano. This command should be entered in a staff's \with block or at the very beginning of the music.

To change a staff in the middle of the music – to temporarily extend it up or down an octave to avoid ledger lines – use the commands \cnExtendStaffUp and \cnExtendStaffDown. Then "unextend" the staff with \cnUnextendStaffUp and \cnUnextendStaffDown. See the Staff page for more about staves with different octave ranges.

\new Staff \with {
  \cnStaffOctaveSpan 3
} {
  e4 f g a
  \cnExtendStaffUp
  e''' f''' g''' a'''
  \cnUnextendStaffUp
  a g f e
}

Usually you would use different clefs to change the octaves of the staff, but in some cases you might want to have the clef appear at a different octave on the staff. You can move a clef up or down one or more octaves (bringing all the notes with it) with the \cnClefPositionShift command. The key signature and time signature will also move with the clef. When combined, all these commands make a wide range of staff and clef configurations possible.

\new Staff \with {
  \cnStaffOctaveSpan 3
  \cnClefPositionShift -1
} {
  e4 f g a
  e''' f''' g''' a'''
  a g f e
}

Clairnote DN and Traditional Music Notation in the Same File

Sometimes you may want to produce files that contain music in both Clairnote DN and traditional music notation, say for easy comparison. Instead of the following which will produce a Clairnote DN staff:

\new Staff {
  % music goes here...
}

Use this to produce a traditional staff:

\new TradStaff {
  % music goes here...
}

"TradStaff" is the name of a custom staff context. It tells LilyPond that you want a standard traditional staff instead of a Clairnote DN staff. ( \context TradStaff can also be used where you would use \context Staff )

Notehead Styles

Notehead shapes can be customized with the \cnNoteheadStyle command. (See discussion in this blog post.) Here are the available styles:

C major scale in Clairnote DN music notation with default noteheads
"default"
C major scale in Clairnote DN music notation with lilypond noteheads
"lilypond"
C major scale in Clairnote DN music notation with funksol noteheads
"funksol"

Here's how to change the notehead style for a given staff.

\new Staff \with {
  % options are "funksol" "lilypond" and "default"
  \cnNoteheadStyle "funksol"
} {
  % music goes here...
}

More Examples and Documentation

To use LilyPond you will need to refer to the LilyPond manuals which are quite comprehensive. See Sheet Music for more examples of music typeset in Clairnote DN using LilyPond. The LilyPond page of the Music Notation Project Wiki offers some additional information about using LilyPond with alternative notation systems like Clairnote DN.

Please contact us if you are interested in using LilyPond to create sheet music in Clairnote DN. If there is a piece of music you would like to see in Clairnote DN, we can help. See Sheet Music for more details.