[icon]

GNU LilyPond

Welcome to the home of the GNU Music Typesetter

What is LilyPond
General information
Simple examples
Complex examples
Download
GNU/Linux binaries
Windows
Source code
Documentation
Tutorial
Manual
Glossary
other ...

Support
Mailing lists
Search
WikiWiki
FAQs

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

Node:Running LilyPond, Next:, Previous:Simple legend, Up:Tutorial



Running LilyPond

You write music with LilyPond as follows: first you edit a text file containing a description of the notes. Then you run LilyPond on the file. This leaves you with an output file, which you can view or print.

In this section we explain how to run LilyPond, and view or print the output. If you have not used LilyPond before, want to test your setup of LilyPond, or try to run an example file yourself, then 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.

You begin with opening a terminal window, and start up a text editor. For example, 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' }
}

To run LilyPond, you invoke ly2dvi to compile your LilyPond source file:


ly2dvi -P test.ly

You will see the following on your screen:


GNU LilyPond 1.4.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 you are satisfied with the looks of the music displayed on your screen, you can print the PS file 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. Execute xdvi test.dvi to view the DVI file.

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

If you can't get the examples to print, then you should look into installing and configuring ghostscript. Refer to GhostScript's website at http://www.ghostscript.com.

Windows users

Windows users start the terminal by clicking on the LilyPond icon. Notepad is sufficient for editing the LilyPond file. Viewing the PS file can be done with gsview32 test.ps. Viewing DVI files can be done with yap test.dvi. The "print" button in Yap will print files. You can also print from the command line by executing gsview32 /s test.ps

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 lilypond@packages.debian.org

Copyright (c) 1997--2001 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.4.12 (stable-branch) by

Anthony Fok <lilypond@packages.debian.org>, Tue Mar 12 01:35:39 2002 HKT.