Software: LilyPond

LilyPond Logo

LilyPond is free music notation software that can create sheet music in Clairnote SN music notation.

On this page:

About LilyPond

LilyPond is free software (part of the GNU project) and is “devoted to producing the highest-quality sheet music possible.” It is also highly customizable which makes it an excellent tool for creating sheet music in alternative notation systems like Clairnote SN. It runs on all major desktop operating systems (Windows, macOS, and GNU/Linux).

LilyPond has a text-based interface rather than a graphical user interface. (Like TeX but for sheet music.) LilyPond files are just plain text files written in LilyPond syntax and named using the “.ly” file extension.

Creating Clairnote SN Sheet Music with LilyPond

It’s easy whether you are converting an existing LilyPond file or creating a new one from scratch. Here are two options:

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

LilyBin lets you try LilyPond before installing it, and is also a way to use LilyPond from a tablet or phone. For more extensive use, install LilyPond.

Option 1: Use LilyBin

1. Go to LilyBin + Clairnote ( a version of LilyBin that supports Clairnote SN (and Clairnote).

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

3. Edit and engrave the file (click “Preview”) and it will be rendered in Clairnote SN music notation. (Note that for Clairnote SN, you will need to use the unstable (development) version of LilyPond.)

Option 2: Install LilyPond

1. Download and install LilyPond. For Clairnote SN you will need the latest 2.19.x unstable (development) version of LilyPond.

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):
Released under the GNU General Public License version 3 (html txt).
Development: git repo.

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

clairnote-type = sn
\include ""

This sets the clairnote-type variable to sn and includes the file in your LilyPond file, providing additional code that allows LilyPond to render/engrave the file in Clairnote SN 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 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 SN music notation.

Note: if you are converting an existing LilyPond file (.ly), make sure it is for LilyPond version 2.19.49 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 SN 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 "" at the top.

By default these templates show Clairnote SN’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. (In a LilyPond file a “%” signals that the rest of the line is a comment, which is ignored when the score is rendered.)

Staves Spanning More Than Two Octaves

The standard Clairnote SN 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
  e''' f''' g''' a'''
  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 SN and Traditional Music Notation in the Same File

Sometimes you may want to produce files that contain music in both Clairnote SN and traditional music notation, say for easy comparison. Instead of the following which will produce a Clairnote SN 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 SN 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 SN music notation with default noteheads
C major scale in Clairnote SN music notation with lilypond noteheads
C major scale in Clairnote SN music notation with funksol noteheads

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 Library and More Sheet Music for more examples of music typeset in Clairnote SN using LilyPond. The LilyPond page of the Music Notation Project Wiki offers some additional information about using LilyPond with alternative notation systems like Clairnote SN.

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