Next: , Previous: First steps, Up: Tutorial


2.2 Running LilyPond for the first time

In the last section we explained what kind of things you can enter in a LilyPond file. In this section we will explain what commands to run and how to view or print the output. If you have not used LilyPond before, want to test your setup, or want to run an example file yourself, read this section.

MacOS X

If you double click LilyPond.app, it will open with an example file. Save it, for example, to test.ly on your Desktop, and then process it with the menu command `Compile > Typeset File'. The resulting PDF file will be displayed on your screen.

Be warned that the first-ever run will take a minute or two, because all of the system fonts have to be analyzed first.

Windows

On Windows, start up a text-editor1 and enter

{ c'4 e' g' }

Save it on the desktop as test.ly and make sure that it is not called test.ly.TXT. Double clicking test.ly will process the file and show the resulting PDF file.

Unix

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

{ c'4 e' g' }

To process test.ly, proceed as follows

lilypond test.ly

You will see something resembling

lilypond test.ly
GNU LilyPond 2.6.0
Processing `test.ly'
Parsing...
Interpreting music... [1]
Preprocessing graphical objects...
Calculating line breaks... [2]
Layout output to `test.ps'...
Converting to `test.pdf'...

The result is the file test.pdf which you can print or view with the standard facilities of your operating system.3


Footnotes

[1] Any simple or programmer-oriented editor will do, for example Notepad. Do not use a word processor, since these insert formatting codes that will confuse LilyPond.

[2] There are macro files for VIM addicts, and there is a LilyPond-mode for Emacs addicts. If they have not been installed already, refer to the file INSTALL.txt.

[3] If your system does not have any tools installed, you can try Ghostscript, a freely available package for viewing and printing PDF and PostScript files.


This page is for LilyPond-2.6.3 (stable-branch).

Report errors to <bug-lilypond@gnu.org>.

Other languages: English.
Using automatic language selection.