]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/tex/reference-manual.tely
patch::: 1.2.5.jcn1
[lilypond.git] / Documentation / tex / reference-manual.tely
1 \input texinfo @c -*-texinfo-*-
2 @setfilename reference-manual.info
3 @settitle LilyPond 1-2-0 Reference Manual
4
5 @c ls-latex
6 @ignore
7 @author Adrian Mariano, Han-Wen Nienhuys and Jan Nieuwenhuizen
8 @title LilyPond Regression test
9 @end ignore
10
11
12 @ifinfo
13
14 This is the reference documentation to LilyPond.  It is not a tutorial.
15 It was written by Han-Wen Nienhuys, Adrian Mariano and Jan Nieuwenhuizen
16
17
18 Copyright 1999 by its authors.
19 @end ifinfo
20
21 @titlepage
22 @sp 10
23 @comment The title is printed in a large font.
24 @center @titlefont{LilyPond Reference manual}
25 @vskip 20pt
26 @center @titlefont{Han-Wen Nienhuys, Adrian Mariano, Jan Nieuwenhuizen}
27
28 @vskip 0pt plus 1filll
29 Copyright @copyright{} 1999 by its authors
30 @end titlepage
31
32
33 @node Top, , Running LilyPond, (dir)
34 @top
35 @menu
36 * LilyPond 1-2-0 Reference Manual::LilyPond 1-2-0 Reference Manual
37 @end menu
38
39
40 @node LilyPond 1-2-0 Reference Manual, Overview, , Top
41 @menu
42 * Overview::                      Overview
43 * Top level::                     Top level
44 * notenames::                     notenames
45 * Lexical conventions::           Lexical conventions
46 * notelang::                      notelang
47 * modes::                         modes
48 * Types::                         Types
49 * Music expressions::             Music expressions
50 * Atomic music expressions::      Atomic music expressions
51 * atomicmusic::                   atomicmusic
52 * notedesc::                      notedesc
53 * barlines::                      barlines
54 * manualbeam::                    manualbeam
55 * tremolo::                       tremolo
56 * Compound music expressions::    Compound music expressions
57 * compoundmusic::                 compoundmusic
58 * relative::                      relative
59 * sec-repeats::                   sec-repeats
60 * transpose::                     transpose
61 * Ambiguities::                   Ambiguities
62 * Notation conversion specifics:: Notation conversion specifics
63 * autobeam::                      autobeam
64 * lyricprint::                    lyricprint
65 * Notation Contexts::             Notation Contexts
66 * contextselection::              contextselection
67 * Notation output definitions::   Notation output definitions
68 * output::                        output
69 * paper::                         paper
70 * papervars::                     papervars
71 * contextdefs::                   contextdefs
72 * engravers::                     engravers
73 * Sound output::                  Sound output
74 * midilist::                      midilist
75 * Pre-defined Identifiers::       Pre-defined Identifiers
76 * ident::                         ident
77 * Running LilyPond::              Running LilyPond
78 @end menu
79 @chapter LilyPond 1.2.0 Reference Manual
80
81
82 @node Overview, Top level, LilyPond 1-2-0 Reference Manual, LilyPond 1-2-0 Reference Manual
83 @section Overview
84
85 This document@footnote{This document has been revised for
86 LilyPond 1.2.} describes the the GNU LilyPond input format, which is
87 a language for defining music.  We call this language @emph{Music
88 Definition Language} or @emph{Mudela}, for short.@footnote{If anybody
89 comes up with a better name, we'd gladly take this.  Gourlay already
90 uses a ``Musical Description Language,'' ISO standard 10743 defines a
91 ``Standard Music Description Language.''  We're not being original
92 here.}
93
94 @emph{Mudela} is a language that allows you to
95
96 @itemize @bullet
97   @item  create musical expressions by combining pitches, durations 
98   @item  output those musical expressions to various formats
99   @item  give those musical expressions and output definitions names, so
100        you can enter them in manageable chunks.
101 @end itemize
102
103 @emph{Mudela} aims to define a piece of music completely, both from
104 typesetting and from a performance point of view.
105
106
107
108 @node Top level, notenames, Overview, LilyPond 1-2-0 Reference Manual
109 @section Top level
110
111 @cindex top level
112
113 This section describes what you may enter at top level.
114
115
116
117 @cindex score definition
118
119 The output is generated combining a music expression with an output
120 definition.  A score block has the following syntax:
121
122 @quotation
123
124   @code{\score @{}   @code{@}}
125 @end quotation
126
127  are zero or more output definitions.  If no output
128 definition is supplied, the default @code{\paper} block will be added.
129
130
131
132 @cindex header
133
134 @cindex header@@@code{\header}
135
136 The syntax is
137
138 @quotation
139
140   @code{\header} @code{@{}  = ;
141                          = ; ... @code{@}}
142 @end quotation
143
144 A header describes the file's contents.  It can also appear in a
145 @code{\score} block.  Tools like @code{ly2dvi}
146 @cindex ly2dvi@@@code{ly2dvi}
147  can use this
148 information for generating titles.  Key values that are used by
149 @code{ly2dvi} are: title, subtitle, composer, opus, poet, instrument,
150 metre, arranger, piece and tagline.
151
152 It is customary to put the @code{\header} at the top of the file.
153
154
155 @node notenames, Lexical conventions, Top level, LilyPond 1-2-0 Reference Manual
156
157 Note name tables can be specified using
158
159 @quotation
160
161   @code{\notenames}
162 @cindex notenames@@@code{\notenames}
163
164     @code{@{}  @code{@}}
165 @end quotation
166
167  is a list of definitions of the form
168
169 @quotation
170
171    = 
172 @end quotation
173
174 Chord modifiers can be set analogously, with
175 @code{\chordmodifiers}
176 @cindex chordmodifiers@@@code{\chordmodifiers}
177 .
178
179
180
181 A @code{\paper} block at top level sets the default paper block.  A
182 @code{\midi} block at top level works similarly.
183
184
185
186 LilyPond contains a Scheme interpreter (the GUILE library) for
187 internal use.  The following commands access the interpreter
188 directly.
189
190 @quotation
191
192   @code{\scm}
193 @cindex scm@@@code{\scm}
194   @code{;}
195 @end quotation
196
197 Evaluates the specified Scheme code.  The result is discarded.
198
199 @quotation
200
201   @code{\scmfile}
202 @cindex scmfile@@@code{\scmfile}
203   @code{;}
204 @end quotation
205
206 Reads Scheme code from the specified file.  The result is discarded.
207
208
209
210 Identifier assignments may appear at top level.  Semicolons are
211 forbidden after top level assignments.
212
213
214
215 @node Lexical conventions, notelang, notenames, LilyPond 1-2-0 Reference Manual
216 @section Lexical conventions
217
218 @cindex lexical conventions
219
220
221
222 @cindex comment
223
224 @cindex %@@@code{%}
225
226
227 A one line comment is introduced by a `@code{%}' character. 
228 Block comments are started by `@code{%@{}' and ended by `@code{%@}}'. 
229 They cannot be nested.
230
231
232
233 @cindex keyword
234
235 Keywords start with a backslash, followed by a number of lower case
236 alphabetic characters.  These are all the keywords.
237
238 @quotation
239
240   @code{\accepts}
241   @code{\addlyrics}
242   @code{\alternative}
243   @code{\bar}
244   @code{\breathe}
245   @code{\cadenza}
246   @code{\chordmodifiers}
247   @code{\chords}
248   @code{\clef}
249   @code{\cm}
250   @code{\consists}
251   @code{\consistsend}
252   @code{\context}
253   @code{\duration}
254   @code{\font}
255   @code{\grace}
256   @code{\header}
257   @code{\in}
258   @code{\key}
259   @code{\keysignature}
260   @code{\lyrics}
261   @code{\mark}
262   @code{\midi}
263   @code{\mm}
264   @code{\musicalpitch}
265   @code{\name}
266   @code{\notenames}
267   @code{\notes}
268   @code{\paper}
269   @code{\partial}
270   @code{\penalty}
271   @code{\property}
272   @code{\pt}
273   @code{\relative}
274   @code{\remove}
275   @code{\repeat}
276   @code{\repetitions}
277   @code{\scm}
278   @code{\scmfile}
279   @code{\score}
280   @code{\script}
281   @code{\sequential}
282   @code{\shape}
283   @code{\simultaneous}
284   @code{\skip}
285   @code{\spanrequest}
286   @code{\tempo}
287   @code{\textscript}
288   @code{\time}
289   @code{\times}
290   @code{\translator}
291   @code{\transpose}
292   @code{\type}
293 @end quotation
294
295
296
297
298 @cindex integer
299
300 Formed from an optional minus sign followed by digits.  Arithmetic
301 operations cannot be done with integers, and integers cannot be mixed
302 with reals.
303
304
305
306 @cindex real
307  
308
309 Formed from an optional minus sign and a sequence of digits followed
310 by a @emph{required} decimal point and an optional exponent such as
311 @code{-1.2e3}.  Reals can be built up using the usual operations:
312 `@code{+}
313 @cindex +@@@code{+}
314 ', `@code{-}
315 @cindex -@@@code{-}
316 ', `@code{*}
317 @cindex *@@@code{*}
318 ', and
319 `@code{/}
320 @cindex /@@@code{/}
321 ', with parentheses for grouping.
322
323 A real constant can be followed by one of the dimension
324 keywords:
325 @cindex dimensions
326  @code{\mm}
327 @cindex mm@@@code{\mm}
328 ,
329 @code{\pt}
330 @cindex pt@@@code{\pt}
331 , @code{\in}
332 @cindex in@@@code{\in}
333 , or
334 @code{\cm}
335 @cindex cm@@@code{\cm}
336 , for millimeters, points, inches and
337 centimeters, respectively.  This converts the number to a real that
338 is the internal representation of dimensions.
339
340
341
342 @cindex string
343  
344
345 Begins and ends with the `@code{"}' character.  To include a `@code{"}'
346 character in a string write `@code{\"}'.  Various other backslash
347 sequences have special interpretations as in the C language.  A
348 string that contains no spaces can be written without the quotes. 
349 See section @xref{modes} for details on unquoted strings; their
350 interpretation varies depending on the situation.  Strings can be
351 concatenated with the `@code{+}' operator.
352
353
354
355 The tokenizer accepts the following commands.  They can appear
356 anywhere.
357
358 @quotation
359
360   @code{\maininput}
361 @cindex maininput@@@code{\maininput}
362
363 @end quotation
364
365 This command is used in init files to signal that the user file must
366 be read. This command cannot be used in a user file.
367
368 @quotation
369
370   @code{\include}
371 @cindex include@@@code{\include}
372  
373 @end quotation
374
375 Include .  The argument  may be a quoted string (an
376 unquoted string will not work here!) or a string identifier.  The full
377 filename including the @file{.ly} extension must be given,
378
379 @quotation
380
381   @code{\version}
382 @cindex version@@@code{\version}
383   @code{;}
384 @end quotation
385
386 Specify the version of LilyPond that a file was written for.  The
387 argument is a version string in quotes, for example @code{"1.2.0"}. 
388 This is used to detect invalid input, and to aid
389 @code{convert-mudela}, a tool that automatically upgrades input files.
390
391
392
393 @cindex other languages
394
395 @node notelang, modes, Lexical conventions, LilyPond 1-2-0 Reference Manual
396
397 Note name definitions have been provided in various languages. 
398 Simply include the language specific init file.  For example:
399 `@code{\include "english.ly"}'.  The available language files and the
400 names they define are:
401
402 @quotation
403
404 @example 
405                         Note Names               sharp       flat
406
407 nederlands.ly  c   d   e   f   g   a   bes b   -is         -es
408 english.ly     c   d   e   f   g   a   bf  b   -s/-sharp   -f/-flat
409 deutsch.ly     c   d   e   f   g   a   b   h   -is         -es
410 norsk.ly       c   d   e   f   g   a   b   h   -iss/-is    -ess/-es
411 svenska.ly     c   d   e   f   g   a   b   h   -iss        -ess
412 italiano.ly    do  re  mi  fa  sol la  sid si  -d          -b
413 catalan.ly     do  re  mi  fa  sol la  sid si  -d/-s       -b 
414 @end example 
415
416 @end quotation
417
418 Pitch names can be redefined using the
419 @code{\notenames}
420 @cindex notenames@@@code{\notenames}
421  command, see
422 subsection @xref{notenames}.
423
424
425
426 @cindex lexical modes
427
428 @cindex modes
429
430 @node modes, Types, notelang, LilyPond 1-2-0 Reference Manual
431
432 To simplify entering notes, lyrics, and chords, @emph{Mudela} has three
433 special input modes on top of the default mode.  In each mode, words
434 are identified on the input.  If @code{"word"} is encountered, it is
435 treated as a string.  If @code{\word} is encountered, it is treated as
436 a keyword or as an identifier.  The behavior of the modes differs in
437 two ways: Different modes treat unquoted words differently, and
438 different modes have different rules for deciding what is a word.
439
440 @table @samp
441   @item Normal mode.
442 @cindex mode!normal
443  
444     At the start of parsing, @emph{Mudela} is in Normal mode.  In Normal
445     mode, a word is an alphabetic character followed by alphanumeric
446     characters.  If @code{word} is encountered on the input it is
447     treated as a string.
448
449   @item Note mode.
450 @cindex mode!note
451
452     Note mode is introduced by the keyword
453     @code{\notes}
454 @cindex notes@@@code{\notes}
455 .  In Note mode, words can only
456     contain alphabetic characters.  If @code{word} is encountered,
457     LilyPond first checks for a notename of @code{word}.  If no
458     notename is found, then @code{word} is treated as a string.
459
460     Since combinations of numbers and dots are used for indicating
461     durations, it is not possible to enter real numbers in this mode.
462
463   @item Chord mode.
464 @cindex mode!chord
465
466     Chord mode is introduced by the keyword
467     @code{\chords}
468 @cindex chords@@@code{\chords}
469 .  It is similar to Note mode, but
470     words are also looked up in a chord modifier table (containing
471     @code{maj}, @code{dim}, etc).
472
473     Since combinations of numbers and dots are used for indicating
474     durations, you can not enter real numbers in this mode.  Dashes
475     and carets are used to indicate chord additions and subtractions,
476     so scripts can not be entered in Chord mode.
477
478   @item Lyrics mode. 
479 @cindex mode!lyric
480
481     Lyrics mode is introduced by the keyword
482     @code{\lyrics}
483 @cindex lyrics@@@code{\lyrics}
484 .  This mode has rules that make it
485     easy to include punctuation and diacritical marks in words.  A
486     word in Lyrics mode begins with: an alphabetic character,
487     `@code{_}', `@code{?}', `@code{!}', `@code{:}', `@code{'}', the
488     control characters @code{^A} through @code{^F}, @code{^Q} through
489     @code{^W}, @code{^Y}, @code{^^}, any 8-bit character with ASCII code
490     over 127, or a two-character combination of a backslash followed
491     by one of `@code{`}', `@code{'}', `@code{"}', or
492     `@code{^}'.@footnote{The purpose of Lyrics mode is that you can
493     enter lyrics in TeX format or a standard encoding without
494     needing quotes.  The precise definition of this mode indeed is
495     ludicrous.  This will remain so until the authors of LilyPond
496     acquire a deeper understanding of character encoding, or someone
497     else steps up to fix this.}
498
499     Subsequent characters of a word can be any character that is not
500     a digit and not white space.  One important consequence of this
501     is that a word can end with `@code{@}}', which may be confusing if
502     you thought the closing brace was going to terminate Lyrics
503     mode.@footnote{LilyPond will issue a warning, though.}  Any
504     `@code{_}' characters which appear in an unquoted word are
505     converted to spaces.  This provides a mechanism for introducing
506     spaces into words without using quotes.  Quoted words can also be
507     used in Lyrics mode to specify words that cannot be written with
508     the above rules.  Here are some examples.  Not all of these words
509     are printable by TeX.
510
511
512     @quotation
513
514 @example 
515 Ah!             % a word
516 2B_||_!2B       % not a word because it starts with a digit
517 ``Hello''       % not a word because it starts with `
518 _ _ _ _         % 4 words, each one a space 
519 @end example 
520
521     @end quotation
522
523     Since combinations of numbers and dots are used for indicating
524     durations, you can not enter real numbers in this mode.
525 @end table
526
527 It is possible to create words that break the rules by prefixing them
528 with the dollar sign `@code{$}
529 @cindex $@@@code{$}
530 '.  Regardless of the context, a
531 word beginning with `@code{$}' extends until the next white space
532 character.  Such words can contain numbers (even in Note mode), or
533 other forbidden characters.  The dollar sign can be used to create
534 and access identifiers that could not otherwise be used.@footnote{Use
535 of `@code{$}' hampers readability and portability to future LilyPond
536 versions, thus the use of the dollar sign is discouraged.}
537
538
539
540 @node Types, Music expressions, modes, LilyPond 1-2-0 Reference Manual
541 @section Types
542
543 @cindex types and identifiers
544
545 @emph{Mudela} has a limited set of types:
546
547 @itemize @bullet
548   @item  integers
549   @item  reals
550   @item  strings
551   @item  music expressions
552   @item  durations of notes and rests (specified with
553        @code{\notenames}
554 @cindex notenames@@@code{\notenames}
555 )
556   @item  note name tables
557   @item  context definitions, part of output definitions.  See
558        section @xref{contextdefs} for more information
559   @item  output definitions (like @code{\paper}
560 @cindex paper@@@code{\paper}
561  blocks
562        and @code{\midi}
563 @cindex midi@@@code{\midi}
564  blocks)
565   @item  score definitions (@code{\score}
566 @cindex score@@@code{\score}
567  blocks)
568 @end itemize
569
570 Type is a syntactical property: @emph{Mudela} has no real type system,
571 so there is no support for generic expressions, functions, or user
572 defined types.  For the same reason, it is not possible to mix reals
573 and integers in arithmetic expressions, and ``type
574 errors''
575 @cindex type error
576  (e.g., using a string identifier to
577 initialize a @code{\paper}
578 @cindex paper@@@code{\paper}
579  block) will yield a ``parse
580 error''.
581
582 Identifiers allow objects to be assigned to names.  To assign an
583 identifier, you use `=' and to refer to an
584 identifier, you preceed its name with a backslash:
585 `@code{\}'.  Identifier assignments must appear at top level
586 in the @emph{Mudela} file.  Semicolons are forbidden after assignments
587 appearing at top level but they are obligatory after assignments
588 appearing in the @code{\paper} block, see Section @xref{paper}.
589
590  is any of the types listed above.
591
592 An identifier can be created with any string for its name, but you
593 will only be able to refer to identifiers whose names begin with a
594 letter, being entirely alphanumeric.  It is impossible to refer to an
595 identifier whose name is the same as the name of a keyword.
596
597 The right hand side of an identifier assignment is parsed completely
598 before the assignment is done, so it is allowed to redefine an
599 identifier in terms of its old value, e.g.
600
601 @quotation
602
603   @code{foo = \foo * 2.0}
604 @end quotation
605
606 When an identifier is referenced, the information it points to is
607 copied.  Therefore it only makes sense to put identifiers for
608 translators, output definitions, and @code{\score}
609 @cindex score@@@code{\score}
610
611 blocks as the first item in a block.  For this reason, if you
612 reference a @code{\foo} variable in a @code{\foo} block, it must be the
613 first item in the list following @code{\foo}.@footnote{@code{\paper@{\one
614 \two@}} does not make sense, because the information of @code{\two}
615 would overwrite the information of @code{\one}, thereby making the
616 reference to the first identifier useless.}
617
618
619
620 @node Music expressions, Atomic music expressions, Types, LilyPond 1-2-0 Reference Manual
621 @section Music expressions
622
623 @cindex music expressions
624
625 Music in @emph{Mudela} is entered as a music expression.  Notes, rests,
626 lyric syllables are music expressions (the atomic
627 expressions)
628 @cindex atomic music expressions
629 , and you can combine
630 music expressions to form new ones.  This example forms a compound
631 expressions out of the quarter @code{c} note and a @code{d}
632 note:
633
634 @quotation
635
636   @example 
637 \sequential @{ c4 d4 @} 
638 @end example 
639
640 @end quotation
641
642 The meaning of this compound expression is to play the `@code{c}'
643 first, and then the `@code{d}' (as opposed to playing them
644 simultaneously, for instance).
645
646 Atomic music expression are discussed in
647 subsection @xref{atomicmusic}.  Compound music expressions are
648 discussed in subsection @xref{compoundmusic}.
649
650
651
652 @node Atomic music expressions, atomicmusic, Music expressions, LilyPond 1-2-0 Reference Manual
653 @section Atomic music expressions
654 @node atomicmusic, notedesc, Atomic music expressions, LilyPond 1-2-0 Reference Manual
655
656
657
658 @cindex pitch
659
660 @cindex duration
661  
662
663 The syntax for pitch specification is
664
665 @quotation
666
667   @code{\musicalpitch}
668 @cindex musicalpitch@@@code{\musicalpitch}
669
670     @code{@{}    @code{@}}
671 @end quotation
672
673  is specified by an integer, zero for the octave
674 containing middle C.   is a number from 0 to 7, with 0
675 corresponding to C and 7 corresponding to B.  The shift is zero for a
676 natural, negative to add flats, or positive to add sharps.
677
678 In Note and Chord mode, pitches may be designated by names.  See
679 section @xref{notelang} for pitch names in different languages.
680
681 The syntax for duration specification is
682
683 @quotation
684
685   @code{\duration}
686 @cindex duration@@@code{\duration}
687
688     @code{@{}   @code{@}}
689 @end quotation
690
691  is the negative logarithm (base 2) of the duration:
692 1 is a half note, 2 is a quarter note, 3 is an eighth
693 note, etc.  The number of dots after the note is given by
694 .
695
696 In Note, Chord, and Lyrics mode, durations may be designated by
697 numbers and dots.  See Section @xref{notelang} for details.
698
699
700 @node notedesc, barlines, atomicmusic, LilyPond 1-2-0 Reference Manual
701
702 @cindex note specification
703
704 @cindex pitches
705
706 @cindex entering notes
707
708 A note specification has the form
709
710 @quotation
711
712   [][@code{!}][@code{?}][]
713 @end quotation
714
715 The pitch of the note is specified by the note's name.
716
717
718 The default names are the Dutch note names.  The notes are specified
719 by the letters `@code{c}' through `@code{b}', where `@code{c}' is an
720 octave below middle C and the letters span the octave above that C. 
721 In Dutchcindex(notenames!Dutch), a sharp is formed by adding
722 `@code{-is}' to the end of a pitch name.  A flat is formed by adding
723 `@code{-es}'. Double sharps and double flats are obtained by adding
724 `@code{-isis}' or `@code{-eses}'.  `@code{aes}' and `@code{ees}' are
725 contracted to `@code{as}' and `@code{es}' in Dutch, but both forms will
726 be accepted.
727
728 LilyPond has predefined sets of notenames for various languages.  See
729 section @xref{notelang} for details.
730
731
732 The optional octave specification takes the form of a series of
733 single quote (`@code{'}
734 @cindex '@@@code{'}
735 ') characters or a series of comma
736 (`@code{,}
737 @cindex ,@@@code{,}
738 ') characters.  Each @code{'} raises the pitch by one
739 octave; each @code{,} lowers the pitch by an octave.
740
741 @mudela[fragment,verbatim,center]
742   c' d' e' f' g' a' b' c''
743 @end mudela
744
745 @mudela[fragment,verbatim,center]
746   cis' dis' eis' fis' gis' ais' bis'
747 @end mudela
748
749 @mudela[fragment,verbatim,center]
750   ces' des' es' fes' ges' as' bes'
751 @end mudela
752
753 @mudela[fragment,verbatim,center]
754   cisis' eisis' gisis' aisis' beses'
755 @end mudela
756
757 @mudela[fragment,verbatim,center]
758   ceses' eses' geses' ases' beses'
759 @end mudela
760
761 Whenever a C-sharp is desired,  you must specify a C-sharp.  LilyPond
762 will determine what accidentals to typeset depending on the key and
763 context.  A reminder accidental 
764 @cindex reminder accidental
765  can be
766 forced by adding an exclamation mark `@code{!}' after the pitch.  A
767 cautionary accidental, 
768 @cindex cautionary accidental
769  i.e., an
770 accidental within parentheses can be obtained by adding the question
771 mark `@code{?}
772 @cindex ?@@@code{?}
773 ' after the pitch.
774
775 @mudela[fragment,verbatim,center]
776   cis' d' e' cis'  c'? d' e' c'!
777 @end mudela
778
779
780 @cindex duration
781
782 Durations are entered as their reciprocal values.  For notes longer
783 than a whole note, use identifiers.
784
785 @quotation
786
787 @example 
788 c'\longa c'\breve  
789 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64 
790 @end example 
791
792 @end quotation
793
794 @quotation
795
796 @mudela[]
797 \score {
798   \notes \relative c'' {
799     a\longa a\breve  
800     a1 a2 a4 a8 a16 a32 a64 a64 
801   }
802   \paper {
803     loose_column_distance = 2.5 * \interline;
804     linewidth = -1.0;
805     \translator {
806       \type "Score_engraver";
807       \name "Score";
808       \consists "Note_heads_engraver";
809       \consists "Stem_engraver";
810       \consists "Rhythmic_column_engraver";
811     }
812   }
813 }
814 @end mudela
815 @end quotation
816
817 @quotation
818
819 @example 
820 r\longa r\breve  
821 r1 r2 r4 r8 r16 r32 r64 r64 
822 @end example 
823
824 @end quotation
825
826 @quotation
827
828 @mudela[]
829 \score {
830   \notes \relative c'' {
831     r\longa r\breve  
832     r1 r2 r4 r8 r16 r32 r64 r64 
833   }
834   \paper {
835     loose_column_distance = 2.5 * \interline;
836     linewidth = -1.0;
837     \translator {
838       \type "Score_engraver";
839       \name "Score";
840       \consists "Rest_engraver";
841       \consists "Stem_engraver";
842       \consists "Rhythmic_column_engraver";
843     }
844   }
845 }
846 @end mudela
847 @end quotation
848
849 If the duration is omitted then it is set equal to the previous
850 duration.  If there is no previous duration, a quarter note is
851 assumed.  The duration can be followed by a dot (`@code{.}
852 @cindex .@@@code{.}
853 ')
854 to obtain dotted note lengths.
855
856 @mudela[fragment,verbatim,center]
857   a'4. b'4.
858 @end mudela
859
860 You can alter the length of duration by writing
861 `@code{*}' after it.  This will not affect the
862 appearance of note heads or rests.
863
864
865 Rests are entered like notes, with note name `@code{r}
866 @cindex r@@@code{r}
867 ',
868 or `@code{R}
869 @cindex R@@@code{R}
870 '.  There is also a note name `@code{s}
871 @cindex s@@@code{s}
872 ',
873 which produces a space of the specified duration. 
874 `@code{R}' is specifically meant for entering parts: the @code{R} rest
875 can expand to fill a score with rests, or it can be printed as a
876 single multimeasure rest.
877
878
879 @cindex lyrics expressions
880
881 Syllables are entered like notes, with pitches replaced by text.  For
882 example, `@code{Twin-4 kle4 twin-4 kle4}' enters four syllables, each
883 with quarter note duration.  Note that the hyphen has no special
884 meaning for lyrics, and does not introduce special symbols.  See
885 section @xref{modes} for a description of what is interpreted as
886 lyrics.
887
888 Spaces can be introduced into a lyric either by using quotes
889 (`@code{"}') or by using an underscore without quotes: `@code{He_could4
890 not4}'.  All unquoted underscores are converted to spaces.  Printing
891 lyrics is discussed in section @xref{lyricprint}.
892
893
894
895 @cindex properties
896
897 @quotation
898
899   @code{\property}
900 @cindex property@@@code{\property}
901
902     @code{.} @code{=} 
903 @end quotation
904
905 Sets the  property of the context  to
906 the specified .  All three arguments are strings. 
907 Depending on the context, it may be necessary to quote the strings or
908 to leave space on both sides of the dot.
909
910
911
912 @cindex translator switches
913
914 @quotation
915
916   @code{\translator}
917 @cindex translator@@@code{\translator}
918
919      = 
920 @end quotation
921
922 A music expression indicating that the context which is a direct
923 child of the a context of type  should be shifted to
924 a context of type  and the specified name.
925
926 Usually this is used to switch staffs in Piano music, e.g.
927
928 @quotation
929
930   @code{\translator Staff = top} 
931 @end quotation
932
933
934
935 @cindex commands
936
937 Commands are music expressions that have no duration.   
938
939
940 @quotation
941
942   @code{\key}
943 @cindex key@@@code{\key}
944    @code{;}
945 @end quotation
946
947 Change the key signature.   should be
948 @code{\major}
949 @cindex major@@@code{\major}
950  or @code{\minor}
951 @cindex minor@@@code{\minor}
952  to get
953 -major or -minor, respectively.  The second
954 argument is optional; the default is major keys.  The 
955 argument can also be given as an integer, which tells the number of
956 semitones that should be added to the pitch given in the subsequent
957 @code{\key}
958 @cindex key@@@code{\key}
959  commands to get the corresponding major key,
960 e.g., @code{\minor}
961 @cindex minor@@@code{\minor}
962  is defined as 3.  The standard
963 mode names @code{\ionian}
964 @cindex ionian@@@code{\ionian}
965 ,
966 @code{\locrian}
967 @cindex locrian@@@code{\locrian}
968 , @code{\aeolian}
969 @cindex aeolian@@@code{\aeolian}
970 ,
971 @code{\mixolydian}
972 @cindex mixolydian@@@code{\mixolydian}
973 , @code{\lydian}
974 @cindex lydian@@@code{\lydian}
975 ,
976 @code{\phrygian}
977 @cindex phrygian@@@code{\phrygian}
978 , and @code{\dorian}
979 @cindex dorian@@@code{\dorian}
980
981 are also defined.
982
983 @quotation
984
985   @code{\keysignature}
986 @cindex keysignature@@@code{\keysignature}
987   @code{;}
988 @end quotation
989
990 Specify an arbitrary key signature.  The pitches from  will
991 be printed in the key signature in the order that they appear on the
992 list.
993
994         
995 @quotation
996
997   @code{\mark}
998 @cindex mark@@@code{\mark}
999   @code{;} @* 
1000   @code{\mark}  @code{;}
1001 @end quotation
1002
1003 Prints a mark over or under (depending on the
1004 @code{markDirection}
1005 @cindex markDirection@@@code{markDirection}
1006  property) the staff.  You must add
1007 @code{Mark_engraver}
1008 @cindex Mark_engraver@@@code{Mark_engraver}
1009  to either the Score or Staff context for
1010 this to work.
1011
1012 @node barlines, manualbeam, notedesc, LilyPond 1-2-0 Reference Manual
1013
1014 @quotation
1015
1016   @code{\bar}
1017 @cindex bar@@@code{\bar}
1018   @code{;}
1019 @end quotation
1020
1021 This is a request to print a special bar symbol. It replaces the 
1022 regular bar symbol with a special
1023 symbol.  The argument  is a string which specifies the
1024 kind of bar to print.  Options are @code{":|"}
1025 @cindex "|A@@@code{:|}
1026 ,
1027 @code{"|:"}
1028 @cindex "|B@@@code{|:}
1029 , @code{":|:"}
1030 @cindex "|C@@@code{:|:}
1031 ,
1032 @code{"||"}
1033 @cindex "|D@@@code{||}
1034 , @code{"|."}
1035 @cindex "|E@@@code{|.}
1036 ,
1037 @code{".|"}
1038 @cindex "|F@@@code{.|}
1039 , and @code{".|."}
1040 @cindex "|G@@@code{.|.}
1041
1042 These produce, respectively, a right repeat, a left repeat, a double
1043 repeat, a double bar, a start bar, an end bar, and a thick double
1044 bar.  If  is set to @code{"empty"} then nothing is
1045 printed, but a line break is allowed at that spot.
1046
1047 You are encouraged to use @code{\repeat} for repetitions.
1048 See section @xref{sec-repeats}.
1049
1050  
1051
1052 @quotation
1053
1054   @code{\cadenza}
1055 @cindex cadenza@@@code{\cadenza}
1056   @code{;}
1057 @end quotation
1058
1059 Music expression that toggles the automatic generation of bar lines. 
1060 If  is 1, bar line generation is turned off.  If
1061  is 0, a bar line is immediately printed and 
1062 automatic bar generation is turned on.
1063
1064 @quotation
1065
1066   @code{\time}
1067 @cindex time@@@code{\time}
1068  @code{/} @code{;}
1069 @end quotation
1070
1071 Change the time signature.  The default time signature is 4/4. 
1072 The time signature is used to generate bar lines.
1073
1074 @quotation
1075
1076   @code{\tempo}
1077 @cindex tempo@@@code{\tempo}
1078   =  @code{;}
1079 @end quotation
1080
1081 Used to specify the tempo.  For example, `@code{\tempo 4 = 76;}'
1082 requests output with 76 quarter notes per minute.
1083
1084 @quotation
1085
1086   @code{\partial}
1087 @cindex partial@@@code{\partial}
1088   @code{;}
1089 @end quotation
1090
1091 @cindex anacrusis
1092
1093 @cindex upstep
1094
1095 This creates an incomplete measure (anacrusis, upbeat) at the start of 
1096 the music, e.g., `@code{\partial 8*2;}' creates a starting measure 
1097 lasting two eighth notes.
1098
1099 @quotation
1100
1101   @code{|}
1102 @cindex |@@@code{|}
1103
1104 @cindex bar check
1105
1106 @end quotation
1107
1108 @cindex shorten measures
1109
1110 @cindex upstep
1111
1112 `@code{|}' is a barcheck.  Whenever a barcheck is encountered during
1113 interpretation, a warning message is issued if it doesn't fall at a
1114 measure boundary.  This can help you finding errors in the input. 
1115 The beginning of the measure will be relocated, so this can also
1116 be used to shorten measures.
1117
1118
1119 @quotation
1120
1121   @code{\penalty}
1122 @cindex penalty@@@code{\penalty}
1123   @code{;}
1124 @end quotation
1125
1126 Discourage or encourage line breaks.  See identifiers
1127 @code{\break}
1128 @cindex break@@@code{\break}
1129  and @code{\nobreak}
1130 @cindex nobreak@@@code{\nobreak}
1131  in
1132 section @xref{ident}.
1133
1134 @quotation
1135
1136   @code{\clef}
1137 @cindex clef@@@code{\clef}
1138   @code{;}
1139 @end quotation
1140
1141 Music expression that sets the current clef.  The argument is a
1142 string which specifies the name of the clef.  Several clef names are
1143 supported.  If `@code{_8}' or `@code{^8}' is added to the end of a clef
1144 name, then the clef lowered or raised an octave will be generated. 
1145 Here are the supported clef names with middle C shown in each
1146 clef:
1147
1148 @quotation
1149
1150 @mudela[]
1151 \score {
1152   \notes {
1153     \cadenza 1;
1154     %\property Voice.textStyle = typewriter
1155     \clef subbass;     c'4-"\kern -5mm subbass" 
1156     \clef bass;        c'4^"\kern -2mm bass"
1157     \clef baritone;    c'4_"\kern -5mm baritone"
1158     \clef varbaritone; c'4^"\kern -6mm varbaritone"
1159     \clef tenor;       c'4_"\kern -3mm tenor"
1160     \clef "G_8";       c'4^"\kern -2mm G\\_8" 
1161   }  
1162   \paper {
1163     linewidth = 4.5 \in;
1164   }
1165 }
1166 @end mudela
1167 @end quotation
1168
1169 @quotation
1170
1171 @mudela[]
1172 \score {
1173   \notes {
1174     \cadenza 1;
1175     \clef alto;         c'4_"\kern -2mm alto"
1176     \clef mezzosoprano; c'4^"\kern -9mm mezzosoprano"
1177     \clef soprano;      c'4_"\kern -6mm soprano"
1178     \clef treble;       c'4^"\kern -4mm treble"
1179     \clef french;       c'4_"\kern -4mm french"
1180   }
1181   \paper {
1182     linewidth = 4.5 \in;
1183   }
1184 }
1185 @end mudela
1186 @end quotation
1187
1188 The three clef symbols can also be obtained using the names `@code{G}', 
1189 `@code{C}' or `@code{F}', optionally followed by an integer which 
1190 indicates at which note line the clef is located. An as example, the 
1191 @code{mezzosoprano} clef can also be given as `@code{C2}'.
1192
1193 @quotation
1194
1195   @code{\skip}
1196 @cindex skip@@@code{\skip}
1197   @code{;}
1198 @end quotation
1199
1200 Skips the amount of time specified by .  If no other
1201 music is played, a gap will be left for the skipped time with no
1202 notes printed.  It works in Note Mode or Lyrics Mode.  In Note mode,
1203 this has the same effect as the space rest `@code{s}'.
1204
1205
1206 @cindex beams
1207
1208 @node manualbeam, tremolo, barlines, LilyPond 1-2-0 Reference Manual
1209
1210 A beam is specified by surrounding the beamed notes with brackets
1211 `@code{[}
1212 @cindex [@@@code{[}
1213 ' and `@code{]}
1214 @cindex ]@@@code{]}
1215 '.  
1216
1217 @mudela[fragment,verbatim,center]
1218   [a'8 a'] [a'16 a' a' a']
1219 @end mudela
1220
1221 Some more elaborate constructions:
1222
1223 @mudela[fragment,verbatim,center]
1224   [a'16 <a' c''> c'' <a' c''>]
1225   \times 2/3 { [e'8 f' g'] }
1226 @end mudela
1227
1228 Beaming can be generated automatically; see section @xref{autobeam}.
1229
1230 To place tremolo marks 
1231 @cindex tremolo beams
1232  between two notes, begin
1233 with `@code{[:}' and end with `@code{]}'.  Tremolo marks
1234 will appear instead of beams.  Putting more than two notes in such a
1235 construction will produce odd effects.  To create tremolo beams on a
1236 single note, simply attach `@code{:}' to the note itself
1237 (see also section @xref{tremolo}).
1238   
1239 @mudela[fragment,verbatim,center]
1240   [:16 e'1 g'] [:8 e'4 f']
1241 @end mudela
1242   
1243 @mudela[fragment,verbatim,center]
1244   c'4:32 [:16 c'8 d'8]
1245 @end mudela
1246
1247
1248 @cindex --@@@code{-}@code{-}
1249
1250 @cindex __@@@code{__}
1251
1252 @cindex extender
1253
1254 @cindex hyphen
1255
1256 The syntax for an extender mark is `@code{__}'.  This syntax can only
1257 be used within lyrics mode.  The syntax for a spanning hyphen (i.e.,
1258 a hyphen that will be printed between two lyric syllables) is
1259 `@code{-}@code{-}'.
1260
1261
1262 @cindex ties
1263
1264 A tie connects two adjacent note heads of the same pitch.  When used
1265 with chords, it connects all of the note heads whose pitches match.
1266 Ties are indicated using the tilde symbol `@code{~}
1267 @cindex ~@@@code{~}
1268 '.
1269 If you try to tie together chords which have no common pitches, a
1270 warning message will appear and no ties will be created.
1271
1272 @mudela[fragment,verbatim,center]
1273   e' ~ e' <c' e' g'> ~ <c' e' g'>
1274 @end mudela
1275
1276
1277
1278 [TODO: explain Requests]
1279
1280
1281 @cindex articulations
1282
1283 @cindex scripts
1284
1285 @cindex ornaments
1286
1287 A variety of symbols can appear above and below notes to indicate
1288 different characteristics of the performance.  These symbols can be
1289 added to a note with `@code{-\}'.  Numerous symbols
1290 are defined in @file{script.ly} and @file{script.scm}.  Symbols can be
1291 forced to appear above or below the note by writing
1292 `@code{^\}' and `@code{_\}'
1293 respectively.  Here is a chart showing symbols above notes, with the
1294 name of the corresponding symbol appearing underneath.
1295
1296 @mudela[]
1297
1298   \score {
1299     < \notes {
1300         c''-\accent      c''-\marcato      c''-\staccatissimo c''-\fermata 
1301         c''-\stopped     c''-\staccato     c''-\tenuto        c''-\upbow
1302         c''-\downbow     c''^\lheel        c''-\rheel         c''^\ltoe
1303         c''-\rtoe        c''-\turn         c''-\open          c''-\flageolet
1304         c''-\reverseturn c''-\trill        c''-\prall         c''-\mordent
1305         c''-\prallprall  c''-\prallmordent c''-\upprall       c''-\downprall
1306         c''-\thumb       c''-\segno        c''-\coda
1307       }
1308       \context Lyrics \lyrics {  
1309         accent__      marcato__      staccatissimo__ fermata
1310         stopped__     staccato__     tenuto__        upbow
1311         downbow__     lheel__        rheel__         ltoe
1312         rtoe__        turn__         open__          flageolet
1313         reverseturn__ trill__        prall__         mordent
1314         prallprall__  prallmordent__ uprall__        downprall
1315         thumb__       segno__        coda
1316       }
1317     >
1318     \paper {
1319       linewidth = 5.875\in;          
1320       indent    = 0.0;
1321     }
1322   }
1323
1324 @end mudela
1325
1326 In addition, it is possible to place arbitrary strings of text or
1327 TeX above or below notes by using a string instead of an
1328 identifier: `@code{c^"text"}'.  Fingerings 
1329 @cindex fingering
1330  can be
1331 placed by simply using digits.  All of these note ornaments appear in
1332 the printed output but have no effect on the MIDI rendering of the
1333 music.
1334
1335 To save typing, fingering instructions (digits 0 to 9 are
1336 supported) and single characters shorthands exist for a few
1337 common symbols
1338
1339 @mudela[]
1340
1341   \score {
1342     \notes {
1343       \property Voice.textStyle = typewriter
1344       c''4-._"c-."      s4
1345       c''4--_"c-{}-"    s4
1346       c''4-+_"c-+"      s4
1347       c''4-|_"c-|"      s4
1348       c''4->_"c->"      s4
1349       c''4-^_"c-\\^{ }" s4
1350       c''4-1_"c-1"      s4
1351       c''4-2_"c-2"      s4
1352       c''4-3_"c-3"      s4
1353       c''4-4_"c-4"      s4
1354     }
1355     \paper {
1356       linewidth = 5.875 \in;
1357       indent    = 0.0;
1358     }
1359   }
1360
1361 @end mudela
1362
1363 Dynamic marks are specified by using an identifier after a note:
1364 `@code{c4-\ff}' (the dash is optional for dynamics: `@code{c4 \ff})'.  
1365 The available dynamic marks are:
1366 @code{\ppp}
1367 @cindex ppp@@@code{\ppp}
1368 ,
1369 @code{\pp}
1370 @cindex pp@@@code{\pp}
1371 , @code{\p}
1372 @cindex p@@@code{\p}
1373 , @code{\mp}
1374 @cindex mp@@@code{\mp}
1375 ,
1376 @code{\mf}
1377 @cindex mf@@@code{\mf}
1378 , @code{\f}
1379 @cindex f@@@code{\f}
1380 , @code{\ff}
1381 @cindex ff@@@code{\ff}
1382 ,
1383 @code{\fff}
1384 @cindex fff@@@code{\fff}
1385 , @code{\fff}
1386 @cindex ffff@@@code{\ffff}
1387 ,
1388 @code{\fp}
1389 @cindex fp@@@code{\fp}
1390 , @code{\sf}
1391 @cindex sf@@@code{\sf}
1392 ,
1393 @code{\sff}
1394 @cindex sff@@@code{\sff}
1395 , @code{\sp}
1396 @cindex sp@@@code{\sp}
1397 ,
1398 @code{\spp}
1399 @cindex spp@@@code{\spp}
1400 , @code{\sfz}
1401 @cindex sfz@@@code{\sfz}
1402 , and
1403 @code{\rfz}
1404 @cindex rfz@@@code{\rfz}
1405 .
1406
1407
1408 @quotation
1409
1410   @code{\textscript}
1411 @cindex textscript@@@code{\textscript}
1412   
1413 @end quotation
1414
1415 Defines a text to be printed over or under a note.   is a
1416 string that may be one of @code{roman}, @code{italic}, @code{typewriter}, 
1417 @code{bold}, @code{Large}, @code{large}, @code{dynamic} or @code{finger}.
1418
1419 You can attach a general textscript request using this syntax:
1420
1421 @quotation
1422
1423 @example 
1424 c4-\textscript "6" "finger"
1425 c4-\textscript "foo" "normal" 
1426 @end example 
1427
1428 @end quotation
1429
1430 This is equivalent to `@code{c4-6 c4-"foo"}'.  
1431
1432
1433 @cindex scripts
1434
1435 @quotation
1436
1437   @code{\script}
1438 @cindex script@@@code{\script}
1439  
1440 @end quotation
1441
1442 Prints a symbol above or below a note.  The argument is a string
1443 which points into the script-alias table defined in @file{script.scm}.
1444 The scheme definitions specify whether the symbol follows notes into
1445 the staff, dependence of symbol placement on staff direction, and a
1446 priority for placing several symbols over one note.  Usually the
1447 @code{\script}
1448 @cindex script@@@code{\script}
1449  keyword is not used directly.  Various
1450 helpful identifier definitions appear in @file{script.ly}.
1451
1452
1453 @cindex slur
1454
1455 Slurs connects chords and try to avoid crossing stems.  A slur is
1456 started with `@code{(}' and stopped with `@code{)}'.  The
1457 starting `@code{(}' appears to the right of the first note in
1458 the slur.  The terminal `@code{)}' appears to the left of the
1459 first note in the slur.  This makes it possible to put a note in
1460 slurs from both sides:
1461
1462 @mudela[fragment,verbatim,center]
1463   f'()g'()a' [a'8 b'(] a'4 g'2 )f'4
1464 @end mudela
1465
1466
1467 @cindex crescendo
1468
1469 A crescendo mark is started with @code{\cr}
1470 @cindex cr@@@code{\cr}
1471  and terminated
1472 with @code{\rc}
1473 @cindex rc@@@code{\rc}
1474 .  A decrescendo mark is started with
1475 @code{\decr}
1476 @cindex decr@@@code{\decr}
1477  and terminated with
1478 @code{\rced}
1479 @cindex rced@@@code{\rced}
1480 .  There are also shorthands for these
1481 marks.  A crescendo can be started with @code{\<}
1482 @cindex <@@@code{\<}
1483  and a
1484 decrescendo can be started with @code{\>}
1485 @cindex >@@@code{\>}
1486 .  Either one can
1487 be terminated with @code{\!}
1488 @cindex "!@@@code{\"!}
1489 .  Note that @code{\!}
1490 must go before the last note of the dynamic mark whereas @code{\rc}
1491 and @code{\rced} go after the last note.  Because these marks are
1492 bound to notes, if you want to get several marks during one note, you
1493 must use spacer notes.
1494
1495 @mudela[fragment,verbatim,center]
1496   c'' \< \! c''   d'' \decr e'' \rced 
1497   < f''1 { s4 \< \! s2 \> \! s4 } >
1498 @end mudela
1499
1500
1501 @quotation
1502
1503   @code{\spanrequest}
1504 @cindex spanrequest@@@code{\spanrequest}
1505   
1506 @end quotation
1507
1508 Define a spanning request. The  parameter is either -1
1509 (@code{\start}
1510 @cindex start@@@code{\start}
1511 ) or 1 (@code{\stop}
1512 @cindex stop@@@code{\stop}
1513 ) and
1514  is a string that describes what should be started.
1515 Supported types are @code{crescendo}, @code{decrescendo},
1516 @code{beam}, @code{slur}.  This is an internal command.  Users should
1517 use the shorthands which are defined in the initialization file
1518 @file{spanners.ly}.
1519
1520 You can attach a (general) span request to a note using
1521
1522 @mudela[fragment,verbatim,center]
1523   c'4-\spanrequest \start "slur"
1524   c'4-\spanrequest \stop "slur"
1525 @end mudela
1526
1527 The slur syntax with parentheses is a shorthand for this.
1528
1529
1530
1531 @cindex tremolo marks
1532
1533 @node tremolo, Compound music expressions, manualbeam, LilyPond 1-2-0 Reference Manual
1534
1535 Tremolo marks can be printed on a single note by adding
1536 `@code{:}[]' after the note.  The length must be at
1537 least 8.  A  value of 8 gives one line across
1538 the note stem.  If the length is omitted, then the last value is
1539 used, or the value of the @code{abbrev}
1540 @cindex abbrev@@@code{abbrev}
1541  property if there was
1542 no last value.
1543
1544 @mudela[verbatim,fragment,center]
1545   c'2:8 c':32
1546 @end mudela
1547
1548
1549
1550 @node Compound music expressions, compoundmusic, tremolo, LilyPond 1-2-0 Reference Manual
1551 @section Compound music expressions
1552
1553 @cindex compound music expressions
1554
1555 @node compoundmusic, relative, Compound music expressions, LilyPond 1-2-0 Reference Manual
1556
1557 Music expressions are compound data structures.  You can nest music
1558 expressions any way you like.  This simple example shows how three
1559 chords can be expressed in two different ways:
1560
1561 @mudela[fragment,verbatim,center]
1562   \notes \context Staff {
1563     \cadenza 1;
1564     <a c'> <b  d' > <c' e' >
1565     <{a b  c'}{c' d' e'}>
1566   }
1567 @end mudela
1568
1569
1570
1571 @cindex context selection
1572
1573 @quotation
1574
1575   @code{\context}
1576 @cindex context@@@code{\context}
1577
1578      [@code{=} ] 
1579 @end quotation
1580
1581 Interpret  within a context of type . 
1582 If the context does not exist, it will be created.  The new context
1583 can optionally be given a name.  See
1584 section @xref{contextselection} and @xref{contextdefs} for more
1585 information on interpretation contexts.
1586
1587
1588
1589 @cindex input modes
1590
1591 @cindex mode switch
1592
1593 Mode switching keywords form compound music expressions: @code{\notes}
1594
1595 @cindex notes@@@code{\notes}
1596  , @code{\chords} 
1597 @cindex chords@@@code{\chords}
1598
1599 , and @code{\lyrics} 
1600 @cindex lyrics@@@code{\lyrics}
1601  . 
1602 These expressions do not add anything to the meaning of their
1603 arguments.  They are just a way to indicate that the arguments should
1604 be parsed in indicated mode.  See section @xref{modes} for more
1605 information on modes.
1606
1607 More information on context selection can be found in
1608 section @xref{contextselection}.
1609
1610
1611
1612 @cindex sequential music
1613
1614
1615
1616 @quotation
1617
1618   @code{\sequential}
1619 @cindex sequential@@@code{\sequential}
1620
1621     @code{@{}  @code{@}}
1622 @end quotation
1623
1624 This means that list should be played or written in sequence, i.e.,
1625 the second after the first, the third after the second.  The duration
1626 of sequential music is the the sum of the durations of the elements. 
1627 There is a shorthand, which leaves out the keyword:
1628
1629 @quotation
1630
1631   @code{@{}  @code{@}}
1632 @end quotation
1633
1634
1635
1636 @cindex simultaneous music
1637
1638 @cindex <@@@code{<}
1639
1640 @cindex >@@@code{>}
1641
1642 @quotation
1643
1644   @code{\simultaneous}
1645 @cindex simultaneous@@@code{\simultaneous}
1646
1647     @code{@{}  @code{@}}
1648 @end quotation
1649
1650 It constructs a music expression where all of its arguments start at
1651 the same moment.  The duration is the maximum of the durations of the
1652 elements.  The following shorthand is a common idiom:
1653
1654 @quotation
1655
1656   @code{<}  @code{>}
1657 @end quotation
1658
1659 If you try to use a chord as the first thing in your score, you might
1660 get multiple staffs instead of a chord.
1661
1662 @mudela[verbatim,center]
1663   \score {
1664     \notes <c''4 e''>
1665     \paper {
1666       linewidth = -1.;
1667     }
1668   }
1669 @end mudela
1670
1671 This happens because the chord is interpreted by a score context.
1672 Each time a note is encountered a default Voice context (along with a
1673 Staff context) is created.  The solution is to explicitly instantiate
1674 a Voice context:
1675
1676 @mudela[verbatim,center]
1677   \score {
1678     \notes\context Voice <c''4 e''>
1679     \paper {
1680       linewidth = -1.;
1681     }
1682   }
1683 @end mudela
1684
1685
1686
1687 @cindex relative pitch specification
1688
1689 @node relative, sec-repeats, compoundmusic, LilyPond 1-2-0 Reference Manual
1690
1691 It is easy to get confused by octave changing marks and accidentally
1692 putting a pitch in the wrong octave.  A much better way of entering a
1693 note's octave is `the relative octave' mode.
1694
1695 @quotation
1696
1697   @code{\relative}
1698 @cindex relative@@@code{\relative}
1699   
1700 @end quotation
1701
1702 The octave of notes that appear in  are calculated as
1703 follows: If no octave changing marks are used, the basic interval
1704 between this and the last note is always taken to be a fourth or
1705 less.@footnote{The interval is determined without regarding
1706 accidentals.  A @code{fisis} following a @code{ceses} will be put above
1707 the @code{ceses}.}  The octave changing marks `@code{'}' and `@code{,}'
1708 can then be added to raise or lower the pitch by an extra octave. 
1709 Upon entering relative mode, an absolute starting pitch must be
1710 specified that will act as the predecessor of the first note of
1711 .
1712
1713 Entering scales is straightforward in relative mode.
1714
1715 @mudela[fragment,verbatim,center]
1716   \relative c' {
1717     c d e f g a b c c,
1718   }
1719 @end mudela
1720
1721 And octave changing marks are used for intervals greater than a fourth.
1722
1723 @mudela[fragment,verbatim,center]
1724   \relative c'' {
1725     c g c f, c' a, e'' }
1726 @end mudela
1727
1728 If the preceding item is a chord, the first note of the chord is used
1729 to determine the first note of the next chord.  But other notes
1730 within the second chord are determined by looking at the immediately
1731 preceding note.
1732
1733 @mudela[fragment,verbatim,center]
1734   \relative c' {
1735     c <c e g> 
1736     <c' e g>
1737     <c, e' g>
1738   }
1739 @end mudela 
1740
1741 The pitch after the @code{\relative} contains a notename.  To parse
1742 the pitch as a notename, you have to be in note mode, so there must
1743 be a surrounding @code{\notes}
1744 @cindex notes@@@code{\notes}
1745  keyword (which is not
1746 shown here).
1747
1748 The relative conversion will not affect @code{\transpose} or
1749 @code{\relative} sections in its argument.  If you want to use
1750 relative within transposed music, you must place an additional
1751 @code{\relative} inside the @code{\transpose}.
1752
1753 It is strongly recommended to use relative pitch mode: less work,
1754 less error-prone, and more readable.
1755
1756
1757
1758 Chord names are a way to generate simultaneous music expressions that
1759 correspond with traditional chord names.  It can only be used in
1760 Chord mode (see section @xref{modes}).
1761
1762 @quotation
1763
1764   [][@code{-}][@code{^}][@code{/}].
1765 @end quotation
1766
1767  should be the tonic note of the chord, and 
1768 is the chord duration in the usual notation.  There are two kinds of
1769 modifiers.  One type is @emph{chord additions}, which are obtained by
1770 listing intervals separated by dots.  An interval is written by its
1771 number with an optional `@code{+}' or `@code{-}' to indicate raising or
1772 lowering by half a step.  Chord additions has two effects: It adds
1773 the specified interval and all lower odd numbered intervals to the
1774 chord, and it may lower or raise the specified interval.  Intervals
1775 must be separated by a dot (`@code{.}').
1776
1777 @quotation
1778
1779 @mudela[fragment,verbatim]
1780 \transpose c'' {
1781   \chords {
1782     c1  c-3-       c-7     c-8
1783     c-9 c-9-.5+.7+ c-3-.5- c-4.6.8
1784   }
1785 }
1786
1787 @end mudela
1788 @end quotation
1789
1790 The second type of modifier that may appear after the `@code{-}' is a
1791 named modifier.  Named modifiers are listed in the file
1792 @file{chord-modifiers.ly}.  The available modifiers are `@code{m}' and
1793 `@code{min}' which lower the 3rd half a step, `@code{aug}
1794 @cindex aug@@@code{aug}
1795 ' which
1796 raises the 5th, `@code{dim}
1797 @cindex dim@@@code{dim}
1798 ' which lowers the 5th,
1799 `@code{maj}
1800 @cindex maj@@@code{maj}
1801 ' which adds a raised 7th, and `@code{sus}
1802 @cindex sus@@@code{sus}
1803 '
1804 which replaces the 5th with a 4th.
1805
1806 @quotation
1807
1808 @mudela[fragment,verbatim]
1809 \transpose c'' {
1810   \chords {
1811     c1-m c-min7 c-maj c-aug c-dim c-sus
1812   }
1813 }
1814
1815 @end mudela
1816 @end quotation
1817  
1818
1819 Chord subtractions are used to eliminate notes from a chord.  The
1820 notes to be subtracted are listed after a `@code{^}' character,
1821 separated by dots.
1822
1823 @mudela[fragment,verbatim,center]
1824   \transpose c'' {
1825     \chords {
1826       c1^3 c-7^5.3 c-8^7
1827     }
1828   }
1829 @end mudela 
1830
1831 Chord inversions can be specified by appending `@code{/}
1832 @cindex /@@@code{/}
1833 ' and
1834 the name of a single note to a chord.  This has the effect of
1835 lowering the specified note by an octave so it becomes the lowest
1836 note in the chord.  If the specified note is not in the chord, a
1837 warning will be printed.
1838
1839 @mudela[fragment,verbatim,center]
1840   \transpose c''' {
1841     \chords {
1842       c1 c/e c/g c-7/e
1843     }
1844   }
1845
1846 @end mudela 
1847
1848 Throughout these examples, chords have been shifted around the staff
1849 using @code{\transpose}.
1850
1851 You should not combine @code{\relative} with named chords. 
1852
1853
1854
1855 @cindex tuplets
1856
1857 Tuplets are made out of a music expression by multiplying their
1858 duration with a fraction.
1859
1860 @quotation
1861
1862   @code{\times}
1863 @cindex times@@@code{\times}
1864   
1865 @end quotation
1866
1867 The duration of  will be multiplied by the fraction. 
1868 In print, the fraction's denominator will be printed over the notes,
1869 optionally with a bracket.  The most common tuplet is the triplet in
1870 which 3 notes have the length of 2, so the notes are 2/3 of
1871 their written length:
1872
1873 @mudela[fragment,verbatim,center]
1874   g'4 \times 2/3 {c'4 c' c'} d'4 d'4
1875 @end mudela
1876
1877
1878
1879 @cindex grace notes
1880
1881 @quotation
1882
1883   @code{\grace}
1884 @cindex grace@@@code{\grace}
1885  
1886 @end quotation
1887
1888 A grace note expression has duration 0; the next real note is
1889 assumed to be the main note.
1890
1891 You cannot have the grace note after the main note, in terms of
1892 duration, and main notes, but you can typeset the grace notes to the
1893 right of the main note using the property
1894 @code{graceAlignPosition}
1895 @cindex graceAlignPosition@@@code{graceAlignPosition}
1896 .
1897
1898 When grace music is interpreted, a score-within-a-score is set up:
1899  has its own time bookkeeping, and you could (for
1900 example) have a separate time signature within grace notes.  While in
1901 this score-within-a-score, you can create notes, beams, slurs, etc.
1902 Unbeamed eighth notes and shorter by default have a slash through the
1903 stem.  This behavior can be controlled with the
1904 @code{stemStyle}
1905 @cindex stemStyle@@@code{stemStyle}
1906  property.
1907
1908 @quotation
1909
1910 @mudela[fragment,verbatim]
1911 \relative c'' {
1912   \grace c8 c4 \grace { [c16 c16] } c4
1913   \grace { \property Grace.stemStyle = "" c16 } c4
1914 }
1915
1916 @end mudela
1917 @end quotation
1918
1919 At present, nesting @code{\grace}
1920 @cindex grace@@@code{\grace}
1921  notes, e.g.
1922
1923 @quotation
1924
1925   @code{\grace @{ \grace c32 c16 @} c4}
1926 @end quotation
1927
1928 may result in run-time errors of LilyPond.  Since the meaning of such
1929 a construct is unclear, we don't consider this a loss.  Similarly,
1930 juxtaposing two @code{\grace} sections is syntactically valid, but
1931 makes no sense and may cause runtime errors.
1932
1933 Ending a staff or score with grace notes may also generate a run-time
1934 error, since there will be no main note to attach the grace notes to.
1935
1936
1937
1938 @cindex repeats
1939
1940 @node sec-repeats, transpose, relative, LilyPond 1-2-0 Reference Manual
1941
1942 In order to specify repeats, use the @code{\repeat}
1943 @cindex repeat@@@code{\repeat}
1944
1945 keyword.  Since repeats look and sound differently when played or
1946 printed, there are a few different variants of repeats.
1947
1948 @table @samp
1949   @item unfolded @* 
1950     Repeated music is fully written (played) out.  Useful for MIDI
1951     output.
1952
1953   @item volta @* 
1954     This is the normal notation: Repeats are not written out, but
1955     alternative endings (voltas) are printed, left to right.
1956
1957   @item folded @* 
1958     Alternative endings are written stacked, which is useful for
1959     lyrics.
1960 @end table  
1961
1962 The syntax for repeats is
1963
1964 @quotation
1965
1966   @code{\repeat}   
1967 @end quotation
1968
1969 If you have alternative endings, you may add
1970
1971 @quotation
1972
1973   @code{\alternative}
1974 @cindex alternative@@@code{\alternative}
1975
1976     @code{@{} 
1977             
1978              ... @code{@}}
1979 @end quotation
1980
1981 where each  is a Music expression.
1982
1983 Normal notation repeats are used like this:
1984
1985 @quotation
1986
1987 @mudela[fragment,verbatim]
1988   c'1
1989   \repeat volta 2 { c'4 d' e' f' }
1990   \repeat volta 2 { f' e' d' c' }
1991
1992 @end mudela
1993 @end quotation
1994
1995 With alternative endings:
1996
1997 @quotation
1998
1999 @mudela[fragment,verbatim]
2000   c'1
2001   \repeat volta 2 {c'4 d' e' f'} 
2002   \alternative { {d'2 d'} {f' f} }
2003
2004 @end mudela
2005 @end quotation
2006
2007 Folded repeats look like this:@footnote{Folded repeats offer little
2008 more over simultaneous music.  However, it is to be expected that
2009 more functionality -- especially for the MIDI backend -- will be
2010 implemented.}
2011
2012 @quotation
2013
2014 @mudela[fragment,verbatim]
2015   c'1
2016   \repeat fold 2 {c'4 d' e' f'} 
2017   \alternative { {d'2 d'} {f' f} }
2018
2019 @end mudela
2020 @end quotation
2021
2022 @quotation
2023
2024 @mudela[fragment,verbatim]
2025 \context Staff {
2026   \relative c' {
2027     \partial 4;
2028     \repeat volta 2 { e | c2 d2 | e2 f2 | }
2029     \alternative { { g4 g g } { a | a a a a | b1 } }
2030   }
2031 }
2032
2033 @end mudela
2034 @end quotation
2035
2036 If you don't give enough alternatives for all of the repeats, then
2037 the first alternative is assumed to be repeated often enough to equal
2038 the specified number of repeats.
2039
2040 @quotation
2041
2042 @mudela[fragment,verbatim]
2043 \context Staff {
2044   \relative c' {
2045     \repeat volta 3 { \partial 4; e | c2 d2 | e2 f2 | }
2046     \alternative { { g4 g g }
2047                    {\partial 1; e4 e e } 
2048                    {\partial 1; a a a a | b1 } }
2049   }
2050 }
2051
2052 @end mudela
2053 @end quotation
2054
2055 It is possible to nest @code{\repeat}.  This is not entirely
2056 supported: the notes will come be in the right places, but the repeat
2057 bars will not.
2058
2059
2060
2061 @cindex transposition of pitches
2062
2063 @node transpose, Ambiguities, sec-repeats, LilyPond 1-2-0 Reference Manual
2064
2065 A music expression can be transposed with
2066 @code{\transpose}
2067 @cindex transpose@@@code{\transpose}
2068 .  The syntax is
2069
2070 @quotation
2071
2072   @code{\transpose}  
2073 @end quotation
2074
2075 This means that middle C in  is transposed to
2076 .
2077
2078 @code{\transpose} distinguishes between enharmonic pitches: both
2079 @code{\transpose cis'} or @code{\transpose des'} will transpose up half
2080 a tone.  The first version will print sharps and the second version
2081 will print flats.
2082
2083 @quotation
2084
2085 @mudela[fragment,verbatim]
2086 \context Staff {
2087   \clef "F";
2088   { \key e; c d e f }
2089   \clef "G";
2090   \transpose des'' { \key e; c d e f }
2091   \transpose cis'' { \key e; c d e f }
2092 }
2093
2094 @end mudela
2095 @end quotation
2096
2097 If you want to use both @code{\transpose} and @code{\relative}, then
2098 you must use @code{\transpose} first.  @code{\relative} will have no
2099 effect music that appears inside a @code{\transpose}.
2100
2101
2102
2103 @cindex automatic lyric durations
2104
2105 If you have lyrics that are set to a melody, you can import the
2106 rhythm of that melody into the lyrics using @code{\addlyrics}.
2107
2108 @cindex addlyrics@@@code{\addlyrics}
2109  The syntax for this is
2110
2111 @quotation
2112
2113   @code{\addlyrics} 
2114 @end quotation
2115
2116 This means that both  and  are
2117 interpreted, but that every non-command atomic music expression
2118 (``every syllable'') in  is interpreted using timing
2119 of .
2120
2121 If the property @code{automaticMelismata}
2122 @cindex automaticMelismata@@@code{automaticMelismata}
2123  is set in the
2124 context of , no lyrics will be put on slurred or tied
2125 notes.
2126
2127 @quotation
2128
2129 @mudela[verbatim,fragment]
2130 \addlyrics
2131 \transpose c'' {
2132   \property Voice.automaticMelismata = "1"
2133   c8 () cis d8. e16 f2
2134 }
2135 \context Lyrics \lyrics {
2136  do4 re mi fa }
2137
2138 @end mudela
2139 @end quotation
2140
2141 You should use a single rhythm melody, and single rhythm lyrics (a
2142 constant duration is the obvious choice).  If you do not, you will get
2143 undesired effects when using multiple stanzas:
2144
2145 @quotation
2146
2147 @mudela[verbatim,fragment]
2148 \addlyrics
2149 \transpose c'' {
2150   c8 () cis d8. e16 f2
2151 }
2152 \context Lyrics \lyrics
2153 < { do4 re mi fa }
2154   { do8 re mi fa } >
2155
2156 @end mudela
2157 @end quotation
2158
2159 It is valid (but probably not very useful) to use notes instead of
2160 lyrics for .
2161
2162
2163
2164
2165 @node Ambiguities, Notation conversion specifics, transpose, LilyPond 1-2-0 Reference Manual
2166 @section Ambiguities
2167
2168 @cindex ambiguities
2169
2170 The grammar contains a number of ambiguities.@footnote{The authors
2171 hope to resolve them at a later time.}
2172
2173 @itemize @bullet
2174   @item  The assignment
2175
2176        @quotation
2177
2178          @example 
2179 foo = bar 
2180 @end example 
2181
2182        @end quotation
2183
2184        can be interpreted as making a string identifier @code{\foo}
2185        containing @code{"bar"}, or a music identifier @code{\foo}
2186        containing the syllable `bar'.
2187
2188   @item  The assignment
2189
2190        @quotation
2191
2192          @example 
2193 foo = -6 
2194 @end example 
2195
2196        @end quotation
2197
2198        can be interpreted as making an integer identifier
2199        containing -6, or a Request identifier containing the
2200        fingering `6' (with neutral direction).
2201
2202   @item  If you do a nested repeat like
2203
2204        @quotation
2205
2206 @example 
2207 \repeat ...
2208 \repeat ...
2209 \alternative 
2210 @end example 
2211
2212        @end quotation
2213
2214        then it is ambiguous to which @code{\repeat} the
2215        @code{\alternative} belongs.  This is the classic if-then-else
2216        dilemma.  It may be solved by using braces.
2217
2218   @item  (an as yet unidentified ambiguity :-)
2219 @end itemize
2220
2221
2222
2223 @node Notation conversion specifics, autobeam, Ambiguities, LilyPond 1-2-0 Reference Manual
2224 @section Notation conversion specifics
2225
2226
2227
2228 @cindex automatic beam generation
2229
2230 @node autobeam, lyricprint, Notation conversion specifics, LilyPond 1-2-0 Reference Manual
2231
2232 By default, LilyPond will generate beams automatically.  This feature
2233 can be disabled by setting the @code{Voice.noAutoBeaming}
2234 @cindex Voice.noAutoBeaming@@@code{Voice.noAutoBeaming}
2235
2236 property to 1.  It can be overridden for specific cases by
2237 specifying explicit beams as described in
2238 section @xref{manualbeam}.
2239
2240 A large number of Voice properties are used to decide how to generate
2241 beams.  Their default values appear in @file{auto-beam-settings.ly}.
2242 In general, beams can begin anywhere, but their ending location is
2243 significant.  Beams can end on a beat, or at durations specified by
2244 the @code{Voice.beamAutoEnd}
2245 @cindex Voice.beamAutoEnd@@@code{Voice.beamAutoEnd}
2246  property.  To end beams every
2247 quarter note, for example, you could set
2248 @code{Voice.beamAutoEnd}
2249 @cindex Voice.beamAutoEnd@@@code{Voice.beamAutoEnd}
2250  equal to `@code{"1/4"}'.  To end beams
2251 at every three eighth notes you would set it to `@code{"3/8"}'.  The
2252 same syntax can be used to specify beam starting points using
2253 @code{Voice.beamAutoBegin}
2254 @cindex Voice.beamAutoBegin@@@code{Voice.beamAutoBegin}
2255 .
2256
2257 To allow different settings for different time signatures, these
2258 property names can start with `@code{time}@code{_}' to
2259 restrict the definition to `@code{/}' time.  For example,
2260 to specify beams ending only for 6/8 time you would use the
2261 property @code{Voice.time6_8beamAutoEnd}.  To allow different endings
2262 for notes of different durations, the duration can be tacked onto the
2263 end of the property.  To specify beam endings for beams that contain
2264 32nd notes, you would use @code{Voice.beamAutoEnd_32}.
2265
2266
2267
2268 @cindex chord names
2269
2270 @cindex chords
2271
2272 @cindex printing!chord names
2273
2274 For displaying printed chord names, use the @code{ChordNames}
2275 @cindex ChordNames@@@code{ChordNames}
2276
2277 and @code{ChordNameVoice}
2278 @cindex ChordNameVoice@@@code{ChordNameVoice}
2279  contexts.  The chords may be entered
2280 either using the notation described above, or directly using
2281 simultaneous music.
2282
2283 @quotation
2284
2285 @mudela[fragment,verbatim]
2286 <
2287   \context ChordNames {
2288     \chords{a b c} \notes{<d f g>  <e g b>}
2289   }
2290   \context Staff \notes {
2291     a b c' d' e'
2292   }
2293 >
2294
2295 @end mudela
2296 @end quotation
2297
2298 LilyPond examines chords specified as lists of notes to determine a
2299 name to give the chord.  By default, LilyPond will not try to
2300 identify chord inversions:
2301
2302 @mudela[fragment,verbatim,center]
2303   <
2304     \context ChordNameVoice \notes {
2305       <e'1 g' c''>
2306     }
2307     \context Thread \notes {
2308       <e'1 g' c''>
2309     }
2310   >
2311 @end mudela
2312
2313 If you want inversions to be recognized, you must set the property
2314 @code{ChordNames.chordInversion}
2315 @cindex ChordNames.chordInversion@@@code{ChordNames.chordInversion}
2316 :
2317
2318 @mudela[fragment,verbatim,center]
2319   <
2320     \property Score.chordInversion = 1
2321     \context ChordNameVoice \notes {
2322       <e'1 g' c''>
2323     }
2324     \context Thread \notes {
2325       <e'1 g' c''>
2326     }
2327   >
2328 @end mudela
2329
2330
2331
2332 @cindex lyrics
2333
2334 @cindex printing!lyrics
2335
2336 @node lyricprint, Notation Contexts, autobeam, LilyPond 1-2-0 Reference Manual
2337
2338 Lyric syllables must be interpreted within a @code{Lyrics} context
2339
2340 @cindex context!Lyrics
2341  for printing them.
2342
2343 Here is a full example: 
2344
2345 @quotation
2346
2347 @mudela[verbatim]
2348 \score {
2349   <
2350     \notes \transpose c'' {
2351       c d e c | c d e c |
2352       e f g2 | e4 f g2 \bar "|.";
2353     }
2354     \context Lyrics \lyrics { 
2355       Va-4 der Ja- cob Va- der Ja- cob
2356       Slaapt gij nog?2 Slaapt4 gij nog?2
2357     }
2358   >
2359 }
2360
2361 @end mudela
2362 @end quotation
2363
2364 You may want a continuous line after the syllables to show melismata. 
2365 To achieve this effect, add a `@code{__}' lyric as a separate word
2366 after the lyric to be extended.  This will create an extender, a line
2367 that extends over the entire duration of the lyric.  This line will
2368 run all the way to the start of the next lyric, so you may want to
2369 shorten it by using a blank lyric (using `@code{_}').
2370
2371 @quotation
2372
2373 @mudela[verbatim]
2374 \score {
2375   <
2376     \notes \relative c'' {
2377       a4 () b () c () d | c () d () b () a | c () d () b () a
2378     }
2379     \context Lyrics \lyrics {
2380       foo1 __ | bar2. __ _4 | baz1 __
2381     }
2382   >
2383 }
2384
2385 @end mudela
2386 @end quotation
2387
2388      
2389 If you want to have hyphens centered between syllables (rather than
2390 attached to the end of the first syllable) you can use the special
2391 `@code{-}@code{-}' lyric as a separate word between syllables.  This
2392 will result in a hyphen which length varies depending on the space
2393 between syllables, and which will be centered between the syllables. 
2394 For example:
2395
2396 @quotation
2397
2398 @mudela[verbatim]
2399 \score {
2400   <
2401     \notes \transpose c'' {
2402       c d e c | c d e c |
2403       e f g2 | e4 f g2 \bar "|.";
2404     }
2405     \context Lyrics \lyrics {
2406       Va4 -- der Ja -- cob | Va -- der Ja -- cob |
2407       Slaapt gij nog?2 | Slaapt4 gij nog?2
2408     }
2409   >
2410 }
2411
2412 @end mudela
2413 @end quotation
2414
2415
2416
2417 @node Notation Contexts, contextselection, lyricprint, LilyPond 1-2-0 Reference Manual
2418 @section Notation Contexts
2419
2420 @cindex notation contexts
2421
2422 Notation contexts are objects that only exist during a run of
2423 LilyPond.  During the interpretation phase of LilyPond, the Music
2424 expression contained in a @code{\score} block is interpreted in time
2425 order.  This is the order in which humans read, play, and write
2426 music.
2427
2428 A context is an object that holds the reading state of the
2429 expression; it contains information like
2430
2431 @itemize @bullet
2432   @item  What notes are playing at this point?
2433   @item  What symbols will be printed at this point?
2434   @item  In what style will they printed?
2435   @item  What is the current key signature, time signature, point within
2436        the measure, etc.?
2437 @end itemize
2438
2439 Contexts are grouped hierarchically: A @code{Voice} context is
2440 contained in a @code{Staff} context (because a staff can contain
2441 multiple voices at any point), a @code{Staff} context is contained in
2442 a @code{Score}, @code{StaffGroup}, or @code{ChoirStaff} context (because
2443 these can all contain multiple staffs).
2444
2445 Contexts associated with sheet music output are called @emph{notation
2446 contexts}, those for sound output are called playing contexts.
2447
2448 Contexts are created either manually or automatically.  Initially,
2449 the top level music expression is interpreted by the top level
2450 context (the @code{Score} context).  When a atomic music expression
2451 (i.e. a note, a rest, @code{\bar}, or @code{\time} commands), a nested
2452 set of contexts is created that can process these atomic expressions,
2453 as in this example:
2454
2455 @quotation
2456
2457   @example 
2458 \score @{ \notes < c4 > @} 
2459 @end example 
2460
2461 @end quotation
2462
2463 The sequential music, `@code{@{ c4 @}}' is interpreted by @code{Score}
2464 context. When the note `@code{c4}' itself is interpreted, a set of
2465 contexts is needed that will accept notes.  The default for this is a
2466 @code{Voice} context, contained in a @code{Staff} context.  Creation of
2467 these contexts results in the staff being printed.
2468
2469
2470 @node contextselection, Notation output definitions, Notation Contexts, LilyPond 1-2-0 Reference Manual
2471
2472 @cindex context
2473
2474 You can also create contexts manually, and you probably have to do so
2475 if you want to typeset complicated multiple part material.  If a
2476 `@code{\context}  ' expression is encountered
2477 during the interpretation phase, the  argument will be
2478 interpreted with a context of type .  If you specify a name,
2479 the specific context with that name is searched.
2480
2481 If a context of the specified type and name can not be found, a new
2482 one is created.  For example,
2483
2484 @quotation
2485
2486 @mudela[verbatim]
2487 \score {
2488   \notes \relative c'' {
2489     c4 <d4 \context Staff = "another" e4> f
2490   }
2491 }
2492
2493 @end mudela
2494 @end quotation
2495
2496 In this example, the @code{c} and @code{d} are printed on the
2497 default staff.  For the @code{e}, a context Staff called
2498 `@code{another}' is specified; since that does not exist, a new
2499 context is created.  Within @code{another}, a (default) Voice context
2500 is created for the @code{e4}.  When all music referring to a
2501 context is finished, the context is ended as well.  So after the
2502 third quarter, @code{another} is removed.
2503
2504 Almost all music expressions inherit their interpretation context
2505 from their parent.  In other words, suppose that the syntax for a
2506 music expression is
2507
2508 @quotation
2509
2510   @code{\keyword}   ...
2511 @end quotation
2512
2513 When the interpretation of this music expression starts, the context
2514 for , , etc. is that of the total
2515 expression.
2516
2517 Lastly, you may wonder, why this:
2518
2519 @quotation
2520
2521 @example 
2522 \score @{
2523   \notes \relative c'' @{
2524     c4 d4 e4
2525   @}
2526 @} 
2527 @end example 
2528
2529 @end quotation
2530
2531 doesn't result in this:
2532
2533 @mudela[]
2534
2535   \score {
2536     \notes \relative c'' {
2537       <c4> <d4> <e4>
2538     }
2539   }
2540
2541 @end mudela
2542
2543 For the @code{c4}, a default @code{Staff} (with a contained
2544 @code{Voice}) context is created.  After the @code{c4} ends, no
2545 music refers to this default staff, so it would be ended, with the
2546 result shown.  To prevent this inconvenient behavior, the context to
2547 which the sequential music refers is adjusted during the
2548 interpretation.  So after the @code{c4} ends, the context of the
2549 sequential music is also the default @code{Voice} context. 
2550 The @code{d4} gets interpreted in the same context
2551 as @code{c4}.
2552
2553
2554
2555 These are the contexts supplied with the package.  They are defined
2556 in the initialization file @file{ly/engraver.ly}.
2557
2558 @table @samp
2559   @item @code{Grace}
2560 @cindex Grace@@@code{Grace}
2561  @* 
2562     The context for handling grace notes.  It is instantiated
2563     automatically when you use @code{\grace}.  Basically, it is an
2564     `embedded' miniature of the Score context.  Since this context
2565     needs special interaction with the rest of LilyPond, you should
2566     not explicitly instantiate it.
2567
2568   @item @code{LyricVoice}
2569 @cindex LyricVoice@@@code{LyricVoice}
2570  @* 
2571     Corresponds to a voice with lyrics.  Handles the printing of a
2572     single line of lyrics.
2573
2574   @item @code{Thread}
2575 @cindex Thread@@@code{Thread}
2576  @* 
2577     Handles note heads, and is contained in the Voice context.  You
2578     have to instantiate this explicitly if you want to adjust the
2579     style of individual note heads.
2580
2581   @item @code{Voice}
2582 @cindex Voice@@@code{Voice}
2583  @* 
2584     Corresponds to a voice on a staff.  This context handles the
2585     conversion of dynamic signs, stems, beams, super- and subscripts,
2586     slurs, ties, and rests.
2587
2588     You have to instantiate this explicitly if you want to have
2589     multiple voices on the same staff.
2590
2591   @item @code{ChordNamesVoice}
2592 @cindex ChordNamesVoice@@@code{ChordNamesVoice}
2593  @* 
2594     A voice with chord names.  Handles printing of a line of chord
2595     names.
2596
2597   @item @code{ChordNames}
2598 @cindex ChordNames@@@code{ChordNames}
2599  @* 
2600     Typesets chord names.  Can contain @code{ChordNamesVoice}
2601     contexts.
2602
2603   @item @code{Lyrics}
2604 @cindex Lyrics@@@code{Lyrics}
2605  @* 
2606     Typesets lyrics.  It can contain @code{LyricVoice} contexts.
2607
2608   @item @code{Staff}
2609 @cindex Staff@@@code{Staff}
2610  @* 
2611     Handles clefs, bar lines, keys, accidentals.  It can contain
2612     @code{Voice} contexts.
2613
2614   @item @code{RhythmicStaff}
2615 @cindex RhythmicStaff@@@code{RhythmicStaff}
2616  @* 
2617     A context like @code{Staff} but for printing rhythms.  Pitches are
2618     ignored; the notes are printed on one line.  It can contain
2619     @code{Voice} contexts.
2620
2621   @item @code{GrandStaff}
2622 @cindex GrandStaff@@@code{GrandStaff}
2623  @* 
2624     Contains @code{Staff} or @code{RhythmicStaff} contexts.  It adds a
2625     brace on the left side, grouping the staffs together.  The bar
2626     lines of the contained staffs are connected vertically.  It can
2627     contain @code{Staff} contexts.
2628
2629   @item @code{PianoStaff}
2630 @cindex PianoStaff@@@code{PianoStaff}
2631  @* 
2632     Just like @code{GrandStaff} but with @code{minVerticalAlign} set
2633     equal to @code{maxVerticalAlign} so that interstaff beaming and
2634     slurring can be used.
2635
2636   @item @code{StaffGroup}
2637 @cindex StaffGroup@@@code{StaffGroup}
2638  @* 
2639     Contains @code{Staff} or @code{RhythmicStaff} contexts.  Adds a
2640     bracket on the left side, grouping the staffs together.  The bar
2641     lines of the contained staffs are connected vertically.  It can
2642     contain @code{Staff}, @code{RhythmicStaff}, @code{GrandStaff}, or
2643     @code{Lyrics} contexts.
2644
2645   @item @code{ChoirStaff}
2646 @cindex ChoirStaff@@@code{ChoirStaff}
2647  @* 
2648     Identical to @code{StaffGroup} except that the contained staffs
2649     are not connected vertically.
2650
2651   @item @code{Score}
2652 @cindex Score@@@code{Score}
2653  @* 
2654     This is the top level notation context.  No other context can
2655     contain a @code{Score} context.  This context handles the
2656     administration of time signatures.  It also makes sure that items
2657     such as clefs, time signatures, and key-signatures are aligned
2658     across staffs.  It can contain @code{Lyrics}, @code{Staff},
2659     @code{RhythmicStaff}, @code{GrandStaff}, @code{StaffGroup}, and
2660     @code{ChoirStaff} contexts.
2661
2662     You cannot explicitly instantiate a Score context (since it is
2663     not contained in any other context).  It is instantiated
2664     automatically when an output definition (a @code{\score} or
2665     @code{\paper} block) is processed.
2666 @end table
2667
2668
2669
2670 Properties that are set in one context are inherited by all of the
2671 contained contexts.  This means that a property valid for the
2672 @code{Voice} context can be set in the @code{Score} context (for
2673 example) and thus take effect in all @code{Voice} contexts.
2674
2675 Properties can be preset within the @code{\translator} block
2676 corresponding to the appropriate context.  In this case, the syntax
2677 is
2678
2679 @quotation
2680
2681    @code{=} 
2682 @end quotation
2683
2684 This assignment happens before interpretation starts, so a
2685 @code{\property} expression will override any predefined settings.
2686
2687 The @code{\property} expression will create any property you specify.
2688 There is no guarantee that a property will be used.  So if you spell
2689 a property name wrong, there will be no error message.
2690
2691 The property settings are used during the interpretation phase.  They
2692 are read by the LilyPond modules where interpretation contexts are
2693 built of.  These modules are called @emph{translators}.  Translators for
2694 notation are called @emph{engravers}, and translators for sound are
2695 called @emph{performers}.
2696
2697 The precise result of a property is determined by the implementation
2698 of the translator that reads them.  Therefore, the result of a
2699 property can vary, since it is implementation and configuration
2700 dependent.
2701
2702 In order to fully find out what properties are used, you must
2703 currently search the source code for calls to @code{get_property}. 
2704 The rest of the section is devoted to an (incomplete) overview of
2705 available properties.
2706
2707
2708 @cindex properties!Lyrics
2709
2710 @table @samp
2711   @item @code{textStyle}
2712 @cindex textStyle@@@code{textStyle}
2713  @* 
2714     Set the font for lyrics.  The available font choices are
2715     @code{roman}, @code{italic}, @code{bold}, @code{large}, @code{Large},
2716     @code{typewriter}, and @code{finger}.  The @code{finger} font can
2717     only display numbers.  Note also that you must be careful when
2718     using @code{\property} in Lyrics mode, because of the way strings
2719     are parsed.  Either put quotes around the arguments to
2720     @code{\property} or be sure to leave a space on both sides of the
2721     dot.
2722 @end table
2723
2724
2725 @cindex properties!Thread
2726
2727 @table @samp
2728   @item @code{noteheadStyle}
2729 @cindex noteheadStyle@@@code{noteheadStyle}
2730  @* 
2731     Selects type of note head.  Choices are @code{cross},
2732     @code{diamond}, @code{harmonic}, @code{transparent}, and @code{""}. 
2733     They are shown in that order below.
2734
2735     @mudela[center]
2736
2737       \score {
2738         \notes { 
2739           \property Staff.barNonAuto = 1
2740           \property Voice.noteHeadStyle = cross 
2741           a'
2742           \property Voice.noteHeadStyle = diamond
2743           a'
2744           \property Voice.noteHeadStyle = harmonic
2745           a'
2746           \property Voice.noteHeadStyle = transparent
2747           a' 
2748           \property Voice.noteHeadStyle = ""
2749           a'
2750         }
2751         \paper {
2752           linewidth = -1.;
2753         }
2754       }
2755     
2756 @end mudela
2757 @end table
2758
2759 @subsubheading Grace properties
2760
2761 @cindex properties!Grace
2762
2763  
2764 @table @samp  
2765   @item @code{stemStyle}
2766 @cindex stemStyle@@@code{stemStyle}
2767  @* 
2768     By default set to @code{"grace"} meaning that all unbeamed 
2769     notes with flags are typeset with a slash through the flag. 
2770     Setting to @code{""} gives standard flags.
2771 @end table
2772
2773
2774 @cindex properties!Voice
2775
2776 @table @samp  
2777   @item @code{abbrev}
2778 @cindex abbrev@@@code{abbrev}
2779  @* 
2780     Set length for tremolo to be used if no length is explicitly
2781     specified. 
2782
2783   @item @code{articulationScriptPadding}
2784 @cindex articulationScriptPadding@@@code{articulationScriptPadding}
2785
2786     @* 
2787     Determines the extra space added between articulation marks, such
2788     as staccato, tenuto, trill, up/down bow or fermata, and the
2789     closest staff line or note.
2790
2791   @item @code{articulationScriptVerticalDirection}
2792     
2793 @cindex articulationScriptVerticalDirection@@@code{articulationScriptVerticalDirection}
2794  @* 
2795     Determines the location of articulation marks.  Set to @code{\up}
2796     to print marks above the staff; set to @code{\down} to print marks
2797     below the staff.  This property does not override explicit
2798     directions marked with `@code{^}' or `@code{_}' in the mudela file.
2799     
2800   @item @code{noAutoBeaming}
2801 @cindex beamAuto@@@code{beamAuto}
2802  @* 
2803     If set to 1 then beams are not generated automatically.
2804
2805   @item @code{beamAutoEnd}
2806 @cindex beamAutoEnd@@@code{beamAutoEnd}
2807  @* 
2808     Specifies when automatically generated beams can end.  See
2809     section @xref{autobeam}.
2810
2811   @item @code{beamAutoBegin}
2812 @cindex beamAutoBegin@@@code{beamAutoBegin}
2813  @* 
2814     Specifies when automatically generated beams can start.  See
2815     section @xref{autobeam}.
2816
2817   @item @code{beamquantisation}
2818 @cindex beamquantisation@@@code{beamquantisation}
2819  @* 
2820     Set to @code{\none} for no quantization.  Set to @code{\normal} to
2821     quantize position and slope.  Set to @code{\traditional} to avoid
2822     wedges.  These three settings are available via
2823     @code{\beamposfree}
2824 @cindex beamposfree@@@code{\beamposfree}
2825 ,
2826     @code{\beamposnormal}
2827 @cindex beamposnormal@@@code{\beamposnormal}
2828 , and
2829     @code{\beampostraditional}
2830 @cindex beampostraditional@@@code{\beampostraditional}
2831 .
2832
2833   @item @code{beamslopedamping}
2834 @cindex beamslopedamping@@@code{beamslopedamping}
2835  @* 
2836     Set to @code{\none} for undamped beams.  Set to @code{\normal} for
2837     damped beams.  Set to @code{\infinity} for beams with zero slope. 
2838     The identifiers
2839     @code{\beamslopeproportional}
2840 @cindex beamslopeproportional@@@code{\beamslopeproportional}
2841 ,
2842     @code{\beamslopedamped}
2843 @cindex beamslopedamped@@@code{\beamslopedamped}
2844 , and
2845     @code{\beamslopezero}
2846 @cindex beamslopezero@@@code{\beamslopezero}
2847  each set the
2848     corresponding value.
2849
2850   @item @code{dynamicDirection}
2851 @cindex dynamicDirection@@@code{dynamicDirection}
2852  @* 
2853     Determines location of dynamic marks.  Set to @code{\up} to print
2854     marks above the staff; set to @code{\down} to print marks below
2855     the staff.
2856
2857   @item @code{dynamicStyle}
2858 @cindex dynamicStyle@@@code{dynamicStyle}
2859  @* 
2860     Set the text style for dynamics.  
2861
2862   @item @code{fontSize}
2863 @cindex fontSize@@@code{fontSize}
2864  @* 
2865     Can be used to select smaller font sizes for music.  The normal
2866     font size is 0, and the two smaller sizes are -1
2867     and -2.
2868
2869    @item @code{forceHorizontalShift}
2870 @cindex forceHorizontalShift@@@code{forceHorizontalShift}
2871  @* 
2872     Force horizontal shift for collision resolution.  It overrides
2873     automatic collision resolution.  The value is the shift amount
2874     expressed in @code{note_width}, as set in the paper section.
2875     
2876
2877   @item @code{horizontalNoteShift}
2878 @cindex horizontalNoteShift@@@code{horizontalNoteShift}
2879  @* 
2880     Enable LilyPond to shift notes horizontally if they collide with
2881     other notes.  This is useful when typesetting many voices on one
2882     staff.  The identifier @code{\shift}
2883 @cindex shift@@@code{\shift}
2884  is defined to
2885     enable this.  Traditionally, the outer chords (the upmost and
2886     downmost voices), should have no @code{horizontalNoteShift}.
2887
2888   @item @code{markScriptPadding}
2889 @cindex markScriptPadding@@@code{markScriptPadding}
2890  @* 
2891     Determines the extra space added between the mark and the closest
2892     staff line or note.
2893
2894   @item @code{markDirection}
2895 @cindex markDirection@@@code{markDirection}
2896  @* 
2897     Determines if marks should be printed above or below the staff.
2898     Set to @code{\up} to print marks above the staff; set to
2899     @code{\down} to print marks below the staff.
2900
2901   @item @code{midiInstrument}
2902 @cindex midiInstrument@@@code{midiInstrument}
2903  @* 
2904     Sets the instrument for MIDI output.  If this property is not set
2905     then LilyPond will use the @code{instrument} property.  This must
2906     be set to one of the strings on the list of MIDI instruments that
2907     appears in section @xref{midilist}.  If you use a string which
2908     is not listed, LilyPond will silently substitute piano.
2909
2910   @item @code{oldTieBehavior}
2911 @cindex oldTieBehavior@@@code{oldTieBehavior}
2912  @* 
2913     Set to 1 in order to get old tie behavior where ties would
2914     connect unequal pitches.  This property is deprecated, and its
2915     use is not recommended.
2916
2917   @item @code{restStyle}
2918 @cindex restStyle@@@code{restStyle}
2919  @* 
2920     Change the layout of rests shorter than quarter notes. 
2921     Currently, the standard layout @code{""} and mensural notation
2922     @code{"mensural"} are available. Mensural rests of duration
2923     32 or shorter are not available.
2924     
2925   @item @code{scriptHorizontal}
2926 @cindex scriptHorizontal@@@code{scriptHorizontal}
2927  @* 
2928     Put scripts left or right of note heads.  Support for this is
2929     limited.  Accidentals will collide with scripts.
2930     
2931   @item @code{slurVerticalDirection}
2932 @cindex slurVerticalDirection@@@code{slurVerticalDirection}
2933  @* 
2934     Set to @code{\free} for free choice of slur direction, set to
2935     @code{\up} to force slurs up, set to @code{\down} to force slurs
2936     down.  The shorthands @code{\slurup}
2937 @cindex slurup@@@code{\slurup}
2938 ,
2939     @code{\slurdown}
2940 @cindex slurdown@@@code{\slurdown}
2941 , and
2942     @code{\slurboth}
2943 @cindex slurboth@@@code{\slurboth}
2944  are available.
2945
2946   @item @code{slurDash}
2947 @cindex slurDash@@@code{slurDash}
2948  @* 
2949     Set to 0 for normal slurs, 1 for dotted slurs, and a
2950     larger value for dashed slurs.  Identifiers
2951     @code{\slurnormal}
2952 @cindex slurnormal@@@code{\slurnormal}
2953  and
2954     @code{\slurdotted}
2955 @cindex slurdotted@@@code{\slurdotted}
2956  are predefined to set the
2957     first two settings.
2958
2959 @item @code{stemLength}
2960 @cindex stemLength@@@code{stemLength}
2961  @* 
2962     Set length of stems.  Unit is `@code{interline}/2', so
2963     @code{stemLength} defaults to 7.
2964
2965   @item @code{stemLeftBeamCount}
2966 @cindex stemLeftBeamCount@@@code{stemLeftBeamCount}
2967  @* 
2968     Specify the number of beams to draw on the left side of the next
2969     note.  Overrides automatic beaming.  The value is only used once,
2970     and then it is erased.
2971
2972   @item @code{stemRightBeamCount}
2973 @cindex stemRightBeamCount@@@code{stemRightBeamCount}
2974  @* 
2975     Specify the number of beams to draw on the right side of the next
2976     note.  Overrides automatic beaming.  The value is only used once,
2977     and then it is erased.
2978   @item @code{tieVerticalDirection}
2979 @cindex tieVerticalDirection@@@code{tieVerticalDirection}
2980  @* 
2981     Set to @code{\free} for free choice of tie direction, set to
2982     @code{\up} to force ties up, set to @code{\down} to force ties
2983     down.
2984
2985   @item @code{transposing}
2986 @cindex transposing@@@code{transposing}
2987  @* 
2988     Transpose the MIDI output.  Set this property to the number of
2989     half-steps to transpose by.
2990
2991   
2992   @item @code{textEmptyDimension}
2993 @cindex textEmptyDimension@@@code{textEmptyDimension}
2994  @* 
2995     If set to 1 then text placed above or below the staff is
2996     assumed to have zero width.
2997   
2998   @item @code{textStyle}
2999 @cindex textStyle@@@code{textStyle}
3000  @* 
3001     Set the text style for superscripts and subscripts.  See above
3002     for list of text styles.
3003
3004   @item @code{textScriptPadding}
3005 @cindex textScriptPadding@@@code{textScriptPadding}
3006  @* 
3007     Determines the extra space added between superscripted resp.
3008     subscripted text and the closest staff line or note.
3009
3010   @item @code{verticalDirection}
3011 @cindex verticalDirection@@@code{verticalDirection}
3012  @* 
3013     Determines the direction of stems, subscripts, beams, slurs, and
3014     ties.  Set to @code{\down} to force them down, @code{\up} to force
3015     them up, or @code{\free} to let LilyPond decide.  This can be used
3016     to distinguish between voices on the same staff.  The
3017     @code{\stemdown}
3018 @cindex stemdown@@@code{\stemdown}
3019 , @code{\stemup}
3020 @cindex stemup@@@code{\stemup}
3021 ,
3022     and @code{\stemboth}
3023 @cindex stemboth@@@code{\stemboth}
3024  identifiers set this
3025     property.
3026     
3027
3028   @item @code{tupletDirection}
3029 @cindex tupletDirection@@@code{tupletDirection}
3030  @* 
3031     Determines the direction of triplets and other tuplets.  Set to
3032     @code{\down} to force them below the staff, @code{\up} to force
3033     them above, or @code{\free} to let LilyPond decide.
3034
3035   @item @code{tupletVisibility}
3036 @cindex tupletVisibility@@@code{tupletVisibility}
3037  @* 
3038     Determines whether tuplets of notes are labelled.  Setting
3039     to 0 shows nothing; setting to 1 shows a number;
3040     setting to 2 shows a number and a bracket if there is no
3041     beam; setting to 3 shows a number, and if there is no beam
3042     it adds a bracket; setting to 4 shows both a number and a
3043     bracket unconditionally.
3044
3045 @end table
3046
3047 @subsubheading Staff properties
3048
3049 @cindex properties!Staff
3050
3051 @table @samp
3052  
3053   @item @code{barNonAuto}
3054 @cindex barNonAuto@@@code{barNonAuto}
3055  @* 
3056     If set to 1 then bar lines will not be printed
3057     automatically; they must be explicitly created with @code{\bar}
3058     keywords.  Unlike with the @code{\cadenza} keyword, measures are
3059     still counted.  Bar generation will resume according to that
3060     count if this property is set to zero.
3061
3062   @item @code{barNumberDirection}
3063 @cindex barNumberDirection@@@code{barNumberDirection}
3064  @* 
3065     Set to @code{\up} or @code{\down} to put bar numbers above or below
3066     the staff.
3067
3068   @item @code{barNumberHangOnClef}
3069 @cindex barNumberHangOnClef@@@code{barNumberHangOnClef}
3070  @* 
3071     Set to 1 to cause bar numbers to appear above or below the
3072     clef instead of on the bar line.  This property is deprecated. 
3073     Do not use.
3074
3075   @item @code{barNumberScriptPadding}
3076 @cindex barNumberScriptPadding@@@code{barNumberScriptPadding}
3077  @* 
3078     Sets extra space between the bar number and the bar it labels.
3079
3080   @item @code{barSize}
3081 @cindex barSize@@@code{barSize}
3082  @* 
3083     Specify the height of the bar lines if it should be different
3084     than the staff height.
3085
3086   @item @code{barAtLineStart}
3087 @cindex barAtLineStart@@@code{barAtLineStart}
3088  @* 
3089     Set to 1 to produce a bar line after the clef at the start
3090     of each line (but not at the beginning of the music).
3091
3092   @item @code{clefStyle}
3093 @cindex clefStyle@@@code{clefStyle}
3094  @* 
3095     Determines how clefs are typeset.  If set to @code{transparent},
3096     the clefs are not printed at all, if set to
3097     @code{fullSizeChanges}, clef changes in the middle of a line are
3098     typeset with a full size clef.  By default, clef changes are
3099     typeset in smaller size.
3100
3101   @item @code{createKeyOnClefChange}
3102 @cindex createKeyOnClefChange@@@code{createKeyOnClefChange}
3103  @* 
3104     Set to a nonempty string if you want key signatures to be printed
3105     when the clef changes.  Set to the empty string if you do not
3106     want key signatures printed.
3107
3108   @item @code{createInitdefaultClef}
3109 @cindex createInitdefaultClef@@@code{createInitdefaultClef}
3110  @* 
3111     Specify whether clefs are created on default?  (Doesn't seem to
3112     do anything.)
3113
3114   @item @code{defaultClef}
3115 @cindex defaultClef@@@code{defaultClef}
3116  @* 
3117     Determines the default clef.  See @code{\clef} keyword.
3118
3119   @item @code{markHangOnClef}
3120 @cindex markHangOnClef@@@code{markHangOnClef}
3121  @* 
3122     Set to 1 to cause marks to appear by clefs instead of by bar
3123     lines.  Deprecated, use is not recommended.
3124
3125   @item @code{marginDirection}
3126 @cindex marginDirection@@@code{marginDirection}
3127  @* 
3128     Set to @code{\left} or @code{\right} to specify location of
3129     marginal scripts.
3130
3131   @item @code{marginScriptPadding}
3132 @cindex marginScriptPadding@@@code{marginScriptPadding}
3133  @* 
3134     Specify extra space for marginal scripts.
3135
3136   @item @code{forgetAccidentals}
3137 @cindex forgetAccidentals@@@code{forgetAccidentals}
3138  @* 
3139     Causes accidentals to be printed at every note instead of
3140     remembered for the duration of a measure.
3141
3142   @item @code{noResetKey}
3143 @cindex noResetKey@@@code{noResetKey}
3144  @* 
3145     Do not reset the key at the start of a measure.  Accidentals will
3146     be printed only once and are in effect until overridden, possibly
3147     many measures later.
3148
3149   @item @code{staffLineLeading}
3150 @cindex staffLineLeading@@@code{staffLineLeading}
3151  @* 
3152     Specifies the distance (in points) between lines of the staff.
3153
3154   @item @code{numberOfStaffLines}
3155 @cindex numberOfStaffLines@@@code{numberOfStaffLines}
3156  @* 
3157     Specifies the number of staff lines.  The default is 5.
3158
3159   @item @code{postBreakPadding}
3160 @cindex postBreakPadding@@@code{postBreakPadding}
3161  @* 
3162     Extra space in points to be added after the clef, time signature
3163     and key signature on the staff.  Deprecated, do not use.
3164
3165   @item @code{noVoltaBraces}
3166 @cindex noVoltaBraces@@@code{noVoltaBraces}
3167  @* 
3168     Set to true to suppress the printing of brackets over alternate
3169     endings specified by the command @code{\alternative}.
3170
3171   @item @code{numberOfStaffLines}
3172 @cindex numberOfStaffLines@@@code{numberOfStaffLines}
3173  @* 
3174     Sets the number of lines that the staff has.
3175  
3176   @item @code{barAlways}
3177 @cindex barAlways@@@code{barAlways}
3178  @* 
3179     If set to 1 a bar line is drawn after each note.
3180
3181   @item @code{defaultBarType}
3182 @cindex defaultBarType@@@code{defaultBarType}
3183  @* 
3184     Sets the default type of bar line. See Section @xref{barlines} 
3185     for a list of available bar types.
3186
3187   @item @code{instrument}, @code{instr}
3188     
3189 @cindex instrument@@@code{instrument}
3190
3191 @cindex instr@@@code{instr}
3192  @* 
3193     If @code{Staff_margin_engraver}
3194 @cindex Staff_margin_engraver
3195  is
3196     added to the Staff translator, then the @code{instrument} property
3197     is used to label the first line of the staff and the @code{instr}
3198     property is used to label subsequent lines.  If the
3199     @code{midiInstrument} property is not set, then @code{instrument}
3200     is used to determine the instrument for MIDI output.
3201
3202   @item @code{keyOctaviation}
3203 @cindex keyOctaviation@@@code{keyOctaviation}
3204  @* 
3205     If set to 1, then keys are the same in all octaves.  If set
3206     to 0 then the key signature for different octaves can be
3207     different and is specified independently:
3208
3209     @quotation
3210
3211       @code{\keysignature bes fis'}
3212     @end quotation
3213
3214     The default value is 1.  Can be set to zero with
3215     @code{\specialkey} or reset to 1 with @code{\normalkey}.
3216
3217   @item @code{timeSignatureStyle}
3218 @cindex timeSignatureStyle@@@code{timeSignatureStyle}
3219  @* 
3220     Changes the default two-digit layout for time signatures.  The
3221     following values are recognized:
3222
3223     @table @samp
3224       @item @code{C}
3225 @cindex C@@@code{C}
3226  @* 
3227         4/4 and 2/2 are typeset as C and struck C, respectively.  All
3228         other time signatures are written with two digits.
3229
3230       @item @code{old}
3231 @cindex old@@@code{old}
3232  @* 
3233         2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
3234         typeset with old-style mensuration marks.  All other time
3235         signatures are written with two digits.
3236
3237       @item @code{1}
3238 @cindex 1@@@code{1}
3239  @* 
3240         All time signatures are typeset with a single
3241         digit, e.g. 3/2 is written as 3.
3242
3243       @item 
3244 @cindex CM/N@@@code{CM/N}
3245 @code{C}@code{/}, 
3246       
3247 @cindex oldM/N@@@code{oldM/N}
3248 @code{old}@code{/} or
3249       @code{old6/8alt}
3250 @cindex old6/8alt@@@code{old6/8alt}
3251  @* 
3252         Tells LilyPond to use a specific symbol as time signature.
3253     @end table
3254
3255     The different time signature characters are shown below with its
3256     names:
3257
3258     @mudela[center]
3259
3260       \score {
3261         \notes\relative c'' {
3262           \property Voice.textStyle = typewriter
3263           \property Staff.timeSignatureStyle = "C2/2"
3264           \time 2/2; a2^"C2/2" a2 
3265           \property Staff.timeSignatureStyle = "C4/4"
3266           \time 2/2; a2^"C4/4" a2 
3267           \property Staff.timeSignatureStyle = "old2/2"
3268           \time 2/2; a2^"old2/2" a2 
3269           \property Staff.timeSignatureStyle = "old3/2"
3270           \time 2/2; a2^"old3/2" a2 
3271           \property Staff.timeSignatureStyle = "old2/4"
3272           \time 2/2; a2^"old2/4" a2 
3273           \property Staff.timeSignatureStyle = "old4/4"
3274           \time 2/2; a2^"old4/4" a2 
3275           \property Staff.timeSignatureStyle = "old6/4"
3276           \time 2/2; a2^"old6/4" a2 
3277           \property Staff.timeSignatureStyle = "old9/4"
3278           \time 2/2; a2^"old9/4" a2 
3279           \property Staff.timeSignatureStyle = "old4/8"
3280           \time 2/2; a2^"old4/8" a2 
3281           \property Staff.timeSignatureStyle = "old6/8"
3282           \time 2/2; a2^"old6/8" a2 
3283           \property Staff.timeSignatureStyle = "old6/8alt"
3284           \time 2/2; a2^"old6/8alt" a2 
3285           \property Staff.timeSignatureStyle = "old9/8"
3286           \time 2/2; a2^"old9/8" a2 
3287         }
3288         \paper {
3289           linewidth = 4.5 \in;
3290         }
3291       }
3292     
3293 @end mudela
3294
3295   @item @code{voltaSpannerDuration}
3296 @cindex voltaSpannerDuration@@@code{voltaSpannerDuration}
3297  @* 
3298     Set to an integer to control the size of the brackets printed by
3299     @code{\alternative}.  The integer specifies the number of whole
3300     notes duration to use for the brackets.  It is rounded to the
3301     nearest measure.  This can be used to shrink the length of
3302     brackets in the situation where one alternative is very large. 
3303     It may have odd effects if the specified duration is longer than
3304     the music given in an @code{\alternative}.
3305 @end table
3306    
3307
3308 @cindex properties!GrandStaff
3309
3310 @table @samp 
3311   @item @code{alignmentReference}
3312 @cindex alignmentReference@@@code{alignmentReference}
3313  @* 
3314     Set to @code{\center} for vertical alignment reference point to be
3315     in the center of the vertical group.  Set to @code{\up} to put the
3316     reference point at the top of the group.
3317
3318   @item @code{maxVerticalAlign}
3319 @cindex maxVerticalAlign@@@code{maxVerticalAlign}
3320  @* 
3321     Set the maximum vertical distance between staffs.
3322
3323   @item @code{minVerticalAlign}
3324 @cindex minVerticalAlign@@@code{minVerticalAlign}
3325  @* 
3326     Set the minimum vertical distance between staffs.  
3327 @end table
3328
3329
3330 @cindex properties!Score
3331
3332 @table @samp
3333   @item @code{skipBars}
3334 @cindex skipBars@@@code{skipBars}
3335  @* 
3336     Set to 1 to skip the empty bars that are produced by
3337     multimeasure notes and rests.  These bars will not appear on the
3338     printed output.  Set to zero (the default) to expand multimeasure
3339     notes and rests into their full length, printing the appropriate
3340     number of empty bars so that synchronization with other voices is
3341     preserved.
3342
3343     @quotation
3344
3345 @mudela[fragment,verbatim,center]
3346 r1 r1*3 R1*3\property Score.skipBars=1 r1*3 R1*3
3347
3348 @end mudela
3349     @end quotation
3350
3351 @end table
3352
3353
3354 @cindex properties!ChordNamesVoice
3355
3356 @table @samp
3357   @item @code{chordInversion}
3358 @cindex chordInversion@@@code{chordInversion}
3359  @* 
3360     Determines whether LilyPond should look for chord inversions when
3361     translating from notes to chord names.  Set to 1 to find
3362     inversions.  The default is 0 which does not look for
3363     inversions.
3364 @end table
3365
3366
3367
3368 @node Notation output definitions, output, contextselection, LilyPond 1-2-0 Reference Manual
3369 @section Notation output definitions
3370
3371 @cindex output
3372
3373 @cindex notation output
3374
3375 @cindex output definition
3376
3377 @node output, paper, Notation output definitions, LilyPond 1-2-0 Reference Manual
3378
3379 @node paper, papervars, output, LilyPond 1-2-0 Reference Manual
3380
3381 The most important output definition is the @code{\paper} block, for
3382 music notation.  The syntax is
3383
3384 @quotation
3385
3386   @code{\paper @{} []  @code{@}}
3387 @end quotation
3388
3389 where each of the items is one of
3390
3391 @itemize @bullet
3392   @item  An assignment.  The assignment must be terminated by a
3393        semicolon.  See section @xref{papervars} for information on
3394        paper variables.
3395
3396   @item  A context definition.  See section @xref{contextdefs} for
3397        more information on context definitions.
3398
3399   @item  A margin shape declaration.  The syntax is
3400
3401        @quotation
3402
3403          @code{\shape} @code{,} @code{,}
3404                       @code{,}  ... @code{;}
3405        @end quotation
3406
3407        
3408 @cindex shape@@@code{\shape}
3409
3410        Each pair of  and  values is a dimension
3411        specifying how far to indent and how wide to make the line. 
3412        The indentation and width of successive lines are specified by
3413        the successive pairs of dimensions.  The last pair of
3414        dimensions will define the characeristics of all lines beyond
3415        those explicitly specified.
3416
3417   @item  A font declaration.  Its syntax is
3418
3419        @quotation
3420
3421           @code{=} @code{\font}
3422 @cindex font@@@code{\font}
3423  
3424        @end quotation
3425
3426         is an integer describing the font to be used. 
3427        0 is the default font.   is the basename of
3428        a font (usually a member of the Feta family).
3429 @end itemize
3430
3431
3432
3433 @cindex changing font size and paper size
3434
3435 The Feta font provides musical symbols at six different sizes.  These
3436 fonts are 11 point, 13 point, 16 point, 20 point,
3437 23 point, and 26 point.  The point size of a font is the
3438 height of the five lines in a staff when displayed in the font.
3439
3440 Definitions for these sizes are the files @file{paperSZ.ly}, where
3441 @code{SZ} is one of 11, 13, 16, 20, 23 and 26.  If you include
3442 any of these files, the identifiers @code{paper_eleven},
3443 @code{paper_thirteen}, @code{paper_sixteen}, @code{paper_twenty},
3444 @code{paper_twentythree}, and @code{paper_twentysix} are defined
3445 respectively.  The default @code{\paper} block is also set.
3446
3447 To change the paper size, you must first set the
3448 @code{papersize}
3449 @cindex papersize@@@code{papersize}
3450  variable at top level.  Set it to the strings
3451 @code{a4}, @code{letter}, or @code{legal}.  After this specification,
3452 you must set the font as described above.  If you want the default
3453 font, then use the 20 point font.  The new paper size will not
3454 take effect if the font is not loaded and selected afterwards.  Paper
3455 size selection works by loading a file named after the paper size you
3456 select.
3457
3458
3459
3460 @cindex paper variables
3461
3462 @node papervars, contextdefs, paper, LilyPond 1-2-0 Reference Manual
3463
3464 There is a large number of paper variables that are used to control
3465 details of the layout.  These variables control the defaults for the
3466 entire score.  Usually, they do not have to be changed; they are by
3467 default set to values that depend on the font size in use.  The
3468 values are used by the graphic objects while formatting the score;
3469 they are therefore implementation dependent.  Most variables are
3470 accompanied by documentation in the initalization file
3471 @file{params.ly} or @file{paperSZ.ly}, where @code{SZ} is the staff
3472 height in points.
3473
3474 Nevertheless, here are some variables you may want to use or change:
3475
3476 @table @samp
3477   @item @code{indent}
3478 @cindex indent@@@code{indent}
3479  @* 
3480     The indentation of the first line of music.
3481
3482   @item @code{interline}
3483 @cindex interline@@@code{interline}
3484  @* 
3485     The distance between two staff lines, calculated from the center
3486     of the lines.  You should use either this or @code{rulethickness}
3487     as a unit for distances you modify.
3488   
3489   @item @code{linewidth}
3490 @cindex linewidth@@@code{linewidth}
3491  @* 
3492     Sets the width of the lines.  If set to -1.0, a single
3493     unjustified line is produced.
3494
3495   @item @code{output}
3496 @cindex output@@@code{output}
3497  @* 
3498     Specifies an alternate name for the the output @file{s}.
3499     A @file{.tex}, @file{.midi} or @file{.ps} extension will be 
3500     added to the string you specify.
3501
3502   @item @code{rulethickness}
3503 @cindex rulethickness@@@code{rulethickness}
3504  @* 
3505     Determines the thickness of staff and bar lines. 
3506
3507   @item @code{castingalgorithm}
3508 @cindex castingalgorithm@@@code{castingalgorithm}
3509  @* 
3510     The algorithm to use for breaking lines.  Choices are
3511     @code{\Gourlay}
3512 @cindex Gourlay@@@code{\Gourlay}
3513  for a TeX-like dynamic
3514     programming algorithm, and @code{\Wordwrap}
3515 @cindex Wordwrap@@@code{\Wordwrap}
3516  for
3517     a simple algorithm.  Gourlay breaking looks much better, but
3518     takes a lot more resources.  Wordwrap leaves loosely spaced lines
3519     at the end.
3520 @end table
3521
3522
3523 @node contextdefs, engravers, papervars, LilyPond 1-2-0 Reference Manual
3524
3525 @cindex context definition
3526
3527 A notation contexts is defined by the following information
3528
3529 @enumerate i
3530   @item  A name.
3531
3532   @item  The LilyPond modules that do the actual conversion of music to
3533        notation.  Each module is a so-called
3534        @emph{engraver}
3535 @cindex engraver
3536 .
3537
3538   @item  How these modules should cooperate, i.e. which ``cooperation
3539        module'' should be used.  This cooperation module is a special
3540        type of engraver.
3541
3542   @item  What other contexts the context can contain,
3543
3544   @item  What properties are defined.
3545 @end enumerate
3546
3547 A context definition has this syntax:
3548
3549 @quotation
3550
3551   @code{\translator} @code{@{}
3552                        
3553                     @code{@}}
3554 @end quotation
3555
3556  can be an identifier or of the form
3557
3558 @quotation
3559
3560   @code{\type}  @code{;}
3561 @end quotation
3562
3563  is one of
3564
3565 @table @samp
3566   @item @code{Engraver_group_engraver}
3567 @cindex Engraver_group_engraver@@@code{Engraver_group_engraver}
3568  @* 
3569     The standard cooperation engraver.
3570
3571   @item @code{Score_engraver}
3572 @cindex Score_engraver@@@code{Score_engraver}
3573  @* 
3574     This is cooperation module that should be in the top level context.
3575
3576   @item @code{Grace_engraver_group}
3577 @cindex Grace_engraver_group@@@code{Grace_engraver_group}
3578  @* 
3579     This is a special cooperation module (resembling
3580     @code{Score_engraver}) that is used to created an embedded
3581     `miniscore'.
3582 @end table 
3583
3584  is a list of items where each item is
3585 one of
3586
3587 @itemize @bullet
3588   @item  @code{\consists}  @code{;} @* 
3589     Add  to the list of modules in this context. 
3590     Section @xref{engravers} contains an overview of the engravers
3591     available.  The order of engravers added with @code{\consists} is
3592     significant.
3593   
3594   @item  @code{\consistsend}  @code{;} @* 
3595     Analogous to @code{\consists}, but makes sure that
3596      is always added to the end of the list of
3597     engravers.
3598
3599     Some engraver types need to be at the end of the list; this
3600     insures they are put there, and stay there, if a user adds or
3601     removes engravers.  This command is usually not needed for
3602     end-users.
3603     
3604   @item  @code{\accepts}  @code{;} @* 
3605     Add  to the list of  context this context can
3606     contain.  The first listed context the context to create by
3607     default.
3608   
3609   @item  @code{\remove}  @code{;} @* 
3610     Remove a previously added (with @code{\consists}) engraver.
3611   
3612   @item  @code{\name}  @code{;} @* 
3613     This sets name of the context, e.g. @code{Staff}, @code{Voice}.  If
3614     the name is not specified, the translator won't do anything.
3615
3616   @item   @code{=}  @code{;} @* 
3617     A property assignment.  It is allowed to use reals for
3618     .
3619 @end itemize
3620
3621 In the @code{\paper} block, it is also possible to define translator
3622 identifiers.  Like other block identifiers, the identifier can only
3623 be used as the very first item of a translator.  In order to define
3624 such an identifier outside of @code{\score}, you must do
3625
3626 @quotation
3627
3628 @example 
3629 \paper @{
3630   foo = \translator @{ ... @}
3631 @}
3632 \score @{
3633   \notes @{
3634     ...
3635   @}
3636   \paper @{
3637     \translator @{ \foo ... @}
3638   @}
3639 @} 
3640 @end example 
3641
3642 @end quotation
3643
3644
3645 @cindex paper types, engravers, and pre-defined translators
3646
3647 Some pre-defined identifiers can simplify modification of
3648 translators.  The pre-defined identifiers are:
3649
3650 @table @samp
3651   @item @code{StaffContext}
3652 @cindex StaffContext@@@code{StaffContext}
3653  @* 
3654     Default Staff context. 
3655
3656   @item @code{RhythmicStaffContext}
3657 @cindex RhythmicStaffContext@@@code{RhythmicStaffContext}
3658  @* 
3659     Default RhythmicStaff context. 
3660
3661   @item @code{VoiceContext}
3662 @cindex VoiceContext@@@code{VoiceContext}
3663  @* 
3664     Default Voice context.  
3665
3666   @item @code{ScoreContext}
3667 @cindex ScoreContext@@@code{ScoreContext}
3668  @* 
3669     Default Score context. 
3670
3671   @item @code{ScoreWithNumbers}
3672 @cindex ScoreWithNumbers@@@code{ScoreWithNumbers}
3673  @* 
3674     Score context with numbering at the Score level.
3675
3676   @item @code{BarNumberingStaffContext}
3677 @cindex BarNumberingStaffContext@@@code{BarNumberingStaffContext}
3678  @* 
3679     Staff context with numbering at the Staff level.
3680
3681   @item @code{HaraKiriStaffContext}
3682 @cindex HaraKiriStaffContext@@@code{HaraKiriStaffContext}
3683  @* 
3684     Staff context that does not print if it only contains rests. 
3685     Useful for orchestral scores.@footnote{Harakiri, also called
3686     Seppuku, is the ritual suicide of the Samourai.}
3687
3688   @item @code{OrchestralPartStaffContext}
3689 @cindex OrchestralPartStaffContext@@@code{OrchestralPartStaffContext}
3690
3691   @item @code{OrchestralScoreContext}
3692 @cindex OrchestralScoreContext@@@code{OrchestralScoreContext}
3693
3694 @end table
3695
3696 Using these pre-defined values, you can remove or add items to the
3697 translator:
3698
3699 @quotation
3700
3701 @example 
3702 \paper @{
3703   \translator @{
3704     \StaffContext
3705     \remove Some_engraver;
3706     \consists Different_engraver;
3707   @}
3708 @} 
3709 @end example 
3710
3711 @end quotation
3712
3713       
3714
3715 @node engravers, Sound output, contextdefs, LilyPond 1-2-0 Reference Manual
3716
3717 The engravers for paper output are:
3718
3719 [incomplete, FIXME]
3720
3721 @table @samp
3722   @item @code{Bar_engraver}
3723 @cindex Bar_engraver@@@code{Bar_engraver}
3724  @* 
3725     Engraves bar lines.  Normally in @code{Staff} and
3726     @code{RhythmicStaff}.
3727
3728   @item @code{Bar_number_engraver}
3729 @cindex Bar_number_engraver@@@code{Bar_number_engraver}
3730  @* 
3731     Engrave bar numbers.  These numbers appear at the start of each
3732     line.  Not normally in any translator.  Can be added to
3733     @code{Score} for score-wide numbering or to @code{Staff} for
3734     numbering on each staff.
3735
3736   @item @code{Beam_engraver}
3737 @cindex Beam_engraver@@@code{Beam_engraver}
3738  @* 
3739     Handles beam requests by engraving beams.  Normally appears in
3740     the @code{Voice} translator.  If omitted, then notes will be
3741     printed with flags instead of beams.
3742
3743   @item @code{Beam_req_swallow_translator}
3744     
3745 @cindex Beam_req_swallow_translator@@@code{Beam_req_swallow_translator}
3746  @* 
3747     Swallows beam requests.  In @code{LyricVoice}.  
3748
3749   @item @code{Chord_name_engraver}
3750 @cindex Chord_name_engraver@@@code{Chord_name_engraver}
3751  @* 
3752     Engraves chord names.  Normally in @code{ChordNameVoice} .
3753
3754   @item @code{Chord_tremolo_engraver}
3755 @cindex Chord_tremolo_engraver@@@code{Chord_tremolo_engraver}
3756
3757   @item @code{Clef_engraver}
3758 @cindex Clef_engraver@@@code{Clef_engraver}
3759  @* 
3760     Engraves the clef symbol.  Normally in @code{Staff}.
3761
3762   @item @code{Collision_engraver}
3763 @cindex Collision_engraver@@@code{Collision_engraver}
3764
3765   @item @code{Dot_column_engraver}
3766 @cindex Dot_column_engraver@@@code{Dot_column_engraver}
3767  @* 
3768     Engraves dots on dotted notes shifted to the right of the note. 
3769     Normally in @code{Voice}.  If omitted, then dots appear on top of
3770     the notes.
3771
3772   @item @code{Dynamic_engraver}
3773 @cindex Dynamic_engraver@@@code{Dynamic_engraver}
3774  @* 
3775     Engraves dynamics symbols.  Normally in @code{Voice}.
3776
3777   @item @code{Font_size_engraver}
3778 @cindex Font_size_engraver@@@code{Font_size_engraver}
3779
3780   @item @code{Key_engraver}
3781 @cindex Key_engraver@@@code{Key_engraver}
3782  @* 
3783     Engraves the key signature.  Normally in @code{Staff}.
3784
3785   @item @code{Local_key_engraver}
3786 @cindex Local_key_engraver@@@code{Local_key_engraver}
3787
3788   @item @code{Lyric_engraver}
3789 @cindex Lyric_engraver@@@code{Lyric_engraver}
3790  @* 
3791     Engraves lyrics.  Normally in @code{LyricVoice}.
3792
3793   @item @code{Multi_measure_rest_engraver}
3794     
3795 @cindex Multi_measure_rest_engraver@@@code{Multi_measure_rest_engraver}
3796  @* 
3797     Engraves multi-measure rests that are produced with @code{R}. 
3798     Normally in @code{Voice}.
3799
3800   @item @code{Piano_bar_engraver}
3801 @cindex Piano_bar_engraver@@@code{Piano_bar_engraver}
3802
3803   @item @code{Pitch_squash_engraver}
3804 @cindex Pitch_squash_engraver@@@code{Pitch_squash_engraver}
3805  @* 
3806     Treat all pitches as middle C.  Used in @code{RhythmicStaff}. 
3807     Note that the notes move, but the locations of accidentals stay
3808     the same.
3809
3810   @item @code{Priority_horizontal_align_engraver}
3811     
3812 @cindex Priority_horizontal_align_engraver@@@code{Priority_horizontal_align_engraver}
3813
3814   @item @code{Repeat_engraver}
3815 @cindex Repeat_engraver@@@code{Repeat_engraver}
3816  @* 
3817     Handles repeats?  In @code{Staff} and @code{RhythmicStaff}.
3818
3819   @item @code{Rest_collision_engraver}
3820 @cindex Rest_collision_engraver@@@code{Rest_collision_engraver}
3821  @* 
3822     Handles collisions of rests.  In @code{Staff}.
3823
3824   @item @code{Rest_engraver}
3825 @cindex Rest_engraver@@@code{Rest_engraver}
3826  @* 
3827     Engraves rests.  Normally in @code{Voice}.
3828
3829   @item @code{Rhythmic_column_engraver}
3830 @cindex Rhythmic_column_engraver@@@code{Rhythmic_column_engraver}
3831
3832   @item @code{Score_priority_engraver}
3833 @cindex Score_priority_engraver@@@code{Score_priority_engraver}
3834
3835   @item @code{Script_engraver}
3836 @cindex Script_engraver@@@code{Script_engraver}
3837  @* 
3838     Handles note ornaments generated by @code{\script}.  Normally in
3839     @code{Voice}.
3840
3841   @item @code{Separating_line_group_engraver}
3842     
3843 @cindex Separating_line_group_engraver@@@code{Separating_line_group_engraver}
3844
3845   @item @code{Skip_req_swallow_translator}
3846     
3847 @cindex Skip_req_swallow_translator@@@code{Skip_req_swallow_translator}
3848
3849   @item @code{Slur_engraver}
3850 @cindex Slur_engraver@@@code{Slur_engraver}
3851  @* 
3852     Engraves slurs.  Normally in @code{Voice}.
3853
3854   @item @code{Span_bar_engraver}
3855 @cindex Span_bar_engraver@@@code{Span_bar_engraver}
3856  @* 
3857     Engraves lines across multiple staffs.  Normally in
3858     @code{Staffgroup} and @code{GrandStaff}.  Removing this from
3859     @code{StaffGroup} gives the definition of @code{ChoirStaff}.
3860
3861   @item @code{Span_score_bar_engraver}
3862 @cindex Span_score_bar_engraver@@@code{Span_score_bar_engraver}
3863
3864   @item @code{Staff_group_bar_engraver}
3865 @cindex Staff_group_bar_engraver@@@code{Staff_group_bar_engraver}
3866
3867   @item @code{Staff_margin_engraver}
3868 @cindex Staff_margin_engraver@@@code{Staff_margin_engraver}
3869  @* 
3870     Prints the name of the instrument (specified by
3871     @code{Staff.instrument} and @code{Staff.instr}) at the left of the
3872     staff.
3873
3874   @item @code{Staff_sym_engraver}
3875 @cindex Staff_sym_engraver@@@code{Staff_sym_engraver}
3876
3877   @item @code{Stem_engraver}
3878 @cindex Stem_engraver@@@code{Stem_engraver}
3879  @* 
3880     Engraves stems.  Normally in @code{Voice}.
3881
3882   @item @code{Ties_engraver}
3883 @cindex Ties_engraver@@@code{Ties_engraver}
3884  @* 
3885     Engraves ties.  Normally in @code{Voice}.
3886
3887   @item @code{Time_signature_engraver}
3888 @cindex Time_signature_engraver@@@code{Time_signature_engraver}
3889  @* 
3890     Engraves the time signature.  Normally in @code{Staff} and
3891     @code{RhythmicStaff}.
3892
3893   @item @code{Timing_engraver}
3894 @cindex Timing_engraver@@@code{Timing_engraver}
3895  @* 
3896     Responsible for synchronizing timing information from staffs. 
3897     Normally in @code{Score}.  In order to create polyrhythmic music,
3898     this engraver should be removed from @code{Score} and placed in
3899     @code{Staff}.
3900
3901   @item @code{Tuplet_engraver}
3902 @cindex Tuplet_engraver@@@code{Tuplet_engraver}
3903  @* 
3904     Engraves tuplet brackets?  In @code{Staff}.
3905
3906   @item @code{Vertical_align_engraver}
3907 @cindex Vertical_align_engraver@@@code{Vertical_align_engraver}
3908  
3909 @end table
3910
3911
3912
3913 @node Sound output, midilist, engravers, LilyPond 1-2-0 Reference Manual
3914 @section Sound output
3915
3916
3917
3918 The MIDI block is analogous to the paper block, but it is simpler.
3919 The @code{\midi} block can contain:
3920 @cindex MIDI block
3921
3922 @itemize @bullet
3923   @item  a @code{\tempo} definition
3924   @item  context definitions
3925 @end itemize
3926
3927 Assignments in the @code{\midi} block are not allowed.
3928
3929
3930
3931 @cindex context definition
3932
3933 Context definitions follow precisely the same syntax as within the
3934 \paper block.  Translation modules for sound are called performers.
3935 The contexts for MIDI output are defined in @file{ly/performer.ly}.
3936
3937
3938
3939 @cindex MIDI instrument names
3940
3941 @node midilist, Pre-defined Identifiers, Sound output, LilyPond 1-2-0 Reference Manual
3942
3943 The MIDI instrument name is set by the
3944 @code{Staff.midiInstrument}
3945 @cindex Staff.midiInstrument@@@code{Staff.midiInstrument}
3946  property or, if that property is
3947 not set, the @code{Staff.instrument}
3948 @cindex Staff.instrument@@@code{Staff.instrument}
3949  property.  The instrument
3950 name should be chosen from the following list.  If the selected
3951 string does not exactly match, then LilyPond uses the default piano.
3952
3953
3954 @quotation
3955
3956 @example 
3957 "acoustic grand"            "contrabass"           "lead 7 (fifths)"
3958 "bright acoustic"           "tremolo strings"      "lead 8 (bass+lead)"
3959 "electric grand"            "pizzicato strings"    "pad 1 (new age)"
3960 "honky-tonk"                "orchestral strings"   "pad 2 (warm)"
3961 "electric piano 1"          "timpani"              "pad 3 (polysynth)"
3962 "electric piano 2"          "string ensemble 1"    "pad 4 (choir)"
3963 "harpsichord"               "string ensemble 2"    "pad 5 (bowed)"
3964 "clav"                      "synthstrings 1"       "pad 6 (metallic)"
3965 "celesta"                   "synthstrings 2"       "pad 7 (halo)"
3966 "glockenspiel"              "choir aahs"           "pad 8 (sweep)"
3967 "music box"                 "voice oohs"           "fx 1 (rain)"
3968 "vibraphone"                "synth voice"          "fx 2 (soundtrack)"
3969 "marimba"                   "orchestra hit"        "fx 3 (crystal)"
3970 "xylophone"                 "trumpet"              "fx 4 (atmosphere)"
3971 "tubular bells"             "trombone"             "fx 5 (brightness)"
3972 "dulcimer"                  "tuba"                 "fx 6 (goblins)"
3973 "drawbar organ"             "muted trumpet"        "fx 7 (echoes)"
3974 "percussive organ"          "french horn"          "fx 8 (sci-fi)"
3975 "rock organ"                "brass section"        "sitar"
3976 "church organ"              "synthbrass 1"         "banjo"
3977 "reed organ"                "synthbrass 2"         "shamisen"
3978 "accordion"                 "soprano sax"          "koto"
3979 "harmonica"                 "alto sax"             "kalimba"
3980 "concertina"                "tenor sax"            "bagpipe"
3981 "acoustic guitar (nylon)"   "baritone sax"         "fiddle"
3982 "acoustic guitar (steel)"   "oboe"                 "shanai"
3983 "electric guitar (jazz)"    "english horn"         "tinkle bell"
3984 "electric guitar (clean)"   "bassoon"              "agogo"
3985 "electric guitar (muted)"   "clarinet"             "steel drums"
3986 "overdriven guitar"         "piccolo"              "woodblock"
3987 "distorted guitar"          "flute"                "taiko drum"
3988 "guitar harmonics"          "recorder"             "melodic tom"
3989 "acoustic bass"             "pan flute"            "synth drum"
3990 "electric bass (finger)"    "blown bottle"         "reverse cymbal"
3991 "electric bass (pick)"      "skakuhachi"           "guitar fret noise"
3992 "fretless bass"             "whistle"              "breath noise"
3993 "slap bass 1"               "ocarina"              "seashore"
3994 "slap bass 2"               "lead 1 (square)"      "bird tweet"
3995 "synth bass 1"              "lead 2 (sawtooth)"    "telephone ring"
3996 "synth bass 2"              "lead 3 (calliope)"    "helicopter"
3997 "violin"                    "lead 4 (chiff)"       "applause"
3998 "viola"                     "lead 5 (charang)"     "gunshot"
3999 "cello"                     "lead 6 (voice)" 
4000 @end example 
4001
4002 @end quotation
4003
4004
4005 @cindex MIDI types and performers
4006
4007 The types available for  MIDI translators are:
4008
4009 @table @samp
4010   @item @code{Performer_group_performer}
4011 @cindex Performer_group_performer@@@code{Performer_group_performer}
4012
4013   @item @code{Score_performer}
4014 @cindex Score_performer@@@code{Score_performer}
4015
4016   @item @code{Staff_performer}
4017 @cindex Staff_performer@@@code{Staff_performer}
4018
4019 @end table
4020
4021 The performers for MIDI translators are:
4022
4023 @table @samp
4024   @item @code{Key_performer}
4025 @cindex Key_performer@@@code{Key_performer}
4026
4027   @item @code{Time_signature_performer}
4028 @cindex Time_signature_performer@@@code{Time_signature_performer}
4029
4030   @item @code{Note_performer}
4031 @cindex Note_performer@@@code{Note_performer}
4032
4033   @item @code{Lyric_performer}
4034 @cindex Lyric_performer@@@code{Lyric_performer}
4035
4036   @item @code{Swallow_performer}
4037 @cindex Swallow_performer@@@code{Swallow_performer}
4038
4039 @end table
4040
4041
4042
4043 @node Pre-defined Identifiers, ident, midilist, LilyPond 1-2-0 Reference Manual
4044 @section Pre-defined Identifiers
4045
4046 @cindex pre-defined identifiers
4047
4048 @node ident, Running LilyPond, Pre-defined Identifiers, LilyPond 1-2-0 Reference Manual
4049
4050 Various identifiers are defined in the initialization files to
4051 provide shorthands for some settings.  Most of them are in
4052 @file{ly/declarations.ly}.
4053
4054 @table @samp
4055   @item @code{\break}
4056 @cindex break@@@code{\break}
4057  @* 
4058     Force a line break in music by using a large argument for the
4059     keyword @code{\penalty}.
4060
4061   @item @code{\center}
4062 @cindex center@@@code{\center}
4063  @* 
4064     Used for setting direction  properties.  Equals 0.
4065
4066   @item @code{\down}
4067 @cindex down@@@code{\down}
4068  @* 
4069     Used for setting direction setting properties.  Is equal
4070     to -1.
4071
4072   @item @code{\free}
4073 @cindex free@@@code{\free}
4074  @* 
4075     Used for setting direction setting properties.  Is equal
4076     to 0.
4077
4078   @item @code{\left}
4079 @cindex left@@@code{\left}
4080  @* 
4081     Used for setting text alignment property.  Is equal to -1.
4082
4083   @item @code{\nobreak}
4084 @cindex nobreak@@@code{\nobreak}
4085  @* 
4086     Prevent a line break in music by using a large negative argument
4087     for the keyword @code{\penalty}.
4088
4089   @item @code{\none}
4090 @cindex none@@@code{\none}
4091  @* 
4092     Used for setting @code{Score.beamslopedamping} and
4093     @code{Score.beamquantisation} properties.  Is equal to 0.
4094
4095   @item @code{\normal}
4096 @cindex normal@@@code{\normal}
4097  @* 
4098     Used for setting @code{Score.beamslopedamping} and
4099     @code{Score.beamquantisation} properties.  Is equal to 1.
4100
4101   @item @code{\normalkey}
4102 @cindex normalkey@@@code{\normalkey}
4103  @* 
4104     Select normal key signatures where each octave has the same key
4105     signature.  This sets the @code{Staff.keyoctaviation} property.
4106
4107   @item @code{\right}
4108 @cindex right@@@code{\right}
4109  @* 
4110     Used for setting text alignment property.  Is set to 1.
4111
4112   @item @code{\shiftoff}
4113 @cindex shiftoff@@@code{\shiftoff}
4114  @* 
4115     Disable horizontal shifting of note heads that collide.  Sets the
4116     @code{Voice.horizontalNoteShift} property.
4117
4118   @item @code{\shifton}
4119 @cindex shifton@@@code{\shifton}
4120  @* 
4121     Enable note heads that collide with other note heads to be
4122     shifted horiztonally.  Sets the @code{Voice.horizontalNoteShift}
4123     property.
4124
4125   @item @code{\slurboth}
4126 @cindex slurboth@@@code{\slurboth}
4127  @* 
4128     Allow slurs to be above or below notes.  This sets the
4129     @code{Voice.slurVerticalDirection} property.
4130
4131   @item @code{\slurdown}
4132 @cindex slurdown@@@code{\slurdown}
4133  @* 
4134     Force slurs to be below notes.  This sets the
4135     @code{Voice.slurVerticalDirection} property.
4136
4137   @item @code{\slurup}
4138 @cindex slurup@@@code{\slurup}
4139  @* 
4140     Force slurs to be above notes.  This sets the
4141     @code{Voice.slurVerticalDirection} property.
4142
4143   @item @code{\specialkey}
4144 @cindex specialkey@@@code{\specialkey}
4145  @* 
4146     Allow key signatures do differ in different octaves.  This sets
4147     the @code{Staff.keyoctaviation} property.
4148
4149   @item @code{\stemboth}
4150 @cindex stemboth@@@code{\stemboth}
4151  @* 
4152     Allow stems, beams, and slurs to point either upwards or
4153     downwards, decided automatically by LilyPond.  This sets the
4154     @code{Voice.verticalDirection} property.
4155
4156   @item @code{\stemdown}
4157 @cindex stemdown@@@code{\stemdown}
4158  @* 
4159     Force stems, beams, and slurs to point down.  This sets the
4160     @code{Voice.verticalDirection} property.
4161
4162   @item @code{\stemup}
4163 @cindex stemup@@@code{\stemup}
4164  @* 
4165     Force stems, beams and slurs to point up.  This sets the
4166     @code{Voice.verticalDirection} property.
4167
4168   @item @code{\traditional}
4169 @cindex traditional@@@code{\traditional}
4170  @* 
4171     Used for setting the @code{Score.beamquantisation} property.  Is
4172     equal to 2.
4173
4174   @item @code{\up}
4175 @cindex up@@@code{\up}
4176  @* 
4177     Used for setting various direction properties.  Is equal
4178     to 1.
4179 @end table
4180
4181
4182
4183 @node Running LilyPond, Top, ident, LilyPond 1-2-0 Reference Manual
4184 @section Running LilyPond
4185
4186 @cindex running LilyPond
4187
4188
4189 When invoked with a filename that has no extension, LilyPond will try
4190 adding `@file{.ly}' as an extension first, then `@file{.fly}' and
4191 finally `@file{.sly}' extension.  If the filename ends with
4192 `@file{.fly}', LilyPond processes the file as music using
4193 `@file{init.fly}'.  In this case, LilyPond does something like:
4194
4195 @quotation
4196
4197 @example 
4198 \score @{
4199   \notes\relative c @{
4200     \input "yourfile.fly"
4201   @}
4202   \paper@{@}
4203   \midi@{@}
4204 @} 
4205 @end example 
4206
4207 @end quotation
4208
4209 The result of `@file{.sly}' is similar except that a single unjustified
4210 line is produced.
4211
4212 If you invoke LilyPond with a file `@file{foo.}' that doesn't
4213 have the `@file{.ly}' extension, then LilyPond will look for a file
4214 called `@file{init.}' and process this file.  The file
4215 `@file{init.}' must contain the @code{\maininput} keyword or
4216 LilyPond will not read the user specified file.
4217
4218 When LilyPond processes @file{filename.ly} it will produce
4219 @file{filename.tex} as output.  If @file{filename.ly} contains a second
4220 @code{\paper} keyword, then LilyPond will produce @file{filename-1.tex}
4221 as well.  Subsequent @code{\paper} keywords will produce sequentially
4222 numbered file names.  Several files can be specified; they will each
4223 be processed independently.@footnote{Not entirely true: The status of
4224 GUILE is kept.}
4225
4226
4227
4228 @bye