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. The instructions that follow are for Unix-like systems. Some additional instructions for Microsoft 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
.1 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.5.0 Processing `test.ly' Parsing... Interpreting music... [1] Preprocessing graphical objects... Calculating line breaks... [2] Layout output to `test.tex'... Converting to `test.dvi'... Converting to `test.ps'... Converting to `test.pdf'...
The result is the file test.pdf2 which you can print or view with the standard facilities of your operating system.3
On Windows, start up a text-editor4 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.
[1] 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.
[2] For TeX
aficionados: there is also a test.dvi file. It can be viewed
with xdvi
. The DVI uses a lot of PostScript specials, which do
not show up in the magnifying glass. The specials also mean that the
DVI file cannot be processed with dvilj
. Use dvips
for
printing.
[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.
[4] 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.
This page is for LilyPond-2.5.11 (development-branch).