1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @c This file is part of lilypond.tely
5 @c * more details about running lilypond; error messages,
6 @c compiling/viewing (emacs?)
7 @c * where to go from First steps+More basics?
9 @c wherever possible, do not include index entries here; the
10 @c index should point to stuff in the reference manual. -gp
12 @c Your first LilyPond score in 10 minutes?
17 This tutorial starts with a short introduction to the LilyPond music
18 language. After this first contact we will show you how to produce
19 printed output. Then you will be able to create and print your own
23 Many people learn programs by trying and fiddling around with the
24 program. This is also possible with LilyPond. If you click on a
25 picture in the HTML version of this manual, you will see the exact
26 LilyPond input that was used to generate that image.
29 @lilypond[fragment,quote,ragged-right,relative=2]
30 c-\markup { \bold \huge { Click here. } }
34 By cutting and pasting the full input into a test file, you have a
35 starting template for experiments. If you like learning in this way,
36 you will probably want to print out or bookmark
40 @ref{Cheat sheet}, which is a table listing all commands for quick
45 * Running LilyPond for the first time::
46 * More about pitches::
48 * Automatic and manual beams::
50 * Music expressions explained::
52 * Adding articulation marks to notes::
53 * Combining notes into chords::
54 * Advanced rhythmic commands::
55 * Commenting input files::
59 * Single staff polyphony::
67 The first example demonstrates how to enter the most elementary piece
68 of music, a @rglos{scale}. A @rglos{note} can be entered by typing its
69 name, from @samp{a} through @samp{g}. So, if you enter
78 the result looks like this
80 @lilypond[fragment,quote,notime,relative=1]
84 Every piece of LilyPond input needs to have @{curly braces@} placed
85 around the input. For the rest of this manual, most examples will
86 omit these braces, but don't forget them in your own music!
88 In addition, many examples use @code{relative} mode. This is explained
89 in @ref{Octave entry}; for now simply be aware that some examples
90 should be placed inside @code{\relative @{ @emph{...music...} @}}
92 @cindex Case sensitive
93 Finally, LilyPond input is case sensitive. @code{ @{ c d e @} } is
94 valid input; @code{ @{ C D E @} } will produce an error message.
96 The @rglos{duration} of a note is specified by a number after the note
97 name. @samp{1} for a @rglos{whole note}, @samp{2} for a @rglos{half note},
98 @samp{4} for a @rglos{quarter note} and so on
104 @lilypond[fragment,quote,notime,relative=2]
105 \set Staff.autoBeaming = ##f
106 { a1 a2 a4 a16 a32 s16_" " }
109 If you do not specify a duration, the duration last entered is used
110 for the next notes. The duration of the first note in input defaults
117 @lilypond[fragment,quote,notime,relative=2]
118 { a a8 a a2 a s16_" " }
122 A @rglos{rest} is entered just like a note, but with the name @samp{r}
128 @lilypond[fragment,quote,notime]
132 Add a dot @samp{.} after the duration to get a @rglos{dotted note}
138 @lilypond[fragment,quote,notime,relative=1]
139 { a2. a4 a8. a16 s16_" " }
142 The (or @rglos{time signature}) can be set with the @code{\time}
151 @c A clef here may lead to confusion, remove it.
152 @lilypond[fragment,quote]
153 \override Staff.Clef #'transparent = ##t
162 The @rglos{clef} can be set using the @code{\clef} command
171 @lilypond[fragment,quote,notime]
182 Remember to enclose the notes and commands in curly braces
183 @code{@{@tie{}@dots{}@tie{}@}} to convert it to printable output.
185 @c @li lypond[fragment,quote,noindent,line-width=55\staff-space]
186 @lilypond[fragment,quote,noindent,verbatim]
193 For more information on
197 @item Entering pitches and durations
199 @ref{Pitches}, and @ref{Durations}.
204 @item Time signatures and other timing commands
205 see @ref{Time signature}.
210 @node Running LilyPond for the first time
211 @section Running LilyPond for the first time
213 @c cheesy title to avoid clash with chapter name.
215 In the last section we explained what kind of things you can enter in
216 a LilyPond file. In this section we will explain what commands to run
217 and how to view or print the output. If you have not used LilyPond
218 before, want to test your setup, or want to run an example file
219 yourself, read this section.
221 @unnumberedsubsec MacOS X
223 If you double click LilyPond.app, it will open with an example
224 file. Save it, for example, to @file{test.ly} on your Desktop, and
225 then process it with the menu command @samp{Compile > Typeset File}.
226 The resulting PDF file will be displayed on your screen.
228 Be warned that the first-ever run will take a minute or two, because
229 all of the system fonts have to be analyzed first.
231 @unnumberedsubsec Windows
233 On Windows, start up a text-editor@footnote{Any simple or
234 programmer-oriented editor will do, for example Notepad. Do not use a
235 word processor, since these insert formatting codes that will confuse
242 Save it on the desktop as @file{test.ly} and make sure that it is not
243 called @file{test.ly.TXT}. Double clicking @file{test.ly} will process
244 the file and show the resulting PDF file.
247 @unnumberedsubsec Unix
249 Begin by opening a terminal window and starting a text editor. For
250 example, you could open an xterm and execute
251 @code{joe}.@footnote{There are macro files for VIM addicts, and there
252 is a @code{LilyPond-mode} for Emacs addicts. If they have not been
253 installed already, refer to the file @file{INSTALL.txt}.} In your
254 text editor, enter the following input and save the file as
262 To process @file{test.ly}, proceed as follows
269 You will see something resembling
276 Interpreting music... [1]
277 Preprocessing graphical objects...
278 Calculating line breaks... [2]
279 Layout output to `test.ps'...
280 Converting to `test.pdf'...
284 @cindex Viewing music
287 The result is the file @file{test.pdf} which you can print or view
288 with the standard facilities of your operating system.@footnote{If
289 your system does not have any tools installed, you can try
290 @uref{http://@/www@/.cs@/.wisc@/.edu/@/~ghost/,Ghostscript}, a freely
291 available package for viewing and printing PDF and PostScript files.}
293 @node More about pitches
294 @section More about pitches
296 A @rglos{sharp} (@texisharp{}) pitch is made by adding @samp{is} to
297 the name, a @rglos{flat} (@texiflat{}) pitch by adding @samp{es}. As
298 you might expect, a @rglos{double sharp} or @rglos{double flat} is
299 made by adding @samp{isis} or @samp{eses}@footnote{This syntax
300 derived from note naming conventions in Nordic and Germanic languages,
301 like German and Dutch.}
307 @lilypond[fragment,quote,notime]
308 \set Score.timing = ##f
309 \transpose c c' { cis1 ees fisis aeses s16_" " }
312 @cindex key signature, setting
313 The key signature is set with the command @code{\key}, followed by
314 a pitch and @code{\major} or @code{\minor}
323 @lilypond[fragment,quote,notime,fragment]
331 Key signatures together with the pitches (including alterations) are
332 used to determine when to print accidentals. This is a
333 feature that often causes confusion to newcomers, so let us explain it
337 LilyPond makes a sharp distinction between musical content and
338 layout. The alteration (flat, natural or sharp) of a note is part of
339 the pitch, and is therefore musical content. Whether an accidental (a
340 flat, natural or sharp @emph{sign}) is printed in front of the
341 corresponding note is a question of layout. Layout is something that
342 follows rules, so accidentals are printed automatically according to
343 those rules. The pitches in your music are works of art, so they will
344 not be added automatically, and you must enter what you want to hear.
348 @lilypond[quote,notime,fragment]
354 no note has an explicit accidental, but you still must enter
362 The code @samp{d} does not mean `print a black dot just below the
363 staff.' Rather, it means: `a note with pitch D-natural.' In the key
364 of A-flat major, it does get an accidental
366 @lilypond[quote,notime,fragment,relative=1,verbatim]
371 Adding all alterations explicitly might require a little more effort
372 when typing, but the advantage is that transposing is easier, and
373 accidentals can be printed according to different conventions. See
374 @ref{Automatic accidentals}, for some examples how accidentals can be printed
375 according to different rules.
378 For more information on
383 see @ref{Automatic accidentals}.
386 see @ref{Key signature}.
391 @section Entering ties
394 A @rglos{tie} is created by appending a tilde @samp{~} to the first
397 @lilypond[quote,notime,fragment,verbatim,relative=3]
401 For more information on Ties see @ref{Ties}.
405 @node Automatic and manual beams
406 @section Automatic and manual beams
408 @cindex beams, by hand
409 All @rglos{beam}s are drawn automatically
411 @lilypond[quote,fragment,relative=2,verbatim]
416 If you do not like where beams are put, they can be entered by
417 hand. Mark the first note to be beamed with @samp{[} and the last one
420 @lilypond[quote,fragment,relative=2,verbatim]
424 For more information on beams, see @ref{Manual beams}.
427 Here are key signatures, accidentals and ties in action
429 @lilypond[fragment,quote,noindent,line-width=50\staff-space,verbatim]
436 fis4 fis8 fis8 eis4 a8 gis~
445 There are some interesting points to note in this example. Bar lines
446 and beams are drawn automatically. Line breaks are calculated
447 automatically; it does not matter where the line breaks are in the
448 source file. Finally, the order in which time, key, and clef changes
449 are entered is not relevant: in the printout, these are ordered
450 according to standard notation conventions.
455 @section Octave entry
458 @c Tim wants to move this quotes example just before the: quotes-do not-work
459 @c score, but we'd need to remove quotes from the other two (key and
462 @c better to have this just before the `octaves are bad' snipped
463 @c but we'd need to remove the ', from \key and tie
464 To raise a note by an octave, add a high quote @code{'} (apostrophe) to
465 the note name, to lower a note one octave, add a `low quote' @code{,}
466 (comma). Middle C is @code{c'}
468 @lilypond[quote,notime,fragment,verbatim]
469 c'4 c'' c''' \clef bass c c,
472 An example of the use of quotes is in the following Mozart fragment
474 @lilypond[quote,ragged-right,fragment,verbatim]
477 cis''8. d''16 cis''8 e''4 e''8
478 b'8. cis''16 b'8 d''4 d''8
482 This example shows that music in a high register needs lots of quotes.
483 This makes the input less readable, and it is a source of errors. The
484 solution is to use `relative octave' mode. This is the
485 most convenient way to copy existing music.
487 In relative mode, a note without octavation quotes (i.e. the @code{'}
488 or @code{,} after a note) is chosen so that it is closest to the
489 previous one. For example, @samp{c f} goes up while @samp{c g} goes
492 To use relative mode, add @code{\relative} before the piece of
493 music. The first note is taken relative to the middle C
494 @c no , for this sentence
499 @lilypond[quote,notime,fragment,verbatim]
506 Since most music has small intervals, pieces can be written almost
507 without octavation quotes in relative mode. The previous example is
510 @lilypond[quote,ragged-right,verbatim]
514 cis'8. d16 cis8 e4 e8
519 @c needed better, maybe even redundant explanation
520 @c added another example below.
521 @c grappig: Pa vond het heel logies, en slim toen-i eenmaal begreep.
522 @c in eerste instantie drong het `relative' niet door zonder extra uitleg.
523 Larger intervals are made by adding octavation quotes.
525 @lilypond[quote,notime,verbatim,fragment]
531 In summary, quotes or commas no longer determine the absolute height
532 of a note in @code{\relative} mode. Rather, the height of a note is
533 relative to the previous one, and changing the octave of a single note
534 shifts all following notes an octave up or down.
536 For more information on relative octaves see @ref{Relative octaves},
537 and @ref{Octave check}.
540 @node Music expressions explained
541 @section Music expressions explained
544 In input files, music is represent by so-called @emph{music
545 expression}s. We have already seen some in the previous examples;
546 a single note is a music expression
548 @lilypond[fragment,quote,verbatim,relative=3]
552 Enclosing a group of notes in braces creates a new music
555 @lilypond[fragment,quote,verbatim,relative=3]
559 Putting a bunch of music expressions (e.g., notes) in braces, means that
560 they should be played in sequence. The result again is a music
561 expression, which can be grouped with other expressions sequentially.
562 Here, the expression from the previous example is combined with two
565 @lilypond[fragment,quote,verbatim,relative=3]
569 This technique is useful for non-monophonic music. To enter music
570 with more voices or more staves, we also combine expressions in
571 parallel. Two voices that should play at the same time, are entered
572 as a simultaneous combination of two sequences. A `simultaneous'
573 music expression is formed by enclosing expressions in @code{<<} and
574 @code{>>}. In the following example, three sequences (all containing
575 two separate notes) are combined simultaneously
577 @lilypond[fragment,quote,verbatim,relative=3]
585 This mechanism is similar to mathematical
586 formulas: a big formula is created by composing small formulas. Such
587 formulas are called expressions, and their definition is recursive, so
588 you can make arbitrarily complex and large expressions. For example,
597 ((1 + 2) * 3) / (4 * 5)
601 @cindex music expression
602 This is a sequence of expressions, where each expression is contained
603 in the next (larger) one. The simplest expressions are numbers, and larger
604 ones are made by combining expressions with operators (like @samp{+},
605 @samp{*} and @samp{/}) and parentheses. Like mathematical expressions,
606 music expressions can be nested arbitrarily deep, which is necessary
607 for complex music like polyphonic scores.
609 Note that this example only has one staff, whereas
610 the previous example had three separate staves. That is because this
611 example begins with a single note. To determine the number of staves,
612 LilyPond looks at the first element. If it is a single note, there is one
613 staff; if there is a simultaneous expression, there is more than one staff.
615 @lilypond[fragment,quote,verbatim,relative=2]
618 << { e f } { c <<b d>> } >>
622 Music files with deep nesting can be confusing to enter and
623 maintain. One convention that helps against this confusion is
624 indenting. When entering a file with deep nesting of braces and
625 angles, it is customary to use an indent that indicates the nesting
626 level. Formatting music like this eases reading and helps you insert
627 the right number of closing braces at the end of an expression. For
641 Some editors have special support for entering LilyPond, and can help
642 indenting source files. See @ref{Editor support} for more information.
647 To print more than one staff, each piece of music that makes up a
648 staff is marked by adding @code{\new Staff} before it. These
649 @code{Staff} elements are then combined in parallel with @code{<<} and
650 @code{>>}, as demonstrated here
652 @lilypond[quote,fragment,verbatim]
654 \new Staff { \clef treble c'' }
655 \new Staff { \clef bass c }
660 The command @code{\new} introduces a `notation context.' A notation
661 context is an environment in which musical events (like notes or
662 @code{\clef} commands) are interpreted. For simple pieces, such
663 notation contexts are created automatically. For more complex pieces, it
664 is best to mark contexts explicitly. This ensures that each fragment
667 There are several types of contexts. @code{Staff}, @code{Voice} and
668 @code{Score} handle melodic notation, while @code{Lyrics} sets lyric
669 texts and @code{ChordNames} prints chord names.
671 In terms of syntax, prepending @code{\new} to a music expression
672 creates a bigger music expression. In this way it resembles the minus
673 sign in mathematics. The formula @math{(4+5)} is an expression, so
674 @math{-(4+5)} is a bigger expression.
676 We can now typeset a melody with two staves
678 @c TODO: (c) status of this Paul McCartney (?) song (let's all stand together)
680 @lilypond[fragment,quote,verbatim,ragged-right]
697 For more information on contexts see the description in
698 @ref{Interpretation contexts}.
702 @node Adding articulation marks to notes
703 @section Adding articulation marks to notes
709 Common accents can be added to a note using a dash (@samp{-}) and a
712 @lilypond[fragment,quote,verbatim,relative=2]
713 c-. c-- c-> c-^ c-+ c-_
717 Similarly, fingering indications can be added to a note using a dash
718 (@samp{-}) and the digit to be printed
720 @lilypond[fragment,quote,verbatim,relative=2]
724 Articulations and fingerings are usually placed automatically, but you
725 can specify a direction using @samp{^} (up) or @samp{_} (down). You can
726 also use multiple articulations on the same note. In most cases, however,
727 it is best to let LilyPond determine the articulation directions.
729 @lilypond[fragment,quote,verbatim,relative=2]
730 c_-^1 d^. f^4_2-> e^-_+
733 Dynamic signs are made by adding the markings (with a backslash) to
736 @lilypond[fragment,quote,verbatim,relative=2]
744 Crescendi and decrescendi are started with the commands @code{\<} and
745 @code{\>}. An ending dynamic, for example @code{\f}, will finish the
746 (de)crescendo, or the command @code{\!} can be used
748 @lilypond[fragment,quote,verbatim,relative=2]
756 A @rglos{slur} is a curve drawn across many notes, and indicates
757 legato articulation. The starting note and ending note are marked
758 with @samp{(} and @samp{)}, respectively
760 @lilypond[fragment,quote,fragment,relative=2,verbatim]
761 d4( c16) cis( d e c cis d) e( d4)
764 @cindex slurs versus ties
765 A slur looks like a @rglos{tie}, but it has a different meaning. A
766 tie simply makes the first note sound longer, and can only be used on
767 pairs of notes with the same pitch. Slurs indicate the articulations
768 of notes, and can be used on larger groups of notes. Slurs and ties
771 @lilypond[quote,fragment,relative=2]
772 c2~( c8 fis fis4 ~ fis2 g2)
775 @cindex phrasing slurs
776 Slurs to indicate phrasing can be entered with @code{\(} and
777 @code{\)}, so you can have both legato slurs and phrasing slurs at the
778 same time. You cannot have simultaneous slurs or simultaneous
781 @lilypond[quote,fragment,relative=2,verbatim]
782 a8(\( ais b c) cis2 b'2 a4 cis, c\)
786 For more information on
791 see @ref{Fingering instructions}.
793 see @ref{Articulations}.
797 see @ref{Phrasing slurs}.
804 @node Combining notes into chords
805 @section Combining notes into chords
808 Chords can be made by surrounding pitches with angle brackets.
809 Angle brackets are the symbols @samp{<} and @samp{>}.
811 @lilypond[quote,relative=1,fragment,verbatim]
816 You can combine markings like beams and ties with chords. They must
817 be placed outside the angled brackets
819 @lilypond[quote,relative=1,fragment,verbatim]
820 r4 <c e g>8[ <c f a>]~ <c f a>
824 r4 <c e g>8\>( <c e g> <c e g> <c f a>\!)
827 @lilypond[quote,relative=1,fragment]
829 r4 <c e g>8\>( <c e g> <c e g> <c f a>\!)
833 @node Advanced rhythmic commands
834 @section Advanced rhythmic commands
838 @cindex partial measure
839 A pickup is entered with the keyword @code{\partial}. It
840 is followed by a duration: @code{\partial 4} is a quarter note upstep
841 and @code{\partial 8} an eighth note
843 @lilypond[quote,relative=2,verbatim,fragment]
850 Tuplets are made with the @code{\times} keyword. It takes two
851 arguments: a fraction and a piece of music. The duration of the piece
852 of music is multiplied by the fraction. Triplets make notes occupy
853 2/3 of their notated duration, so a triplet has 2/3 as its fraction
855 @lilypond[quote,relative=1,verbatim,fragment]
856 \times 2/3 { f8 g a }
862 Grace notes are also made by prefixing a music expression with the
863 keyword @code{\appoggiatura} or @code{\acciaccatura}
867 @lilypond[quote,relative=2,verbatim,fragment]
868 c4 \appoggiatura b16 c4
869 c4 \acciaccatura b16 c4
874 For more information on
879 see @ref{Grace notes},
883 see @ref{Partial measures}.
888 @node Commenting input files
889 @section Commenting input files
893 @cindex block comment
894 A comment is a remark for the human reader of the music input; it is
895 ignored while parsing, so it has no effect on the printed output.
896 There are two types of comments. The percent symbol @samp{%}
897 introduces a line comment; after @code{%} the rest of the line is
898 ignored. A block comment marks a whole section of music
899 input. Anything that is enclosed in @code{%@{} and @code{%@}} is
900 ignored. The following fragment shows possible uses for comments
903 % notes for twinkle twinkle follow
907 This line, and the notes below
908 are ignored, since they are in a
915 @c TODO post-2.6 reorg
916 @c This is good info, but I wouldn't call it a comment. IMO it should
917 @c be moved somewhere else.
921 There is a special statement that is a kind of comment. The @code{\version}
922 statement marks for which version of LilyPond the file was written.
923 To mark a file for version 2.6.0, use
930 These annotations make future upgrades of LilyPond go more
931 smoothly. Changes in the syntax are handled with a special program,
932 @file{convert-ly} (see @ref{Updating files with convert-ly}), and it uses
933 @code{\version} to determine what rules to apply.
936 @node Printing lyrics
937 @section Printing lyrics
940 @c TODO: (c) status of the Queen fragment.
944 Lyrics are entered by separating each syllable with a space
952 @lilypond[quote,verbatim,fragment,ragged-right]
954 r4 c \times 2/3 { f g g }
955 \times 2/3 { g4( a2) }
959 The lyrics can be set to these notes, combining both with the
960 @code{\addlyrics} keyword
962 @lilypond[quote,verbatim,fragment,ragged-right]
965 r4 c \times 2/3 { f g g }
966 \times 2/3 { g4( a2) }
968 \addlyrics { I want to break free }
973 @cindex extender line
975 This melody ends on a @rglos{melisma}, a single syllable (`free')
976 sung to more than one note. This is indicated with an @emph{extender
977 line}. It is entered as two underscores, i.e.,
980 @{ I want to break free __ @}
983 @lilypond[fragment,quote,ragged-right]
986 r4 c \times 2/3 { f g g }
987 \times 2/3 { g4( a2) }
989 \addlyrics { I want to break free __ }
993 Similarly, hyphens between words can be entered as two dashes,
994 resulting in a centered hyphen between two syllables
997 Twin -- kle twin -- kle
1000 @lilypond[fragment,quote,ragged-right]
1006 \addlyrics { Twin -- kle twin -- kle }
1010 More options, like putting multiple lines of lyrics below a melody are
1011 discussed in @ref{Vocal music}.
1015 @section A lead sheet
1021 @c TODO: revise this, \chords { } is shorter and more intuitive.
1023 In popular music, it is common to denote accompaniment with chord names.
1024 Such chords can be entered like notes,
1026 @lilypond[quote,verbatim,ragged-right]
1027 \chordmode { c2 f4. g8 }
1031 Now each pitch is read as the root of a chord instead of a note.
1032 This mode is switched on with @code{\chordmode}
1034 Other chords can be created by adding modifiers after a colon. The
1035 following example shows a few common modifiers
1037 @lilypond[quote,verbatim,ragged-right]
1038 \chordmode { c2 f4:m g4:maj7 gis1:dim7 }
1041 For lead sheets, chords are not printed on staves, but as names on a
1042 line for themselves. This is achieved by using @code{\chords} instead
1043 of @code{\chordmode}. This uses the same syntax as @code{\chordmode},
1044 but renders the notes in a @code{ChordNames} context, with the
1047 @lilypond[quote,verbatim,ragged-right]
1048 \chords { c2 f4.:m g4.:maj7 gis8:dim7 }
1052 When put together, chord names, lyrics and a melody form
1053 a lead sheet, for example,
1057 \chords @{ @emph{chords} @}
1059 \addlyrics @{ @emph{the text} @}
1064 @lilypond[quote,ragged-right]
1066 \chords { r2 c:sus4 f }
1068 r4 c' \times 2/3 { f g g }
1069 \times 2/3 { g4( a2) }
1071 \addlyrics { I want to break free __ }
1075 A complete list of modifiers and other options for layout can be found
1080 @section Adding titles
1082 Bibliographic information is entered in a separate block, the
1083 @code{\header} block. The name of the piece, its composer, etc., are
1084 entered as an assignment, within @code{\header
1085 @{@tie{}@dots{}@tie{}@}}. The @code{\header} block is usually put at
1086 the top of the file. For example,
1091 composer = "Igor Stravinsky"
1098 When the file is processed, the title and composer are printed above
1099 the music. More information on titling can be found in @ref{Creating
1103 @node Single staff polyphony
1104 @section Single staff polyphony
1107 @cindex multiple voices
1108 @cindex voices, more -- on a staff
1109 When different melodic lines are combined on a single staff they are
1110 printed as polyphonic voices; each voice has its own stems, slurs and
1111 beams, and the top voice has the stems up, while the bottom voice has
1114 Entering such parts is done by entering each voice as a sequence (with
1115 @code{@{...@}}), and combining these simultaneously, separating the
1116 voices with @code{\\}
1118 @lilypond[quote,verbatim,relative=2,fragment]
1119 << { a4 g2 f4~ f4 } \\
1123 For polyphonic music typesetting, spacer rests can also be convenient;
1124 these are rests that do not print. They are useful for filling up
1125 voices that temporarily do not play. Here is the same example with a
1126 spacer rest (@code{s}) instead of a normal rest (@code{r}),
1128 @lilypond[quote,verbatim,relative=2,fragment]
1129 << { a4 g2 f4~ f4 } \\
1134 Again, these expressions can be nested arbitrarily
1136 @lilypond[quote,fragment,verbatim,relative=2,fragment]
1144 { <c g>1 ~ <c g>4 } \\
1150 More features of polyphonic typesetting are described in this manual
1151 in section @ref{Polyphony}.
1155 @section Piano staves
1157 @cindex staff switch, manual
1158 @cindex cross staff voice, manual
1159 Piano music is typeset in two staves connected by a brace. Printing
1160 such a staff is similar to the polyphonic example in @ref{More staves},
1163 << \new Staff @{ @dots{} @}
1164 \new Staff @{ @dots{} @} >>
1168 but now this entire expression must be interpreted as a
1172 \new PianoStaff << \new Staff @dots{} >>
1175 Here is a small example
1177 @lilypond[quote,verbatim,relative=1,fragment]
1179 \new Staff { \time 2/4 c4 c g' g }
1180 \new Staff { \clef bass c,, c' e c }
1184 More information on formatting piano music is given in @ref{Piano music}.