Node:Running LilyPond, Next:, Previous:First steps, Up:Tutorial



Running LilyPond

In the last section we explained what kind of things you could enter in a LilyPond file. In this section we 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:

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

To process test.ly, proceed as follows:

          lilypond test.ly
          

You will see something resembling:

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

The result is the file test.pdf.2 One of the following commands should put the PDF on your screen:

            gv test.pdf
            ghostview test.pdf
            ggv test.pdf
            kghostview test.pdf
            xpdf test.pdf
            gpdf test.pdf
            acroread test.pdf
            gsview32 test.pdf
          

If the music on your screen looks good, you can print it by clicking File/Print inside your viewing program.

On Windows, the same procedure should work, the terminal is started by clicking on the LilyPond or Cygwin icon. Any text editor (such as NotePad, Emacs or Vim) may be used to edit the LilyPond file.

To view the PDF file, try the following:

The commands for formatting and printing music on all platforms are detailed in Invoking LilyPond.


Footnotes

  1. There are macro files for VIM addicts, and there is a LilyPond-mode for Emacs addicts. If it has not been installed already, then refer to the file INSTALL.txt

  2. For TeX afficionados: 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.



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

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