[icon]

GNU LilyPond

-- --

What is LilyPond
Home
Examples
Templates
Download
GNU/Linux binaries
Windows binaries
Source code
Documentation
Tutorial
Manual
Glossary
Index

Support
Mailing lists
Search
WikiWiki

External sites
lilypond.org/stable
lilypond.org/development
savannah.gnu.org
ftp.lilypond.org
Mutopia
Other music online

Running LilyPond

In the last section we explained what kind of things you could enter in a lilypond file. In this section we explain how to run LilyPond and how to view or print the output. If you have not used LilyPond before, want to test your setup of LilyPond, or want to run an example file yourself, read this section. The instructions that follow are for running LilyPond on Unix-like systems. Some additional instructions for running LilyPond on Windows are given at the end of this section.

Begin by opening a terminal window and starting a text editor. For example, you could open an xterm and execute joe. In your text editor, enter the following input and save the file as test.ly:

          \score {
            \notes { c'4 e' g' }
          }
          

LilyPond is the program that computes the sheet music. All other things, such as adding titles, page breaking and other page layout, are done by a small wrapper program called ly2dvi. ly2dvi calls lilypond to render the music, and then adds the titling and page layout instructions. To process test.ly with ly2dvi, proceed as follows:

          ly2dvi -P test.ly
          

You will see the following on your screen:

          GNU LilyPond 1.6.0
          Now processing: `/home/fred/ly/test.ly'
          Parsing...
          Interpreting music...[1]
            ... more interesting stuff ... 
          PS output to `test.ps'...
          DVI output to `test.dvi'...
          

The results of the ly2dvi run are two files, test.dvi and test.ps. The PS file (test.ps) is the one you can print. You can view the PS file using the program ghostview. If a version of ghostview is installed on your system, one of these commands will produce a window with some music notation on your screen:

            gv test.ps
            ghostview test.ps
            ggv test.ps
            kghostview test.ps
          
If the music on your screen looks good, you can print it by clicking File/Print inside ghostview.

The DVI file (test.dvi) contains the same sheet music in a different format. DVI files are more easily processed by the computer, so viewing them usually is quicker. You can run xdvi test.dvi or kdvi test.dvi to view the DVI file. In Xdvi, the mouse burtons activate magnifying glasses. Unfortunately, variable symbols (such as beams and slurs) are not displayed in the magnifying glasses.

If your DVI viewer does not have a "Print" button, you can print the file by executing lpr test.ps.

If your system does not support printing PostScript files, then you can install Ghostscript, a PostScript emulator. Refer to Ghostscript's website at http://www.ghostscript.com.

A final option is to use the popular PDF format. You can get a PDF file by running ly2dvi --pdf test.ly. With --pdf you will get DVI, PS and PDF files. Viewers for PS files also accept PDF files, but there are also many other applications for viewing PDF files.

If you are familiar with TeX, be warned: do not use other DVI drivers like dvilj. The TeX coming out of LilyPond uses embedded PostScript code and will not render correctly if you use anything other than dvips.

Windows users

Windows users can start the terminal by clicking on the LilyPond or Cygwin icon. You can use any text editor (such as NotePad, Emacs or Vim) to edit the LilyPond file. If you install the Cygwin's XFree86 X11 window system, tetex-x11 and ghostscript-x11 packages too, you can view the dvi output doing xdvi test.dvi as described above. If you have installed a PostScript/PDF viewer, such as GSView from http://www.cs.wisc.edu/~ghost, viewing the PS file can be done with:

          gsview32 test.ps
          
You can also print from the command line by executing:
          gsview32 /s test.ps
          

SUMMARY

To run LilyPond, input a text file, then run the command ly2dvi on that file. The resulting files are either DVI or PostScript, and can be viewed with xdvi (Unix) and ghostview (Unix and Windows) respectively. The following table summarizes the constructs that were discussed in the previous two sections.

Syntax Description Example
1 2 8 16 durations

[picture of music]


. .. augmentation dots

[picture of music]


c d e f g a b scale

[picture of music]


\clef treble \clef bass clefs

[picture of music]


\time 3/4 \time 4/4 time signature

[picture of music]


Go back to index of LilyPond.

Please send GNU LilyPond questions and comments to lilypond-user@gnu.org.

Please send comments on these web pages to (address unknown)

Copyright (c) 1997--2002 Han-Wen Nienhuys and Jan Nieuwenhuizen.

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


This page was built from LilyPond-1.7.14 (development-branch) by

Buchan Milne <(address unknown)>, Thu Mar 6 21:11:35 2003 CET.