Software: LilyPond

LilyPond Logo

LilyPond is free music notation software that can create sheet music in Clairnote 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.  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 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 (lilybin.clairnote.org) a version of LilyBin that supports Clairnote music notation.

2. Note the \include "clairnote.ly" line at the top of your LilyPond file.

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

Option 2: Install LilyPond

1. Download and install LilyPond, either version 2.18.2 or the latest 2.19.x development version.

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.

4. Open a LilyPond music file (.ly) (using Frescobaldi) and add the following line near the top.

\include "clairnote.ly"

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

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

By default these templates show Clairnote’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 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 and Traditional Music Notation in the Same File

Sometimes you may want to produce files that contain music in both Clairnote and traditional music notation, say for easy comparison.  Instead of the following which will produce a Clairnote 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 staff.  ( \context TradStaff can also be used where you would use \context Staff )

Note Head Styles

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

“default”
C major scale in Clairnote music notation with default noteheads
“lilypond”
C major scale in Clairnote music notation with lilypond noteheads
“funksol”
C major scale in Clairnote music notation with funksol noteheads

Here’s how to change the note head 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 and More Sheet Music for more examples of music typeset in Clairnote using LilyPond. The LilyPond page of the Music Notation Project Wiki offers some additional information about using LilyPond with alternative notation systems like Clairnote.

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