]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/refman.itely
3806e59c091ce14c2053a2d1f819d9c9ea76a626
[lilypond.git] / Documentation / user / refman.itely
1 @c -*-texinfo-*-
2
3 @node Reference Manual
4 @chapter Reference Manual
5
6 @menu
7 * Overview::                       Overview
8 * Top level::                      Top level
9 * Pitch names::                    Pitch names
10 * Lexical conventions::            Lexical conventions
11 * Other languages::                Note names in various languages
12 * Lexical modes::                          modes
13 * Types::                          Types
14 * Assignments::                    Assignments 
15 * Music expressions::              Music expressions
16 * Atomic music expressions::       Atomic music expressions
17 * Note specification::             notedesc
18 * barlines::                       barlines
19 * Manual beams::                   Manual beam
20 * stem tremolo::                   tremolo
21 * Compound music expressions::     Compound music expressions
22 * relative::                       relative
23 * Repeats::                        Repeats      
24 * transpose::                      transpose
25 * Ambiguities::                    Ambiguities
26 * Notation conversion specifics::  Notation conversion specifics
27 * Automatic Beaming::              Automatic Beaming
28 * Chord Names::                    Chord Names
29 * lyricprint::                     lyricprint
30 * Notation Contexts::              Notation Contexts
31 * Properties::                     Changing formatting
32 * Page layout::                    Layout
33 * contextdefs::                    contextdefs
34 * Sound output::                   Sound output
35 * midilist::                       midilist
36 * Pre-defined Identifiers::        Pre-defined Identifiers
37 * Point and click::                Quik edit using Point and Click
38 * Interpretation contexts:(lilypond-internals)LilyPond interpretation contexts.
39 * Engravers:(lilypond-internals)LilyPond engravers.
40 * Backend:(lilypond-internals)LilyPond backend.
41 @end menu
42
43
44
45 @node Overview
46 @section Overview
47
48
49 [todo: pedals]
50
51 This document
52 describes the the GNU LilyPond input format This format represents a
53 piece of music in an elegant way, but contains enough information for
54 both automatic typesetting and automatic performances.
55
56 This document has been revised for LilyPond 1.3.125
57
58 [todo: ]
59
60 There are two things to note here. The format contains musical
61 concepts like pitches and durations, instead of symbols and positions:
62 the input format tries to capture the meaning of @emph{music}, and not
63 notation.  Second, the format tries to be @emph{context-free}:
64 a note will sound the same regardless of the current time signature,
65 the key, etc.
66
67 The purpose of LilyPond is explained informally by the term `music
68 typesetter'.  This is not a fully correct name: not only does the
69 program print musical symbols, it also makes esthetic decisions.  All
70 symbols and their placement is @emph{generated} from a high-level musical
71 description.  In other words,  LilyPond would be best
72 described by `music compiler' or `music to notation compiler'.
73
74
75
76 LilyPond input can be classified  into three types:
77 @itemize @bullet
78   @item musical expressions: a musical expression is some combination of
79 rest, notes, lyrics
80   @item output definitions: recipes for translating those musical
81 expressions into performances (MIDI) or graphics (eg. PostScript).
82
83   @item declarations: by declaring and naming musical expressions, you
84 can enter and edit them in manageable chunks.
85 @end itemize
86
87 @node Top level
88 @section Top level
89
90 This section describes what you may enter at top level.
91
92
93 @unnumberedsubsec Score definition
94 @cindex score definition
95
96 The output is generated combining a music expression with an output
97 definition.  A score block has the following syntax:
98
99 @example
100   \score @{ @var{musicexpr} @var{outputdefs} @}
101 @end example
102
103 @var{outputdefs} are zero or more output definitions.  If no output
104 definition is supplied, the default @code{\paper} block will be added.
105
106 @unnumberedsubsec Header definition
107 @cindex headers
108
109 @cindex @code{\header}
110
111 The syntax is
112
113 @example
114   \header @{ @var{key1} = @var{val1};
115 @cindex @code{ly2dvi}
116              @var{key2} = @var{val2}; @dots{} @}
117 @end example
118
119
120 A header describes the file's contents.  It can also appear in a
121 @code{\score} block.  Tools like @code{ly2dvi} can use this
122 information for generating titles.  Key values that are used by
123 @code{ly2dvi} are: title, subtitle, composer, opus, poet, instrument,
124 metre, arranger, piece and tagline.
125
126 It is customary to put the @code{\header} at the top of the file.
127
128 @unnumberedsubsec Default output
129
130 A @code{\midi} or @code{\paper} block at top-level sets the default
131 paper block for all scores that lack an explicit paper block.
132
133 @unnumberedsubsec Scheme statements
134
135 Scheme statements maybe issued to produce interesting side-effects. 
136
137
138 @node Pitch names
139 @section Pitch names
140
141
142 @unnumberedsubsec Pitch name definition
143 @cindex pitch names
144
145 @cindex note names
146 @cindex chord modifier names
147
148 Note names and chord modifiers can be customised for nationalities.
149 languages and conventions.  The syntax is as follows.
150 @cindex @code{\pitchnames}
151 @cindex @code{\chordmodifiers}
152
153 @example
154    \pitchnames @var{scheme-alist}
155    \chordmodifiers @var{scheme-alist}
156 @end example
157
158 See @file{ly/nederlands.ly} and @file{ly/chord-modifiers.ly} for
159 specific examples how to do this.  tables can be tailored specified
160 using. Some national note names have been provided, see
161 section @ref{Other languages}.
162 A @code{\paper} block at top level sets the default paper block.  A
163 @code{\midi} block at top level works similarly.
164
165 @unnumberedsubsec Assignments
166 @cindex assignments
167 @cindex @code{#}
168
169 Identifier assignments may appear at top level.  @ref{Assignments}
170
171
172 @node Lexical conventions
173 @section Lexical conventions
174
175 @cindex lexical conventions
176
177
178 @unnumberedsubsec Comments
179
180 @cindex comment
181 @cindex @code{%}
182
183
184 A one line comment is introduced by a @code{%} character. 
185 Block comments are started by @code{%@{} and ended by `@code{%@}}'. 
186 They cannot be nested.
187
188 @unnumberedsubsec Scheme
189
190
191
192
193 @cindex Scheme
194 @cindex GUILE
195 @cindex Scheme, in-line code
196
197
198 LilyPond contains a Scheme interpreter (the GUILE library) for
199 internal use. In some places Scheme expressions also form valid syntax:
200 whereever it is allowed,
201 @example
202   #@var{scheme}
203 @end example
204 evaluates the specified Scheme code. If this is used at toplevel, then
205 the result is discarded. Example:
206 @example
207   \property Staff.TestObject \override #'foobar =  #(+ 1 2)
208 @end example
209
210 @code{\override} expects two Scheme expressions, so there are two Scheme
211 expressions. The first one is a symbol (@code{foobar}), the second one
212 an integer (namely, 3).
213
214 Scheme is a full-blown programming language, and a full discussion is
215 outside the scope of this document. Interested readers are referred to
216 the website @uref{http://www.schemers.org/} for more information on
217 Scheme.
218
219 @unnumberedsubsec Keywords
220 @cindex keyword
221
222
223 Keywords start with a backslash, followed by a number of lower case
224 alphabetic characters.  These are all the keywords.
225
226 @example
227 apply arpeggio autochange spanrequest commandspanrequest
228 simultaneous sequential accepts alternative bar breathe
229 char chordmodifiers chords clef cm consists consistsend
230 context denies duration dynamicscript elementdescriptions
231 font grace header in lyrics key mark pitch
232 time times midi mm name pitchnames notes outputproperty
233 override set revert partial paper penalty property pt
234 relative remove repeat addlyrics partcombine score
235 script stylesheet skip textscript tempo translator
236 transpose type
237 @end example
238
239 @unnumberedsubsec Integers
240
241 @cindex integers
242 @cindex @code{+}
243 @cindex @code{-}
244 @cindex @code{*}
245 @cindex @code{/}
246
247 Formed from an optional minus sign followed by digits.  Arithmetic
248 operations cannot be done with integers, and integers cannot be mixed
249 with reals.
250
251 @unnumberedsubsec Reals
252 @cindex real numbers
253
254
255
256
257
258 Formed from an optional minus sign and a sequence of digits followed
259 by a @emph{required} decimal point and an optional exponent such as
260 @code{-1.2e3}.  Reals can be built up using the usual operations:
261 `@code{+}', `@code{-}', `@code{*}', and
262 `@code{/}', with parentheses for grouping.
263
264 @cindex @code{\mm},
265 @cindex @code{\in}
266 @cindex @code{\cm}
267 @cindex @code{\pt}
268 @cindex dimensions
269
270 A real constant can be followed by one of the dimension keywords:
271 @code{\mm} @code{\pt}, @code{\in}, or @code{\cm}, for millimeters,
272 points, inches and centimeters, respectively.  This converts the number
273 to a real that is the internal representation of dimensions.
274
275
276 @unnumberedsubsec Strings
277 @cindex string
278 @cindex concatenate
279
280 Begins and ends with the @code{"} character.  To include a @code{"}
281 character in a string write @code{\"}.  Various other backslash
282 sequences have special interpretations as in the C language.  A string
283 that contains no spaces can be written without the quotes.  See
284 @ref{Lexical modes} for details on unquoted strings; their interpretation varies
285 depending on the situation.  Strings can be concatenated with the
286 @code{+} operator.
287
288 The tokenizer accepts the following commands. They have no grammatical
289 function, hence they can appear anywhere in the input.
290
291 @unnumberedsubsec Main input
292
293 @cindex @code{\maininput}
294
295 The @code{\maininput} command is used in init files to signal that the
296 user file must be read. This command cannot be used in a user file.
297
298 @unnumberedsubsec File inclusion
299 @cindex @code{\include}
300 @example
301   \include @var{filename}
302 @end example
303
304 Include @var{filename}.  The argument @var{filename} may be a quoted string (an
305 unquoted string will not work here!) or a string identifier.  The full
306 filename including the @file{.ly} extension must be given,
307
308 @unnumberedsubsec Version information 
309 @cindex @code{\version}
310 @example
311   \version @var{string} ;
312 @end example
313
314 Specify the version of LilyPond that a file was written for.  The
315 argument is a version string in quotes, for example @code{"1.2.0"}. 
316 This is used to detect invalid input, and to aid
317 @code{convert-ly}  a tool that automatically upgrades input files. See
318 See @ref{convert-ly} for more information on @code{convert-ly}.
319
320 @cindex convert-ly
321
322
323 @node Lexical modes
324 @section Lexical modes
325 @cindex Lexical modes
326 @cindex modes
327
328
329 To simplify entering notes, lyrics, and chords, LilyPond has three
330 special input modes on top of the default mode.  In each mode, words
331 are identified on the input.  If @code{"word"} is encountered, it is
332 treated as a string.  If @code{\word} is encountered, it is treated as
333 a keyword or as an identifier.  The behavior of the modes differs in
334 two ways: Different modes treat unquoted words differently, and
335 different modes have different rules for deciding what is a word.
336
337 @table  @asis
338 @item Normal mode.
339 @cindex normal mode
340  
341 At the start of parsing, LilyPond is in Normal mode.  In Normal
342 mode, a word is an alphabetic character followed by alphanumeric
343 characters.  If @code{word} is encountered on the input it is
344 treated as a string.
345
346 @item Note mode.
347 @cindex note mode
348
349 @cindex @code{\notes}
350 Note mode is introduced by the keyword
351 @code{\notes}.  In Note mode, words can only
352 contain alphabetic characters.  If @code{word} is encountered,
353 LilyPond first checks for a notename of @code{word}.  If no
354 notename is found, then @code{word} is treated as a string.
355
356 Since combinations of numbers and dots are used for indicating
357 durations, it is not possible to enter real numbers in this mode.
358
359 @item Chord mode.
360 @cindex chord mode
361
362 Chord mode is introduced by the keyword
363 @code{\chords}.  It is similar to Note mode, but
364 words are also looked up in a chord modifier table (containing
365 @code{maj}, @code{dim}, etc).
366
367 Since combinations of numbers and dots are used for indicating
368 durations, you can not enter real numbers in this mode.  Dashes
369 and carets are used to indicate chord additions and subtractions,
370 so scripts can not be entered in Chord mode.
371
372 @item Lyrics mode. 
373 @cindex lyric mode
374 @cindex @code{\lyrics}
375
376 Lyrics mode is introduced by the keyword @code{\lyrics}.  This mode has
377 rules that make it easy to include punctuation and diacritical marks in
378 words: The purpose of Lyrics mode is that you can enter lyrics in @TeX{}
379 format or a standard encoding without needing quotes.  The precise
380 definition of this mode is ludicrous, and this will remain so until the
381 authors of LilyPond acquire a deeper understanding of character
382 encoding, or someone else steps up to fix this.
383
384 A word in Lyrics mode begins with: an alphabetic character, @code{_},
385 @code{?}, @code{!}, @code{:}, @code{'}, the control characters @code{^A}
386 through @code{^F}, @code{^Q} through @code{^W}, @code{^Y}, @code{^^},
387 any 8-bit character with ASCII code over 127, or a two-character
388 combination of a backslash followed by one of @code{`}, @code{'},
389 @code{"}, or @code{^}.
390
391 Subsequent characters of a word can be any character that is not a digit
392 and not white space.  One important consequence of this is that a word
393 can end with `@code{@}}', which may be confusing. However, LilyPond will
394 issue a warning.  Any @code{_} character which appears in an unquoted
395 word is converted to a space.  This provides a mechanism for introducing
396 spaces into words without using quotes.  Quoted words can also be used
397 in Lyrics mode to specify words that cannot be written with the above
398 rules.  Here are some examples.  Not all of these words are printable by
399 @TeX{}.
400
401 @example 
402 Ah!             % a word
403 2B_||_!2B       % not a word because it starts with a digit
404 ``Hello''       % not a word because it starts with `
405 _ _ _ _         % 4 words, each one a space 
406 @end example 
407
408 Since combinations of numbers and dots are used for indicating
409 durations, you can not enter real numbers in this mode.
410 @end table
411
412 [todo: include short table showing differences] 
413
414 @node Types
415 @section Types
416
417 @cindex  Identifiers
418
419 All of the information in a LilyPond input file, is represented as a
420 Scheme value. In addition to normal Scheme data types (such as pair,
421 number, boolean, etc.), LilyPond has a number of specialized data types,
422
423 @itemize @bullet
424 @item Input
425 @item c++-function
426 @item Music: see @ref{Music expressions}
427 @item Identifier
428 @item Translator_def:
429 See section @ref{contextdefs} for more information
430 @item Duration
431 @item Pitch
432 @item Score
433 @item Music_output_def
434 @item Moment (rational number)
435 @end itemize
436
437 LilyPond also includes some transient object types. Objects of these
438 types are built during a LilyPond run, and do not `exist' per se within
439 your input file. These objects are created as a result of your input
440 file, so you can include commands in the input to manipulate them,
441 during a lilypond run.
442
443 @itemize @bullet
444 @item Grob: short for Graphical object. See @ref{Grobs}. 
445 @item Molecule: device-independent page output object,
446 including dimensions.  Produced by some Grob functions
447 See @ref{Molecules}
448 @item Translator: object that produces audio objects or Grobs. This is
449 not yet user accessible.
450 @item Font_metric: object representing a font. (See @ref{Font metrics})
451 @c  @item Audio_element: (todo,  smobme)
452 @end itemize
453
454 @node Assignments
455 @unnumberedsubsec Assignments
456
457 Identifiers allow objects to be assigned to names during the parse
458 stage.  To assign an identifier, you use @var{name}@code{=}@var{value}
459 and to refer to an identifier, you preceed its name with a backslash:
460 `@code{\}@var{name}'.  @var{value} is any valid Scheme value or any of
461 the input-types listed above.  Identifier assignments can appear at top
462 level in the LilyPond file, but also in @code{\paper} blocks.
463
464 Semicolons are forbidden after top level assignments, but mandatory in
465 other places. The rules about semicolons and assignments are very
466 confusing, but when LilyPond input evolves more towards Scheme, we hope
467 that this problem will grow smaller.
468
469 An identifier can be created with any string for its name, but you will
470 only be able to refer to identifiers whose names begin with a letter,
471 being entirely alphanumeric.  It is impossible to refer to an identifier
472 whose name is the same as the name of a keyword.
473
474 The right hand side of an identifier assignment is parsed completely
475 before the assignment is done, so it is allowed to redefine an
476 identifier in terms of its old value, e.g.
477
478 @example
479 foo = \foo * 2.0
480 @end example
481
482 When an identifier is referenced, the information it points to is
483 copied.  For this reason, an identifier reference must always be the
484 first item in a block.
485 @example
486 \paper  @{
487 foo = 1.0
488 \paperIdent % wrong and invalid
489 @}
490
491 \paper @{
492 \paperIdent % correct
493 foo = 1.0
494 @}
495 @end example
496
497
498 @node Music expressions
499 @section Music expressions
500
501 @cindex music expressions
502
503 Music in LilyPond is entered as a music expression.  Notes, rests,
504 lyric syllables are music expressions (the atomic
505 expressions),
506 @cindex atomic music expressions
507 and you can combine music expressions to form new ones.  This example
508 forms a compound expressions out of the quarter @code{c} note and a
509 @code{d} note:
510
511 @example 
512 \sequential @{ c4 d4 @} 
513 @end example 
514
515 The meaning of this compound expression is to play the @code{c}
516 first, and then the @code{d} (as opposed to playing them
517 simultaneously, for instance).
518
519 Atomic music expression are discussed in
520 subsection @ref{Atomic music expressions}.  Compound music expressions are
521 discussed in subsection @ref{Compound music expressions}.
522
523
524
525 @node Atomic music expressions
526 @section Atomic music expressions
527
528
529
530
531 @cindex pitch
532
533 The syntax for pitch specification is
534
535 @cindex @code{\pitch}
536 @example
537   \pitch @var{scmpitch}
538 @end example
539
540 @var{scmpitch} is a pitch scheme object, see @ref{Pitch}.
541
542 In Note and Chord mode, pitches may be designated by names.  See
543 section @ref{Other languages} for pitch names in different languages.
544
545 @cindex duration
546 @cindex @code{\duration}
547
548 The syntax for duration specification is
549 @example
550  \duration @var{scmduration}
551 @end example
552
553 In Note, Chord, and Lyrics mode, durations may be designated by
554 numbers and dots.  
555
556
557 @node Note specification
558 @section Note specification
559 @cindex Note specification
560
561 @cindex pitches
562
563 @cindex entering notes
564
565 A note specification has the form
566
567 @example
568   @var{pitch}[@var{octavespec}][!][?][@var{duration}]
569 @end example
570
571 The pitch of the note is specified by the note's name.
572
573
574 The default names are the Dutch note names.  The notes are specified
575 by the letters @code{c} through @code{b}, where @code{c} is an
576 octave below middle C and the letters span the octave above that C. 
577 In Dutch,
578 @cindex note names, Dutch
579 a sharp is formed by adding @code{-is} to the end of a pitch name.  A
580 flat is formed by adding @code{-es}. Double sharps and double flats are
581 obtained by adding @code{-isis} or @code{-eses}.  @code{aes} and
582 @code{ees} are contracted to @code{as} and @code{es} in Dutch, but both
583 forms will be accepted.
584
585 LilyPond has predefined sets of notenames for various other languages.
586 To use them, simply include the language specific init file.  For
587 example: @code{\include "english.ly"}.  The available language files and
588 the names they define are:
589
590 @example 
591                         Note Names               sharp       flat
592 nederlands.ly  c   d   e   f   g   a   bes b   -is         -es
593 english.ly     c   d   e   f   g   a   bf  b   -s/-sharp   -f/-flat
594 deutsch.ly     c   d   e   f   g   a   b   h   -is         -es
595 norsk.ly       c   d   e   f   g   a   b   h   -iss/-is    -ess/-es
596 svenska.ly     c   d   e   f   g   a   b   h   -iss        -ess
597 italiano.ly    do  re  mi  fa  sol la  sib si  -d          -b
598 catalan.ly     do  re  mi  fa  sol la  sib si  -d/-s       -b 
599 @end example 
600 @cindex @code{'}
601 @cindex @code{,}
602
603 Pitch names can be redefined using the @code{\pitchnames} command, see
604 @ref{Pitch names}.
605
606
607
608
609 The optional octave specification takes the form of a series of
610 single quote (`@code{'}') characters or a series of comma
611 (`@code{,}') characters.  Each @code{'} raises the pitch by one
612 octave; each @code{,} lowers the pitch by an octave.
613
614 @lilypond[fragment,verbatim,center]
615   c' d' e' f' g' a' b' c''
616 @end lilypond
617
618 @lilypond[fragment,verbatim,center]
619   cis' dis' eis' fis' gis' ais' bis'
620 @end lilypond
621
622 @lilypond[fragment,verbatim,center]
623   ces' des' es' fes' ges' as' bes'
624 @end lilypond
625
626 @lilypond[fragment,verbatim,center]
627   cisis' eisis' gisis' aisis' beses'
628 @end lilypond
629
630 @lilypond[fragment,verbatim,center]
631   ceses' eses' geses' ases' beses'
632 @end lilypond
633
634 LilyPond will determine what accidentals to typeset depending on the key
635 and context, so alteration refer to what note is heard, not to whether
636 accidentals are printed.  A reminder accidental
637 @cindex reminder accidental
638 @cindex @code{?}
639 can be forced by adding an exclamation mark @code{!} after the pitch.
640 A cautionary accidental,
641 @cindex cautionary accidental
642
643 i.e., an accidental within parentheses can be obtained by adding the
644 question mark `@code{?}' after the pitch.
645
646 @lilypond[fragment,verbatim,center]
647   cis' d' e' cis'  c'? d' e' c'!
648 @end lilypond
649
650
651 @cindex duration
652
653 Durations are entered as their reciprocal values.  For notes longer
654 than a whole note, use identifiers.
655
656 @quotation
657
658 @example 
659 c'\longa c'\breve  
660 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64 
661 r\longa r\breve  
662 r1 r2 r4 r8 r16 r32 r64 r64 
663 @end example 
664
665
666 @lilypond[]
667 \score {
668   \notes \relative c'' {
669     a\longa a\breve  \autoBeamOff
670     a1 a2 a4 a8 a16 a32 a64 a64 
671     r\longa r\breve  
672     r1 r2 r4 r8 r16 r32 r64 r64 
673   }
674   \paper {
675     \translator {
676       \StaffContext
677         \remove "Clef_engraver";
678         \remove "Staff_symbol_engraver";
679         \remove "Time_signature_engraver";
680         \consists "Pitch_squash_engraver";
681     }
682   }
683 }
684 @end lilypond
685 @end quotation
686
687 As you  can see, the longa is not printed. To get a longa note head, you
688 have to use a different style of note heads. See [TODO].
689
690 @cindex @code{.}
691
692
693 If the duration is omitted then it is set equal to the previous duration
694 entered.  At the start of parsing there is no previous duration, so then
695 a quarter note is assumed.  The duration can be followed by a dot
696 (`@code{.}')  to obtain dotted note lengths.
697
698 Rests are entered like notes, with note name `@code{r}'.
699 There is also a note name
700 `@code{s}', which produces a space of the specified
701 duration.
702
703
704 @lilypond[fragment,verbatim,center]
705   a'4. b'4.
706 @end lilypond
707 @cindex @code{r}
708 @cindex @code{s}
709
710 You can alter the length of duration by writing `@code{*}@var{fraction}'
711 after it.  This will not affect the appearance of note heads or rests.
712
713 @unnumberedsubsec Multi measure rests
714
715 @cindex @code{R}
716
717 Multi_measure_rest are entered using `@code{R}'. It is specifically
718 meant for entering parts: the rest can expand to fill a score with
719 rests, or it can be printed as a single multimeasure rest This expansion
720 is controlled by the property @code{Score.skipBars}. If this is set to true,
721 Lily will not expand empty measures, and the multimeasure rests
722 automatically adds the appropriate number.
723
724 @lilypond[fragment]
725  \time 3/4; R2.*2 \property Score.skipBars = ##t R2.*17  R2.*4
726 @end lilypond
727
728 Note that there is currently no way to condense multiple rests into a
729 single multimeasure rest.
730
731
732 @unnumberedsubsec Lyrics
733 @cindex lyrics expressions
734
735 Syllables are entered like notes, with pitches replaced by text.  For
736 example, @code{Twin-4 kle4 twin-4 kle4} enters four syllables, each
737 with quarter note duration.  Note that the hyphen has no special
738 meaning for lyrics, and does not introduce special symbols.  See
739 section @ref{Lexical modes} for a description of what is interpreted as
740 lyrics.
741
742 Spaces can be introduced into a lyric either by using quotes
743 (@code{"}) or by using an underscore without quotes: @code{He_could4
744 not4}.  All unquoted underscores are converted to spaces.  Printing
745 lyrics is discussed in section @ref{lyricprint}.
746
747 [explain automatic phrasing]
748
749 @cindex properties
750 @unnumberedsubsec Translation property
751
752 @cindex @code{\property}
753 @example
754   \property @var{contextname}.@var{propname} =  @var{value}
755 @end example
756
757 Sets the @var{propname} property of the context @var{contextname} to
758 the specified @var{value}.  All three arguments are strings. 
759 Depending on the context, it may be necessary to quote the strings or
760 to leave space on both sides of the dot.
761
762 @cindex translator switches
763 @unnumberedsubsec Translator switches
764
765 @cindex @code{\translator}
766 @example
767   \translator @var{contexttype} = @var{name}
768 @end example
769
770 A music expression indicating that the context which is a direct
771 child of the a context of type @var{contexttype} should be shifted to
772 a context of type @var{contexttype} and the specified name.
773
774 Usually this is used to switch staffs in Piano music, e.g.
775
776 @example
777   \translator Staff = top @var{Music}
778 @end example
779
780
781 @cindex output properties
782 @unnumberedsubsec Output properties
783
784 These allow you to tweak what is happening in the back-end
785 directly. If you want to control every detail of the output
786 formatting, this is the feature to use. The downside to this is that
787 you need to know exactly how the backend works. Example:
788
789
790 @lilypond[fragment,verbatim]
791 \relative c'' { c4
792         \context Staff \outputproperty
793                 #(make-type-checker 'note-head-interface)
794                 #'extra-offset = #'(5.0 . 7.5)
795 <c8 e g> }
796 @end lilypond
797
798 This selects all note heads occurring at current staff level, and sets
799 the @code{extra-offset} of those heads to @code{(5,7.5)}, shifting them
800 up and right.
801
802 Use of this feature is entirely on your own risk: if you use this, the
803 result will depend very heavily on the implementation of the backend,
804 which we change regularly and unscrupulously.
805
806 @unnumberedsubsec Key signature
807 @cindex @code{\key}
808
809 @example
810   @code{\key} @var{pitch} @var{type} @code{;}
811 @end example
812 @cindex @code{\minor}
813 @cindex @code{\major}
814 @cindex @code{\minor}
815 @cindex @code{\ionian}
816 @cindex @code{\locrian}
817 @cindex @code{\aeolian}
818 @cindex @code{\mixolydian}
819 @cindex @code{\lydian}
820 @cindex @code{\phrygian}
821 @cindex @code{\dorian}
822
823 Change the key signature.  @var{type} should be @code{\major} or
824 @code{\minor} to get @var{pitch}-major or @var{pitch}-minor,
825 respectively.  The second argument is optional; the default is major
826 keys.  The @var{\context} argument can also be given as an integer,
827 which tells the number of semitones that should be added to the pitch
828 given in the subsequent @code{\key} commands to get the corresponding
829 major key, e.g., @code{\minor} is defined as 3.  The standard mode names
830 @code{\ionian}, @code{\locrian}, @code{\aeolian}, @code{\mixolydian},
831 @code{\lydian}, @code{\phrygian}, and @code{\dorian} are also defined.
832
833 @unnumberedsubsec Rehearsal marks
834 @cindex rehearsal marks
835 @cindex mark
836 @cindex @code{\mark}
837 @example
838   \mark @var{unsigned};
839 @cindex @code{Mark_engraver}
840   \mark @var{string};
841 @end example
842
843 Prints a mark over or under the staff.  
844
845 @unnumberedsubsec barlines
846
847 @cindex @code{\bar}
848 @cindex measure lines
849 @cindex repeat bars
850
851 @example
852   \bar @var{bartype};
853 @end example
854
855 This is a short-cut for doing
856 @example
857   \property Score.whichBar = @var{bartype} 
858 @end example
859
860 You are encouraged to use @code{\repeat} for repetitions.  See
861 @ref{Repeats}, and the documentation of @code{whichBar} in
862 @ref{(lilypond-internals)LilyPond context properties}.
863
864 [FIXME]
865
866 @unnumberedsubsec Time signature
867 @cindex meter
868 @cindex time signature
869 @cindex @code{\time}
870 @example
871   \time @var{numerator}@code{/}@var{denominator} @code{;}
872 @end example
873
874 A short-cut for doing
875 @example
876      \property Score.timeSignatureFraction = #'(@var{numerator} . @var{denominator})
877 @end example
878
879 See the documentation of @code{timeSignatureFraction}
880
881 @unnumberedsubsec Tempo
882 @cindex beats per minute
883 @cindex metronome marking
884 @cindex @code{\tempo}
885 @example
886   \tempo @var{duration} = @var{perminute} @code{;}
887 @end example
888
889 Used to specify the tempo.  For example, @code{\tempo 4 = 76;} requests
890 output with 76 quarter notes per minute.
891
892 @unnumberedsubsec Partial measures
893 @cindex anacrusis
894 @cindex upstep
895 @cindex partial measure
896 @cindex measure, partial
897 @cindex shorten measures
898 @cindex @code{\partial}
899 @example
900   \partial @var{duration} @code{;}
901 @end example
902
903 Short cut for 
904
905 @example
906   \property Score.measurePosition = @var{length of duration}
907 @end example
908 @cindex @code{|}
909
910 See the documentation of @code{measurePosition}.
911
912 @unnumberedsubsec Bar check
913
914 @cindex bar check
915 @cindex @code{barCheckNoSynchronize}
916 @cindex @code{|}
917
918
919 Bar checks help you find errors in the input: Whenever one is
920 encountered during interpretation, a warning message is issued if it
921 doesn't fall at a measure boundary.  Depending on the value of
922 @code{barCheckNoSynchronize},  the beginning of the measure will be
923 relocated, so this can also be used to shorten measures.
924
925 A bar check is entered using the bar symbol, @code{|}
926
927 This can help you finding errors in the input.
928
929 @unnumberedsubsec Line break penalty.
930 @cindex @code{\penalty}
931
932 @example
933   \penalty @var{int} @code{;}
934 @end example
935
936 Discourage or encourage line breaks.  See @ref{Page layout}. 
937
938 @unnumberedsubsec Clef change
939 @cindex @code{\clef}
940 @example
941   \clef @var{clefname} @code{;}
942 @end example
943
944 Short-cut for
945
946 @example
947   \property Clef.clefGlyph = @var{symbol associated with clefname} 
948   \property Clef.clefPosition = @var{clef Y-position for clefname}
949   \property Clef.clefOctavation = @var{extra pitch of clefname}
950 @end example
951
952 Supported clef-names include 
953
954 [todo]
955
956 @unnumberedsubsec Skip
957 @example
958   \skip @var{duration} @code{;}
959 @end example
960 @cindex @code{\skip}
961
962 Skips the amount of time specified by @var{duration}.  If no other
963 music is played, a gap will be left for the skipped time with no
964 notes printed.  It works in Note Mode or Lyrics Mode.  In Note mode,
965 this has the same effect as the spacer rest.
966
967
968 @node Manual beams
969 @unnumberedsubsec Manual beams
970
971 @cindex beams, manual
972 @cindex @code{]}
973 @cindex @code{[}
974
975 A beam is specified by surrounding the beamed notes with brackets
976 `@code{[}' and `@code{]}'.  
977
978 @lilypond[fragment,verbatim,center]
979   [a'8 a'] [a'16 a' a' a']
980   [a'16 <a' c''> c'' <a' c''>]
981   \times 2/3 { [e'8 f' g'] }
982 @end lilypond
983
984 Beaming can be generated automatically; see section @ref{Automatic Beaming}.
985
986 @cindex @code{-}@code{-}
987
988 @unnumberedsubsec Lyric extender
989 @cindex extender
990 @cindex lyric extender
991 @cindex hyphen
992
993 The syntax for an extender mark is @code{__}.  This syntax can only
994 be used within lyrics mode.
995
996 @unnumberedsubsec Lyric hyphens
997
998 The syntax for a spanning hyphen (i.e., a hyphen that will be printed
999 between two lyric syllables) is `@code{-}@code{-}'.
1000
1001
1002 @unnumberedsubsec Ties
1003 @cindex ties
1004 @cindex @code{~}
1005
1006 A tie connects two adjacent note heads of the same pitch.  When used
1007 with chords, it connects all of the note heads whose pitches match.
1008 Ties are indicated using the tilde symbol `@code{~}'.
1009 If you try to tie together chords which have no common pitches, a
1010 warning message will appear and no ties will be created.
1011
1012 @lilypond[fragment,verbatim,center]
1013   e' ~ e' <c' e' g'> ~ <c' e' g'>
1014 @end lilypond
1015
1016 [sparseTies]
1017
1018 @unnumberedsubsec Articulation
1019 @cindex articulations
1020 @cindex scripts
1021 @cindex ornaments
1022
1023 A variety of symbols can appear above and below notes to indicate
1024 different characteristics of the performance.  These symbols can be
1025 added to a note with `@var{note}@code{-\}@var{name}'.  Numerous symbols
1026 are defined in @file{script.ly} and @file{script.scm}.  Symbols can be
1027 forced to appear above or below the note by writing
1028 `@var{note}@code{^\}@var{name}' and `@var{note}@code{_\}@var{name}'
1029 respectively.  Here is a chart showing symbols above notes, with the
1030 name of the corresponding symbol appearing underneath.
1031
1032 @lilypond[]
1033
1034   \score {
1035     < \notes {
1036         \property Score.LyricSyllable \override #'font-family =
1037 #'typewriter
1038         \property Score.LyricSyllable \override #'font-shape = #'upright
1039         c''-\accent      c''-\marcato      c''-\staccatissimo c''-\fermata 
1040         c''-\stopped     c''-\staccato     c''-\tenuto        c''-\upbow
1041         c''-\downbow     c''^\lheel        c''-\rheel         c''^\ltoe
1042         c''-\rtoe        c''-\turn         c''-\open          c''-\flageolet
1043         c''-\reverseturn c''-\trill        c''-\prall         c''-\mordent
1044         c''-\prallprall  c''-\prallmordent c''-\upprall       c''-\downprall
1045         c''-\thumb       c''-\segno        c''-\coda
1046       }
1047       \context Lyrics \lyrics {
1048         accent__      marcato__      staccatissimo__ fermata
1049         stopped__     staccato__     tenuto__        upbow
1050         downbow__     lheel__        rheel__         ltoe
1051         rtoe__        turn__         open__          flageolet
1052         reverseturn__ trill__        prall__         mordent
1053         prallprall__  prallmordent__ uprall__        downprall
1054         thumb__       segno__        coda
1055       }
1056     >
1057     \paper {
1058       linewidth = 5.875\in;          
1059       indent    = 0.0;
1060     }
1061   }
1062
1063 @end lilypond
1064
1065 @unnumberedsubsec Text scripts
1066
1067 In addition, it is possible to place arbitrary strings of text or
1068 @TeX{} above or below notes by using a string instead of an
1069 identifier: @code{c^"text"}.  Fingerings 
1070 can be placed by simply using digits.  All of these note ornaments
1071 appear in the printed output but have no effect on the MIDI rendering of
1072 the music.
1073
1074 @cindex fingering
1075
1076 To save typing, fingering instructions (digits 0 to 9 are
1077 supported) and single characters shorthands exist for a few
1078 common symbols
1079
1080 @lilypond[]
1081   \score {
1082     \notes \context Voice {
1083       \property Voice.TextScript \set #'font-family = #'typewriter
1084       \property Voice.TextScript \set #'font-shape = #'upright
1085       c''4-._"c-."      s4
1086       c''4--_"c-{}-"    s4
1087       c''4-+_"c-+"      s4
1088       c''4-|_"c-|"      s4
1089       c''4->_"c->"      s4
1090       c''4-^_"c-\\^{ }" s4
1091       c''4-1_"c-1"      s4
1092       c''4-2_"c-2"      s4
1093       c''4-3_"c-3"      s4
1094       c''4-4_"c-4"      s4
1095     }
1096     \paper {
1097       linewidth = 5.875 \in;
1098       indent    = 0.0;
1099     }
1100   }
1101
1102 @end lilypond
1103
1104
1105 @cindex @code{\textscript}
1106
1107 @example
1108
1109   \textscript @var{text} @var{style}
1110 @end example
1111
1112 Defines a text to be printed over or under a note.  @var{style} is a
1113 string that may be one of @code{roman}, @code{italic}, @code{typewriter}, 
1114 @code{bold}, @code{Large}, @code{large}, @code{dynamic} or @code{finger}.
1115
1116 You can attach a general textscript request using this syntax:
1117
1118 @quotation
1119
1120 @example 
1121 c4-\textscript "6" "finger"
1122 c4-\textscript "foo" "normal" 
1123 @end example 
1124
1125 @end quotation
1126
1127 This is equivalent to @code{c4-6 c4-"foo"}.  
1128
1129 @cindex @code{\script}
1130 @cindex scripts
1131
1132 @example
1133
1134   \script @var{alias}
1135 @end example
1136 @cindex @code{\script}
1137
1138 Prints a symbol above or below a note.  The argument is a string which
1139 points into the script-alias table defined in @file{scm/script.scm}, for
1140 information on how to add scripts, read the comments in that file.
1141 Usually the @code{\script} keyword is not used directly.  Various
1142 helpful identifier definitions appear in @file{script.ly}.
1143
1144
1145
1146 @unnumberedsubsec Dynamics
1147
1148 @cindex @code{\ppp}
1149 @cindex @code{\pp}
1150 @cindex @code{\p}
1151 @cindex @code{\mp}
1152 @cindex @code{\mf}
1153 @cindex @code{\f}
1154 @cindex @code{\ff}
1155 @cindex @code{\fff}
1156 @cindex @code{\ffff}
1157 @cindex @code{\fp}
1158 @cindex @code{\sf}
1159 @cindex @code{\sff}
1160 @cindex @code{\sp}
1161 @cindex @code{\spp}
1162 @cindex @code{\sfz}
1163 @cindex @code{\rfz}
1164 @cindex crescendo
1165 @cindex @code{\cr}
1166 @cindex @code{\rc}
1167 @cindex @code{\decr}
1168 @cindex @code{\rced}
1169 @cindex @code{\<}
1170 @cindex @code{\>}
1171 @cindex @code{\"!}
1172
1173 Dynamic marks are specified by using an identifier after a note:
1174 @code{c4-\ff} (the dash is optional for dynamics: `@code{c4 \ff})'.  
1175 The available dynamic marks are:
1176 @code{\ppp},
1177 @code{\pp}, @code{\p}, @code{\mp},
1178 @code{\mf}, @code{\f}, @code{\ff},
1179 @code{\fff}, @code{\fff},
1180 @code{\fp}, @code{\sf},
1181 @code{\sff}, @code{\sp},
1182 @code{\spp}, @code{\sfz}, and
1183 @code{\rfz}.
1184
1185
1186 A crescendo mark is started with @code{\cr} and terminated with
1187 @code{\rc}, the textual reverse of @code{cr}.  A decrescendo mark is
1188 started with @code{\decr} and terminated with @code{\rced}.  There are
1189 also shorthands for these marks.  A crescendo can be started with
1190 @code{\<} and a decrescendo can be started with @code{\>}.  Either one
1191 can be terminated with @code{\!}.  Note that @code{\!}  must go before
1192 the last note of the dynamic mark whereas @code{\rc} and @code{\rced} go
1193 after the last note.  Because these marks are bound to notes, if you
1194 want to get several marks during one note, you must use spacer notes.
1195
1196 @lilypond[fragment,verbatim,center]
1197   c'' \< \! c''   d'' \decr e'' \rced 
1198   < f''1 { s4 \< \! s2 \> \! s4 } >
1199 @end lilypond
1200
1201 [todo: text cr] 
1202
1203 @unnumberedsubsec Slurs
1204 @cindex slur
1205
1206 Slurs connects chords and try to avoid crossing stems.  A slur is
1207 started with @code{(} and stopped with @code{)}.  The
1208 starting @code{(} appears to the right of the first note in
1209 the slur.  The terminal @code{)} appears to the left of the
1210 first note in the slur.  This makes it possible to put a note in
1211 slurs from both sides:
1212
1213 @lilypond[fragment,verbatim,center]
1214   f'()g'()a' [a'8 b'(] a'4 g'2 )f'4
1215 @end lilypond
1216
1217
1218 @unnumberedsubsec Spanners
1219 @cindex @code{\spanrequest}
1220
1221 @example
1222   \spanrequest @var{startstop} @var{type}
1223 @end example
1224 @cindex @code{\start}
1225 @cindex @code{\stop}
1226
1227 Define a spanning request. The @var{startstop} parameter is either -1
1228 (@code{\start}) or 1 (@code{\stop}) and @var{type} is a string that
1229 describes what should be started.  Supported types are @code{crescendo},
1230 @code{decrescendo}, @code{beam}, @code{slur}.  This is an internal
1231 command.  Users should use the shorthands which are defined in the
1232 initialization file @file{spanners.ly}.
1233
1234 You can attach a (general) span request to a note using
1235
1236 @lilypond[fragment,verbatim,center]
1237   c'4-\spanrequest \start "slur"
1238   c'4-\spanrequest \stop "slur"
1239 @end lilypond
1240
1241 The slur syntax with parentheses is a shorthand for this.
1242
1243 @node Stem tremolo
1244 @section Stem tremolo
1245 @cindex tremolo marks
1246 @cindex @code{tremoloFlags}
1247
1248 [FIXME: should be \repeat]
1249
1250 Tremolo marks can be printed on a single note by adding
1251 `@code{:}[@var{length}]' after the note.  The length must be at
1252 least 8.  A @var{length} value of 8 gives one line across
1253 the note stem.  If the length is omitted, then the last value is
1254 used, or the value of the @code{tremoloFlags} property if there was
1255 no last value.
1256
1257 @lilypond[verbatim,fragment,center]
1258   c'2:8 c':32
1259 @end lilypond
1260
1261 @section Arpeggio
1262 @cindex argepeggio
1263
1264 @cindex broken arpeggio
1265 @cindex @code{\arpeggio}
1266
1267 You can specify an @rgrob{Arpeggio} sign on a chord by issuing an
1268 @c FIXME
1269 @c @code{\arpeggio} request:
1270 @code{\arpeggio} request:
1271
1272
1273 @quotation
1274 @lilypond[fragment,relative,verbatim]
1275   \context Voice <c'\arpeggio e g c>
1276 @end lilypond
1277 @end quotation
1278
1279 Typesetting of simultanious chords with arpeggios can be controlled with
1280 the property @code{PianoStaff.connectArpeggios} @footnote{ FIXME:
1281 connectArpeggios.  Can't find the English terms for two kinds of
1282 arpeggio (Dutch: gebroken arpeggio vs doorlopend arpeggio).}  By
1283 default, LilyPond prints broken arpeggios; when set to true, one
1284 extended arpeggio sign is printed.
1285
1286 @quotation
1287 @lilypond[fragment,relative,verbatim]
1288   \context PianoStaff <
1289     \property PianoStaff.connectArpeggios = ##t
1290     \context Staff \context Voice <c''\arpeggio e g c>
1291     \context Staff=other \context Voice <c,\arpeggio e g>
1292   >  
1293 @end lilypond
1294 @end quotation
1295
1296 @section Glissando
1297 @cindex glissando
1298 @cindex @code{\glissando}
1299
1300 A @rgrob{Glissando} line can be requested by issuing a
1301 @c FIXME
1302 @c @code{\glissando} request:
1303 @code{\glissando} request:
1304
1305
1306 @quotation
1307 @lilypond[fragment,relative,verbatim]
1308   c'' \glissando c'
1309 @end lilypond
1310 @end quotation
1311
1312 Printing of the additional text @samp{gliss.} must be done manually.
1313
1314
1315 @subsection Follow Thread
1316 @cindex follow thread
1317 @cindex staff switching
1318 @cindex cross staff
1319
1320 @c Documented here because it looks like a glissando...
1321 @cindex @code{followThread}
1322 A glissando-like line can be printed to connect notes whenever a thread
1323 switches to another staff.  This is enabled if the property
1324 @code{PianoStaff.followThread} is set to true:
1325
1326 @quotation
1327 @lilypond[fragment,relative,verbatim]
1328   \context PianoStaff <
1329     \property PianoStaff.followThread = ##t
1330     \context Staff \context Voice {
1331       c'1
1332       \translator Staff=two
1333       b2 a
1334     }
1335     \context Staff=two {\clef bass; \skip 1*2;}
1336   >  
1337 @end lilypond
1338 @end quotation
1339
1340 @node Compound music expressions
1341 @section Compound music expressions
1342
1343 @cindex compound music expressions
1344
1345 Music expressions are compound data structures.  You can nest music
1346 expressions any way you like.  This simple example shows how three
1347 chords can be expressed in two different ways:
1348
1349 @lilypond[fragment,verbatim,center]
1350   \notes \context Staff {
1351     <a c'> <b  d' > <c' e'>
1352     < { a b  c' } { c' d' e' } >
1353   }
1354
1355 @end lilypond
1356
1357 @cindex @code{\context}
1358 @cindex context selection
1359
1360 @example
1361   \context @var{contexttype} [= @var{contextname}] @var{musicexpr}
1362 @end example
1363
1364 Interpret @var{musicexpr} within a context of type @var{contexttype}. 
1365 If the context does not exist, it will be created.  The new context
1366 can optionally be given a name.  
1367
1368 @cindex input modes
1369
1370 @cindex mode switch
1371
1372 @cindex @code{\notes}
1373 @cindex @code{\chords}
1374 @cindex @code{\lyrics}
1375
1376 Mode switching keywords form compound music expressions: @code{\notes}
1377 @var{musicexpr}, @code{\chords}  @var{musicexpr},
1378 and @code{\lyrics}  @var{musicexpr}.  These
1379 expressions do not add anything to the meaning of their arguments.  They
1380 are just a way to indicate that the arguments should be parsed in
1381 indicated mode.  See @ref{Lexical modes} for more information on modes.
1382
1383 [to lexer modes?]
1384
1385 @unnumberedsubsec Sequential music
1386 @cindex @code{\sequential}
1387 @cindex sequential music
1388
1389 @example
1390   \sequential @code{@{} @var{musicexprlist} @code{@}}
1391 @end example
1392
1393 This means that list should be played or written in sequence, i.e.,
1394 the second after the first, the third after the second.  The duration
1395 of sequential music is the the sum of the durations of the elements. 
1396 There is a shorthand, which leaves out the keyword:
1397
1398 @example
1399 @cindex @code{<}
1400 @cindex @code{>}
1401
1402   @code{@{} @var{musicexprlist} @code{@}}
1403 @end example
1404
1405
1406
1407 @unnumberedsubsec Simultaneous music
1408 @cindex simultaneous music
1409 @cindex @code{\simultaneous}
1410
1411 @example
1412   \simultaneous @code{@{} @var{musicexprlist} @code{@}}
1413 @end example
1414
1415 It constructs a music expression where all of its arguments start at
1416 the same moment.  The duration is the maximum of the durations of the
1417 elements.  The following shorthand is a common idiom:
1418
1419 @example
1420   @code{<} @var{musicexprlist} @code{>}
1421 @end example
1422
1423 If you try to use a chord as the first thing in your score, you might
1424 get multiple staffs instead of a chord.
1425
1426 @lilypond[verbatim,center]
1427   \score {
1428     \notes <c''4 e''>
1429     \paper {
1430       linewidth = -1.;
1431     }
1432   }
1433 @end lilypond
1434
1435 This happens because the chord is interpreted by a score context.
1436 Each time a note is encountered a default Voice context (along with a
1437 Staff context) is created.  The solution is to explicitly instantiate
1438 a Voice context:
1439
1440 @lilypond[verbatim,center]
1441   \score {
1442     \notes\context Voice <c''4 e''>
1443     \paper {
1444       linewidth = -1.;
1445     }
1446   }
1447 @end lilypond
1448
1449
1450
1451
1452 @node Relative octaves
1453 @section Relative octaves
1454 @cindex relative octave specification
1455
1456 It is easy to get confused by octave changing marks and accidentally
1457 putting a pitch in the wrong octave.  A much better way of entering a
1458 note's octave is `the relative octave' mode.
1459
1460 @cindex @code{\relative}
1461 @example
1462   \relative @var{startpitch} @var{musicexpr}
1463 @end example
1464
1465 The octave of notes that appear in @var{musicexpr} are calculated as
1466 follows: If no octave changing marks are used, the basic interval
1467 between this and the last note is always taken to be a fourth or
1468 less.@footnote{The interval is determined without regarding
1469 accidentals.  A @code{fisis} following a @code{ceses} will be put above
1470 the @code{ceses}.}  The octave changing marks @code{'} and @code{,}
1471 can then be added to raise or lower the pitch by an extra octave. 
1472 Upon entering relative mode, an absolute starting pitch must be
1473 specified that will act as the predecessor of the first note of
1474 @var{musicexpr}.
1475
1476 Entering scales is straightforward in relative mode.
1477
1478 @lilypond[fragment,verbatim,center]
1479   \relative c' {
1480     c d e f g a b c c,
1481   }
1482 @end lilypond
1483
1484 And octave changing marks are used for intervals greater than a fourth.
1485
1486 @lilypond[fragment,verbatim,center]
1487   \relative c'' {
1488     c g c f, c' a, e'' }
1489 @end lilypond
1490
1491 If the preceding item is a chord, the first note of the chord is used
1492 to determine the first note of the next chord.  But other notes
1493 within the second chord are determined by looking at the immediately
1494 preceding note.
1495
1496 @lilypond[fragment,verbatim,center]
1497   \relative c' {
1498     c <c e g> 
1499     <c' e g>
1500     <c, e' g>
1501   }
1502 @end lilypond 
1503 @cindex @code{\notes}
1504
1505 The pitch after the @code{\relative} contains a notename.  To parse
1506 the pitch as a notename, you have to be in note mode, so there must
1507 be a surrounding @code{\notes} keyword (which is not
1508 shown here).
1509
1510 The relative conversion will not affect @code{\transpose} or
1511 @code{\relative} sections in its argument.  If you want to use
1512 relative within transposed music, you must place an additional
1513 @code{\relative} inside the @code{\transpose}.
1514
1515 It is strongly recommended to use relative pitch mode: less work,
1516 less error-prone, and more readable.
1517
1518 @node Entering named chords
1519 @unnumberedsubsec named chords
1520
1521 Chord names are a way to generate simultaneous music expressions that
1522 correspond with traditional chord names.  It can only be used in
1523 Chord mode (see section @ref{Lexical modes}).
1524
1525 @example
1526
1527   @var{tonic}[@var{duration}][@code{-}@var{modifiers}][@code{^}@var{subtractions}][@code{/}@var{inversion}][@code{/+}@var{bass}].
1528 @end example
1529
1530 @var{tonic} should be the tonic note of the chord, and @var{duration}
1531 is the chord duration in the usual notation.  There are two kinds of
1532 modifiers.  One type is @emph{chord additions}, which are obtained by
1533 listing intervals separated by dots.  An interval is written by its
1534 number with an optional @code{+} or @code{-} to indicate raising or
1535 lowering by half a step.  Chord additions has two effects: It adds
1536 the specified interval and all lower odd numbered intervals to the
1537 chord, and it may lower or raise the specified interval.  Intervals
1538 must be separated by a dot (@code{.}).
1539
1540
1541 Throughout these examples, chords have been shifted around the staff
1542 using @code{\transpose}.
1543
1544
1545 @quotation
1546
1547 @lilypond[fragment,verbatim]
1548 \transpose c'' {
1549   \chords {
1550     c1  c:3-       c:7     c:8
1551     c:9 c:9-.5+.7+ c:3-.5- c:4.6.8
1552   }
1553 }
1554
1555 @end lilypond
1556 @end quotation
1557
1558 @cindex @code{aug}
1559 @cindex @code{dim}
1560 @cindex @code{maj}
1561 @cindex @code{sus}
1562
1563 The second type of modifier that may appear after the @code{:} is a
1564 named modifier.  Named modifiers are listed in the file
1565 @file{chord-modifiers.ly}.  The available modifiers are @code{m} and
1566 @code{min} which lower the 3rd half a step, `@code{aug}' which
1567 raises the 5th, `@code{dim}' which lowers the 5th,
1568 `@code{maj}' which adds a raised 7th, and `@code{sus}'
1569 which replaces the 5th with a 4th.
1570
1571 @quotation
1572
1573 @lilypond[fragment,verbatim]
1574 \transpose c'' {
1575   \chords {
1576     c1:m c:min7 c:maj c:aug c:dim c:sus
1577   }
1578 }
1579
1580 @end lilypond
1581 @end quotation
1582  
1583
1584 Chord subtractions are used to eliminate notes from a chord.  The
1585 notes to be subtracted are listed after a @code{^} character,
1586 separated by dots.
1587
1588 @lilypond[fragment,verbatim,center]
1589   \transpose c'' {
1590     \chords {
1591       c1^3 c:7^5.3 c:8^7
1592     }
1593   }
1594 @end lilypond 
1595 @cindex @code{/}
1596
1597 Chord inversions can be specified by appending `@code{/}' and
1598 the name of a single note to a chord.  This has the effect of
1599 lowering the specified note by an octave so it becomes the lowest
1600 note in the chord.  If the specified note is not in the chord, a
1601 warning will be printed.
1602
1603 @lilypond[fragment,verbatim,center]
1604   \transpose c''' {
1605     \chords {
1606       c1 c/e c/g c:7/e
1607     }
1608   }
1609
1610 @end lilypond 
1611 @cindex @code{/+}
1612
1613 Bass notes can be added by `@code{/+}' and
1614 the name of a single note to a chord.  This has the effect of
1615 adding the specified note to the chord, lowered by an octave,
1616 so it becomes the lowest note in the chord.
1617
1618 @lilypond[fragment,verbatim,center]
1619   \transpose c''' {
1620     \chords {
1621       c1 c/+c c/+g c:7/+b
1622     }
1623   }
1624
1625 @end lilypond 
1626
1627 The most interesting application is printing  chords using chord names,
1628 See @ref{Chord names}.
1629
1630 You should not combine @code{\relative} with named chords. [FIXME]
1631
1632
1633 @unnumberedsubsec Tuplets
1634 @cindex tuplets
1635
1636 Tuplets are made out of a music expression by multiplying their
1637 duration with a fraction.
1638
1639 @cindex @code{\times}
1640 @example
1641   \times @var{fraction} @var{musicexpr}
1642 @end example
1643
1644 The duration of @var{musicexpr} will be multiplied by the fraction. 
1645 In print, the fraction's denominator will be printed over the notes,
1646 optionally with a bracket.  The most common tuplet is the triplet in
1647 which 3 notes have the length of 2, so the notes are 2/3 of
1648 their written length:
1649
1650 @lilypond[fragment,verbatim,center]
1651   g'4 \times 2/3 {c'4 c' c'} d'4 d'4
1652 @end lilypond
1653 @cindex @code{\grace}
1654
1655
1656 @unnumberedsubsec Grace notes
1657
1658 @cindex ornaments
1659 @cindex grace notes
1660 @cindex @code{graceAlignPosition}
1661
1662 @example
1663   \grace @var{musicexpr}
1664 @end example
1665
1666 A grace note expression has duration 0; the next real note is
1667 assumed to be the main note.
1668
1669 You cannot have the grace note after the main note, in terms of
1670 duration, and main notes, but you can typeset the grace notes to the
1671 right of the main note using the property
1672 @code{graceAlignPosition}.
1673 @cindex @code{flagStyle}
1674
1675 When grace music is interpreted, a score-within-a-score is set up:
1676 @var{musicexpr} has its own time bookkeeping, and you could (for
1677 example) have a separate time signature within grace notes.  While in
1678 this score-within-a-score, you can create notes, beams, slurs, etc.
1679 Unbeamed eighth notes and shorter by default have a slash through the
1680 stem.  This behavior can be controlled with the
1681 @code{flagStyle} property.
1682
1683 @quotation
1684 @lilypond[fragment,verbatim]
1685 \relative c'' {
1686   \grace c8 c4 \grace { [c16 c16] } c4
1687   \grace { \property Grace.flagStyle = "" c16 } c4
1688 }
1689
1690 @end lilypond
1691 @end quotation
1692 @cindex @code{\grace}
1693
1694 At present, nesting @code{\grace} notes is not supported. The following
1695 may cause run-time errors:
1696 @example
1697   @code{\grace @{ \grace c32 c16 @} c4}
1698 @end example
1699 Since the meaning of such a construct is unclear, we don't consider
1700 this a loss.  Similarly, juxtaposing two @code{\grace} sections is
1701 syntactically valid, but makes no sense and may cause runtime errors.
1702
1703 Ending a staff or score with grace notes may also generate a run-time
1704 error, since there will be no main note to attach the grace notes to.
1705
1706 The present implementation is not robust and generally kludgy. We expect
1707 it to change after LilyPond 1.4
1708
1709
1710 @node Repeats
1711 @section Repeats
1712 @cindex repeats
1713
1714 @cindex @code{\repeat}
1715
1716 In order to specify repeats, use the @code{\repeat}
1717 keyword.  Since repeats look and sound differently when played or
1718 printed, there are a few different variants of repeats.
1719
1720 @table @asis
1721 @item unfolded  
1722 Repeated music is fully written (played) out.  Useful for MIDI
1723 output.
1724
1725 @item volta  
1726 This is the normal notation: Repeats are not written out, but
1727 alternative endings (voltas) are printed, left to right.
1728
1729 @item folded  
1730 Alternative endings are written stacked.  Which is unfortunately not
1731 practical for anything right now.
1732
1733 @item tremolo
1734 Make tremolo beams.
1735 @end table  
1736
1737 The syntax for repeats is
1738
1739 @example
1740   \repeat @var{variant} @var{repeatcount} @var{repeatbody}
1741 @end example
1742
1743 If you have alternative endings, you may add
1744
1745 @cindex @code{\alternative}
1746 @example
1747  \alternative @code{@{} @var{alternative1}
1748             @var{alternative2}
1749             @var{alternative3} @dots{} @code{@}}
1750 @end example
1751
1752 where each @var{alternative} is a Music expression.
1753
1754 Normal notation repeats are used like this:
1755
1756 @quotation
1757
1758 @lilypond[fragment,verbatim]
1759   c'1
1760   \repeat volta 2 { c'4 d' e' f' }
1761   \repeat volta 2 { f' e' d' c' }
1762
1763 @end lilypond
1764 @end quotation
1765
1766 With alternative endings:
1767
1768 @quotation
1769
1770 @lilypond[fragment,verbatim]
1771   c'1
1772   \repeat volta 2 {c'4 d' e' f'} 
1773   \alternative { {d'2 d'} {f' f} }
1774
1775 @end lilypond
1776 @end quotation
1777
1778 Folded repeats look like this:@footnote{Folded repeats offer little
1779 more over simultaneous music.  However, it is to be expected that
1780 more functionality -- especially for the MIDI backend -- will be
1781 implemented.}
1782
1783 @quotation
1784
1785 @lilypond[fragment,verbatim]
1786   c'1
1787   \repeat fold 2 {c'4 d' e' f'} 
1788   \alternative { {d'2 d'} {f' f} }
1789
1790 @end lilypond
1791 @end quotation
1792
1793 @quotation
1794
1795 @lilypond[fragment,verbatim]
1796 \context Staff {
1797   \relative c' {
1798     \partial 4;
1799     \repeat volta 2 { e | c2 d2 | e2 f2 | }
1800     \alternative { { g4 g g } { a | a a a a | b1 } }
1801   }
1802 }
1803
1804 @end lilypond
1805 @end quotation
1806
1807 If you don't give enough alternatives for all of the repeats, then
1808 the first alternative is assumed to be repeated often enough to equal
1809 the specified number of repeats.
1810
1811 @quotation
1812 @lilypond[fragment,verbatim]
1813 \context Staff {
1814   \relative c' {
1815     \repeat volta 3 { \partial 4; e | c2 d2 | e2 f2 | }
1816     \alternative { { g4 g g }
1817                    {\partial 1; e4 e e } 
1818                    {\partial 1; a a a a | b1 } }
1819   }
1820 }
1821 @end lilypond
1822 @end quotation
1823
1824 As you can see, LilyPond doesn't remember the timing information, nor
1825 are slurs or ties repeated. We hope to fix this after 1.4. 
1826
1827 It is possible to nest @code{\repeat}.  This is not entirely
1828 supported: the notes will come be in the right places, but the repeat
1829 bars will not.
1830
1831 To place tremolo marks between notes, use @code{\repeat} with tremolo
1832 style.
1833 @cindex tremolo beams
1834 To create tremolo beams on a single note, simply attach
1835 `@code{:}@var{length}' to the note itself.
1836
1837 @lilypond[verbatim,center]
1838 \score { 
1839   \context Voice \notes\relative c' {
1840     \repeat "tremolo" 8 { c16 d16 }
1841     \repeat "tremolo" 4 { c16 d16 }    
1842     \repeat "tremolo" 2 { c16 d16 }    
1843   }
1844   \paper {
1845     linewidth = 40*\staffspace;
1846   }  
1847 }
1848 @end lilypond
1849 @cindex @code{__}
1850
1851 @lilypond[fragment,verbatim,center]
1852
1853   c'4:32
1854 @end lilypond
1855
1856
1857
1858
1859
1860 @node transpose
1861 @section Transposition
1862 @cindex transposition of pitches
1863 @cindex @code{\transpose}
1864
1865 A music expression can be transposed with @code{\transpose}.  The syntax
1866 is
1867 @example
1868   \transpose @var{pitch} @var{musicexpr}
1869 @end example
1870
1871 This means that middle C in @var{musicexpr} is transposed to
1872 @var{pitch}.
1873
1874 @code{\transpose} distinguishes between enharmonic pitches: both
1875 @code{\transpose cis'} or @code{\transpose des'} will transpose up half
1876 a tone.  The first version will print sharps and the second version
1877 will print flats.
1878
1879 @quotation
1880 @lilypond[fragment,verbatim]
1881 \context Staff {
1882   \clef "F";
1883   { \key e \major; c d e f }
1884   \clef "G";
1885   \transpose des'' { \key e \major; c d e f }
1886   \transpose cis'' { \key e \major; c d e f }
1887 }
1888
1889 @end lilypond
1890 @end quotation
1891
1892 If you want to use both @code{\transpose} and @code{\relative}, then
1893 you must use @code{\transpose} first.  @code{\relative} will have no
1894 effect music that appears inside a @code{\transpose}.
1895
1896 @unnumberedsubsec Adding melodies to lyrics 
1897 @cindex automatic lyric durations
1898 @cindex @code{\addlyrics}
1899
1900 If you have lyrics that are set to a melody, you can import the rhythm
1901 of that melody into the lyrics using @code{\addlyrics}.  The syntax for
1902 this is
1903 @example
1904   \addlyrics @var{musicexpr1 musicexpr2}
1905 @end example
1906
1907 This means that both @var{musicexpr1} and @var{musicexpr2} are
1908 interpreted, but that every non-command atomic music expression
1909 (``every syllable'') in @var{musicexpr2} is interpreted using timing
1910 of @var{musicexpr1}.
1911 @cindex @code{automaticMelismata}
1912
1913 If the property @code{automaticMelismata} is set in the
1914 context of @var{musicexpr1}, no lyrics will be put on slurred or tied
1915 notes.
1916
1917 @quotation
1918 @lilypond[verbatim,fragment]
1919 \addlyrics
1920 \transpose c'' {
1921   \property Voice.automaticMelismata = ##t
1922   c8 () cis d8. e16 f2
1923 }
1924 \context Lyrics \lyrics {
1925  do4 re mi fa }
1926 @end lilypond
1927 @end quotation
1928
1929 You should use a single rhythm melody, and single rhythm lyrics (a
1930 constant duration is the obvious choice).  If you do not, you will get
1931 undesired effects when using multiple stanzas:
1932
1933 @quotation
1934 @lilypond[verbatim,fragment]
1935 \addlyrics
1936 \transpose c'' {
1937   c8 () cis d8. e16 f2
1938 }
1939 \context Lyrics \lyrics
1940 < { do4 re mi fa }
1941   { do8 re mi fa } >
1942
1943 @end lilypond
1944 @end quotation
1945
1946 It is valid (but probably not very useful) to use notes instead of
1947 lyrics for @var{musicexpr2}.
1948
1949 @node Transforming music 
1950 @unnumberedsubsec Apply
1951 @unnumberedsubsec Transforming music
1952
1953 Apply allows a Scheme-function to operate directly on the internal
1954 representation of music.
1955 @example
1956         \apply #@var{func} @var{music}
1957 @end example
1958 The function takes two arguments, being a function and an musical
1959 argument for that function. The function should return a music
1960 expression.
1961
1962 This example replaces the text string of a script. It also shows a dump
1963 of the music it processes.
1964 @lilypond[verbatim]
1965 #(define (testfunc x)
1966         (if (eq? (ly-get-mus-property x 'text) "foo")
1967                 (ly-set-mus-property x 'text "bar"))
1968         ;; recurse
1969         (ly-set-mus-property x 'elements
1970           (map testfunc (ly-get-mus-property x 'elements)))
1971         (display x)
1972         x        
1973 )
1974 \score { \notes
1975   \apply #testfunc { c4_"foo" }
1976
1977 @end lilypond
1978
1979 For more information on what is possible, see the @ref{Tricks} and the
1980 automatically generated documentation.
1981
1982
1983 @node Ambiguities
1984 @section Ambiguities
1985 @cindex ambiguities
1986 @cindex grammar
1987
1988
1989 The grammar contains a number of ambiguities. We hope to resolve them at
1990 some time.
1991
1992 @itemize @bullet
1993   @item  The assignment
1994
1995          @example 
1996 foo = bar 
1997 @end example 
1998
1999        can be interpreted as making a string identifier @code{\foo}
2000        containing @code{"bar"}, or a music identifier @code{\foo}
2001        containing the syllable `bar'.
2002
2003   @item  The assignment
2004
2005          @example 
2006 foo = -6 
2007 @end example 
2008
2009        can be interpreted as making an integer identifier
2010        containing -6, or a Request identifier containing the
2011        fingering `6' (with neutral direction).
2012
2013   @item  If you do a nested repeat like
2014
2015        @quotation
2016
2017 @example 
2018 \repeat @dots{}
2019 \repeat @dots{}
2020 \alternative 
2021 @end example 
2022
2023        @end quotation
2024
2025        then it is ambiguous to which @code{\repeat} the
2026        @code{\alternative} belongs.  This is the classic if-then-else
2027        dilemma.  It may be solved by using braces.
2028
2029   @item  (an as yet unidentified ambiguity :-)
2030 @end itemize
2031
2032
2033
2034 @node Automatic Beaming
2035 @section Automatic Beaming
2036 @cindex automatic beam generation
2037 @cindex autobeam
2038
2039 @cindex @code{Voice.noAutoBeaming}
2040
2041 By default, LilyPond will generate beams automatically.  This feature
2042 can be disabled by setting the @code{Voice.noAutoBeaming} property to
2043 true.  It can be overridden for specific cases by specifying explicit
2044 beams.
2045
2046 @cindex @code{Voice.autoBeamSettings}
2047 @cindex @code{(end * * * *)}
2048 @cindex @code{(begin * * * *)}
2049
2050 A large number of Voice properties are used to decide how to generate
2051 beams.  Their default values appear in @file{scm/auto-beam.scm}.  In
2052 general, beams can begin anywhere, but their ending location is
2053 significant.  Beams can end on a beat, or at durations specified by the
2054 properties in
2055 @code{Voice.autoBeamSettings}.
2056 To end beams every quarter note, for example, you could set the property
2057 @code{(end * * * *)}  to @code{(make-moment 1
2058 4)}.  To end beams at every three eighth notes you would set
2059 it to @code{(make-moment 1 8)}.
2060 The same syntax can be used to specify beam
2061 starting points using
2062 @code{(begin * * * *)}, eg:
2063 @quotation
2064 @example
2065 \property Voice.autoBeamSettings \override
2066     #'(end * * * *) = #(make-moment 1 4)
2067 \property Voice.autoBeamSettings \override
2068     #'(begin * * * *) = #(make-moment 1 8)
2069 @end example
2070 @end quotation
2071
2072 To allow different settings for different time signatures, instead of
2073 the first two asterisks @code{* *} you can specify a time signature; use
2074 @code{(end N M * *)} to restrict the definition to
2075 `@var{N}@code{/}@var{M}' time.  For example, to specify beams ending
2076 only for 6/8 time you would use the property @code{(end 6 8 * *)}.
2077
2078 To allow different endings for notes of different durations, instead of
2079 th last two asterisks you can specify a duration; use @code{(end * * N
2080 M)} to restrict the definition to beams that contain notes of
2081 `@var{N}@code{/}@var{M}' duration.
2082
2083 For example, to specify beam endings for beams that contain 32nd notes,
2084 you would use @code{(end * * 1 32)}.
2085
2086
2087 @node Printing named chords
2088 @section Printing named chords
2089 @cindex chord names
2090 @cindex chords
2091
2092 @cindex printing!chord names
2093 @cindex @code{ChordNames}
2094 @cindex @code{ChordNameVoice}
2095
2096 For displaying printed chord names, use the @code{ChordNames} and
2097 @code{ChordNameVoice} contexts.  The chords may be entered either using
2098 the notation described above, or directly using simultaneous music.
2099
2100 @quotation
2101 @lilypond[verbatim]
2102 scheme = \notes {
2103   \chords {a1 b c} <d f g>  <e g b>
2104 }
2105 \score {
2106   \notes<
2107     \context ChordNamesVoice \scheme
2108     \context Staff \transpose c'' \scheme
2109   >
2110   \paper { linewidth = -1.; }
2111 }
2112 @end lilypond
2113 @end quotation
2114
2115 You can make the chord changes stand out more by setting property
2116 @code{ChordNames.chordChanges} to true.  This will only display chord
2117 names when there's a change in the chords scheme, but always display the
2118 chord name after a line break:
2119
2120 @c bug
2121 @quotation
2122 @lilypond[verbatim]
2123 scheme = \chords {
2124   c1:m \break c:m c:m c:m d
2125 }
2126
2127 \score {
2128   \notes <
2129     \context ChordNames \scheme
2130     \context Staff \transpose c'' \scheme
2131   >
2132   \paper{
2133     linewidth = 40 * \staffspace;
2134     \translator {
2135       \ChordNamesContext
2136       chordChanges = ##t
2137     }
2138   }
2139 }
2140 @end lilypond
2141 @end quotation
2142
2143
2144
2145 LilyPond examines chords specified as lists of notes to determine a
2146 name to give the chord. LilyPond will not try to
2147 identify chord inversions or added base, which may result in strange
2148 chord names when chords are entered as a list of pitches:
2149
2150 @quotation
2151 @lilypond[verbatim,center]
2152 scheme = \notes {
2153   <c'1 e' g'>
2154   <e' g' c''>
2155   <e e' g' c''>
2156 }
2157
2158 \score {
2159   <
2160     \context ChordNamesVoice \scheme
2161     \context Staff \scheme
2162   >
2163   \paper { linewidth = -1.; }
2164 }
2165 @end lilypond
2166 @end quotation
2167
2168 To specify chord inversions, append @code{/<notename>}.  To specify an
2169 added bass note, append @code{/+<notename}:
2170
2171 @quotation
2172 @lilypond[verbatim,center]
2173 scheme = \chords {
2174   d1 d/a d/+gis
2175 }
2176
2177 \score {
2178   \notes <
2179     \context ChordNames \scheme
2180     \context Staff \transpose c'' \scheme
2181   >
2182   \paper { linewidth = -1.; }
2183 }
2184 @end lilypond
2185 @end quotation
2186
2187 The chord names that LilyPond should print are fully customizable.  The
2188 code to print chord names is written in Scheme. It can be found in
2189 @file{scm/chord-name.scm}.  Chord names are based on Banter style
2190 naming, which is unambiguous and has a logical structure.  Typical
2191 American style chord names are implemented as a variation on Banter
2192 names, they can be selected by setting property @code{ChordName.style}
2193 to @code{american}:
2194
2195 @quotation
2196 @lilypond[verbatim]
2197 \include "english.ly"
2198
2199 scheme = \chords {
2200   c         % Major triad
2201   cs:m      % Minor triad
2202   df:m5-    % Diminished triad
2203   c:5^3     % Root-fifth chord
2204   c:4^3     % Suspended fourth triad
2205   c:5+      % Augmented triad
2206   c:2^3     % "2" chord
2207   c:m5-.7-  % Diminished seventh
2208   c:7+      % Major seventh
2209   c:7.4^3   % Dominant seventh suspended fourth
2210   c:5+.7    % Augmented dominant seventh
2211   c:m5-.7   % "Half" diminished seventh
2212   c:5-.7    % Dominant seventh flat fifth
2213   c:5-.7+   % Major seventh flat fifth
2214   c:m7+     % Minor-major seventh
2215   c:m7      % Minor seventh
2216   c:7       % Dominant seventh
2217   c:6       % Major sixth
2218   c:m6      % Minor sixth
2219   c:9^7     % Major triad w/added ninth
2220   c:6.9^7   % Six/Nine chord
2221   c:9       % Dominant ninth 
2222   c:7+.9    % Major ninth
2223   c:m7.9    % Minor ninth
2224 }
2225
2226 \score {
2227   \notes <
2228     \context ChordNames \scheme
2229     \context Staff \transpose c'' \scheme
2230   >
2231   \paper {
2232     \translator { 
2233       \ChordNamesContext
2234       ChordName \override #'word-space = #1 
2235       ChordName \override #'style = #'american
2236     }
2237   }
2238 }
2239 @end lilypond
2240 @end quotation
2241
2242 Similarly, Jazz style chord names are implemented as a variation on
2243 American style names:
2244 @quotation
2245 @lilypond[verbatim]
2246 scheme = \chords {
2247   % major chords
2248   c
2249   c:6           % 6 = major triad with added sixth
2250   c:maj         % triangle = maj
2251   c:6.9^7       % 6/9 
2252   c:9^7         % add9
2253
2254   % minor chords
2255   c:m           % m = minor triad
2256   c:m.6         % m6 = minor triad with added sixth
2257   c:m.7+        % m triangle = minor major seventh chord
2258   c:3-.6.9^7    % m6/9 
2259   c:m.7         % m7
2260   c:3-.9        % m9
2261   c:3-.9^7      % madd9
2262
2263   % dominant chords
2264   c:7           % 7 = dominant
2265   c:7.5+        % +7 = augmented dominant
2266   c:7.5-        % 7b5 = hard diminished dominant
2267   c:9           % 7(9)
2268   c:9-          % 7(b9)
2269   c:9+          % 7(#9)
2270   c:13^9.11     % 7(13)
2271   c:13-^9.11    % 7(b13)
2272   c:13^11       % 7(9,13)
2273   c:13.9-^11    % 7(b9,13)
2274   c:13.9+^11    % 7(#9,13)
2275   c:13-^11      % 7(9,b13)
2276   c:13-.9-^11   % 7(b9,b13)
2277   c:13-.9+^11   % 7(#9,b13)
2278
2279   % half diminished chords
2280   c:m5-.7               % slashed o = m7b5
2281   c:9.3-.5-     % o/7(pure 9)
2282
2283   % diminished chords
2284   c:m5-.7-      % o = diminished seventh chord
2285 }
2286
2287 \score {
2288   \notes <
2289     \context ChordNames \scheme
2290     \context Staff \transpose c'' \scheme
2291   >
2292   \paper {
2293     \translator { 
2294       \ChordNamesContext
2295       ChordName \override #'word-space = #1 
2296       ChordName \override #'style = #'jazz
2297     }
2298   }
2299 }
2300 @end lilypond
2301 @end quotation
2302
2303
2304 @node Printing lyrics
2305 @section lyricprint
2306 @cindex lyrics
2307
2308 @cindex printing!lyrics
2309
2310
2311 Lyric syllables must be interpreted within a @code{Lyrics} context
2312
2313 @cindex context!Lyrics
2314  for printing them.
2315
2316 Here is a full example: 
2317
2318 @quotation
2319 @lilypond[verbatim]
2320 \score {
2321   <
2322     \notes \transpose c'' {
2323       c d e c | c d e c |
2324       e f g2 | e4 f g2 \bar "|.";
2325     }
2326     \context Lyrics \lyrics { 
2327       Va-4 der Ja- cob Va- der Ja- cob
2328       Slaapt gij nog?2 Slaapt4 gij nog?2
2329     }
2330   >
2331 }
2332
2333 @end lilypond
2334 @end quotation
2335
2336 You may want a continuous line after the syllables to show melismata. 
2337 To achieve this effect, add a @code{__} lyric as a separate word
2338 after the lyric to be extended.  This will create an extender, a line
2339 that extends over the entire duration of the lyric.  This line will
2340 run all the way to the start of the next lyric, so you may want to
2341 shorten it by using a blank lyric (using @code{_}).
2342
2343 @quotation
2344
2345 @lilypond[verbatim]
2346 \score {
2347   <
2348     \notes \relative c'' {
2349       a4 () b () c () d | c () d () b () a | c () d () b () a
2350     }
2351     \context Lyrics \lyrics {
2352       foo1 __ | bar2. __ _4 | baz1 __
2353     }
2354   >
2355 }
2356
2357 @end lilypond
2358 @end quotation
2359
2360      
2361 If you want to have hyphens centered between syllables (rather than
2362 attached to the end of the first syllable) you can use the special
2363 `@code{-}@code{-}' lyric as a separate word between syllables.  This
2364 will result in a hyphen which length varies depending on the space
2365 between syllables, and which will be centered between the syllables. 
2366 For example:
2367
2368 @quotation
2369
2370 @lilypond[verbatim]
2371 \score {
2372   <
2373     \notes \transpose c'' {
2374       c d e c | c d e c |
2375       e f g2 | e4 f g2 \bar "|.";
2376     }
2377     \context Lyrics \lyrics {
2378       Va4 -- der Ja -- cob | Va -- der Ja -- cob |
2379       Slaapt gij nog?2 | Slaapt4 gij nog?2
2380     }
2381   >
2382 }
2383
2384 @end lilypond
2385 @end quotation
2386
2387
2388
2389 @node Notation Contexts
2390 @section Notation Contexts
2391
2392 @cindex notation contexts
2393
2394 Notation contexts are objects that only exist during a run of
2395 LilyPond.  During the interpretation phase of LilyPond, the Music
2396 expression contained in a @code{\score} block is interpreted in time
2397 order.  This is the order in which humans read, play, and write
2398 music.
2399
2400 A context is an object that holds the reading state of the
2401 expression; it contains information like
2402
2403 @itemize @bullet
2404   @item What notes are playing at this point?
2405   @item What symbols will be printed at this point?
2406   @item In what style will they printed?
2407   @item What is the current key signature, time signature, point within
2408        the measure, etc.?
2409 @end itemize
2410
2411 Contexts are grouped hierarchically: A @code{Voice} context is
2412 contained in a @code{Staff} context (because a staff can contain
2413 multiple voices at any point), a @code{Staff} context is contained in
2414 a @code{Score}, @code{StaffGroup}, or @code{ChoirStaff} context (because
2415 these can all contain multiple staffs).
2416
2417 Contexts associated with sheet music output are called @emph{notation
2418 contexts}, those for sound output are called performance contexts.
2419
2420 Contexts are created either manually or automatically.  Initially, the
2421 top level music expression is interpreted by the top level context (the
2422 @code{Score} context).  When a atomic music expression (i.e. a note, a
2423 rest, etc.), a nested set of contexts is created that can process these
2424 atomic expressions, as in this example:
2425
2426 @example
2427 \score @{ \notes @{ c4 @} @} 
2428 @end example 
2429
2430 The sequential music, `@code{@{ c4 @}}' is interpreted by @code{Score}
2431 context. When the note @code{c4} itself is interpreted, a set of
2432 contexts is needed that will accept notes.  The default for this is a
2433 @code{Voice} context, contained in a @code{Staff} context.  Creation of
2434 these contexts results in the staff being printed.
2435
2436 @cindex context
2437
2438 You can also create contexts manually, and you probably have to do so
2439 if you want to typeset complicated multiple part material.  If a
2440 `@code{\context} @var{name} @var{musicexpr}' expression is encountered
2441 during the interpretation phase, the @var{musicexpr} argument will be
2442 interpreted with a context of type @var{name}.  If you specify a name,
2443 the specific context with that name is searched.
2444
2445 [type vs id]
2446
2447 If a context of the specified type and name can not be found, a new
2448 one is created.  For example,
2449
2450 @quotation
2451
2452 @lilypond[verbatim]
2453 \score {
2454   \notes \relative c'' {
2455     c4 <d4 \context Staff = "another" e4> f
2456   }
2457 }
2458
2459 @end lilypond
2460 @end quotation
2461
2462 In this example, the @code{c} and @code{d} are printed on the
2463 default staff.  For the @code{e}, a context Staff called
2464 @code{another} is specified; since that does not exist, a new
2465 context is created.  Within @code{another}, a (default) Voice context
2466 is created for the @code{e4}.  When all music referring to a
2467 context is finished, the context is ended as well.  So after the
2468 third quarter, @code{another} is removed.
2469
2470 Almost all music expressions inherit their interpretation context
2471 from their parent.  In other words, suppose that the syntax for a
2472 music expression is
2473
2474 @example
2475
2476   \keyword @var{musicexpr1} @var{musicexpr2} @dots{}
2477 @end example
2478
2479 When the interpretation of this music expression starts, the context
2480 for @var{musicexpr1}, @var{musicexpr2}, etc. is that of the total
2481 expression.
2482
2483 Lastly, you may wonder, why this:
2484
2485 @quotation
2486
2487 @example 
2488 \score @{
2489   \notes \relative c'' @{
2490     c4 d4 e4
2491   @}
2492 @} 
2493 @end example 
2494
2495 @end quotation
2496
2497 doesn't result in this:
2498
2499 @lilypond[]
2500
2501   \score {
2502     \notes \relative c'' {
2503       <c4> <d4> <e4>
2504     }
2505   }
2506
2507 @end lilypond
2508
2509 For the @code{c4}, a default @code{Staff} (with a contained
2510 @code{Voice}) context is created.  After the @code{c4} ends, no
2511 music refers to this default staff, so it would be ended, with the
2512 result shown.  To prevent this inconvenient behavior, the context to
2513 which the sequential music refers is adjusted during the
2514 interpretation.  So after the @code{c4} ends, the context of the
2515 sequential music is also the default @code{Voice} context. 
2516 The @code{d4} gets interpreted in the same context
2517 as @code{c4}.
2518
2519 Properties that are set in one context are inherited by all of the
2520 contained contexts.  This means that a property valid for the
2521 @code{Voice} context can be set in the @code{Score} context (for
2522 example) and thus take effect in all @code{Voice} contexts.
2523
2524 Properties can be preset within the @code{\translator} block
2525 corresponding to the appropriate context.  In this case, the syntax
2526 is
2527
2528 @example
2529   @var{propname} @code{=} @var{value}
2530 @end example
2531
2532 This assignment happens before interpretation starts, so a
2533 @code{\property} expression will override any predefined settings.
2534
2535 The property settings are used during the interpretation phase.  They
2536 are read by the LilyPond modules where interpretation contexts are
2537 built of.  These modules are called @emph{translators}.  Translators for
2538 notation are called @emph{engravers}, and translators for sound are
2539 called @emph{performers}.
2540
2541
2542 @mbinclude properties.itely
2543
2544 @node Page layout
2545 @section Page layout
2546
2547 @subsection Paper block
2548
2549 The most important output definition is the @code{\paper} block, for
2550 music notation.  The syntax is
2551
2552 @example
2553   @code{\paper @{} [@var{paperidentifier}] @var{items} @code{@}}
2554 @end example
2555
2556 where each of the items is one of
2557
2558 @itemize @bullet
2559   @item  An assignment.  The assignment must be terminated by a
2560        semicolon.  
2561
2562   @item  A context definition.  See section @ref{contextdefs} for
2563        more information on context definitions.
2564
2565 @ignore
2566
2567                 FIXME
2568
2569
2570   @item
2571         
2572         A margin shape declaration.  The syntax is
2573 @cindex @code{\shape}
2574        @example
2575
2576          \shape @var{indent1}@code{,} @var{width1}@code{,}
2577                       @var{indent2}@code{,} @var{width2} @dots{} @code{;}
2578          @end example
2579
2580        
2581
2582        Each pair of @var{indent} and @var{width} values is a dimension
2583        specifying how far to indent and how wide to make the line. 
2584        The indentation and width of successive lines are specified by
2585        the successive pairs of dimensions.  The last pair of
2586        dimensions will define the characeristics of all lines beyond
2587        those explicitly specified.
2588 @end ignore
2589
2590   @item  \stylesheet  declaration.  Its syntax is
2591        @example
2592                 \stylesheet @var{alist}
2593        @end example
2594
2595         See @file{font.scm} for details of @var{alist}.
2596 @end itemize
2597
2598
2599 @subsection Paper variables 
2600
2601 The paper block has some variables you may want to use or change:
2602
2603 @table @code
2604 @cindex @code{indent}
2605   @item @code{indent}  
2606     The indentation of the first line of music.
2607 @cindex @code{staffspace}
2608
2609   @item @code{staffspace}
2610     The distance between two staff lines, calculated from the center
2611     of the lines.  You should use either this or @code{rulethickness}
2612     as a unit for distances you modify.
2613   
2614 @cindex @code{linewidth}
2615   @item @code{linewidth}  
2616     Sets the width of the lines.  If set to -1.0, a single
2617     unjustified line is produced.  If you use this variable, you
2618     probably want to define it in staff spaces, ie
2619     @example
2620         linewidth = 30 * \staffspace;
2621     @end example
2622 @cindex @code{textheight}
2623
2624   @item @code{textheight}  
2625     Sets the total height of the music on each page. Only used by
2626     ly2dvi.
2627 @cindex @code{interscoreline}
2628
2629   @item @code{interscoreline}  
2630     Sets the spacing between the score lines. Defaults to 16 pt.
2631 @cindex @code{interscorelinefill}
2632
2633   @item @code{interscorelinefill}  
2634     If set to a positive number, the distance between the score 
2635     lines will stretch in order to fill the full page. In that
2636     case @code{interscoreline} specifies the minimum spacing.
2637     Defaults to 0.
2638 @cindex @code{stafflinethickness}
2639
2640   @item @code{stafflinethickness}  
2641     Determines the thickness of staff lines, and also acts as a scaling
2642     parameter for other line thicknesses.
2643 @end table
2644
2645
2646 @subsection Line breaks
2647
2648 @cindex line breaks
2649 @cindex breaking lines
2650
2651 Line breaks are normally computed automatically. They are chosen such
2652 that the resulting spacing has low variation, and looks neither cramped
2653 nor loose.
2654
2655 Occasionally you might want to override the automatic breaks; you can do
2656 this by specifying @code{\break} (see also @ref{Pre-defined
2657 Identifiers}). This will force a line break at this point. Do remember
2658 that line breaks can only occur at places where there are barlines.  If
2659 you want to have a line break where there is no barline, you can force a
2660 barline by entering @code{\bar "";}.
2661
2662
2663 @subsection Page breaks
2664
2665 Page breaks are normally computed by @TeX{}, so they are not under direct
2666 control.  However, you can insert a commands into the .tex output to
2667 instruct @TeX{} where to break pages. For more details, see  the
2668 example file @file{input/test/between-systems.ly}
2669
2670
2671 @cindex page breaks
2672 @cindex breaking pages
2673
2674
2675 @subsection Font size
2676
2677 @cindex font size
2678
2679 The Feta font provides musical symbols at six different sizes.  These
2680 fonts are 11 point, 13 point, 16 point, 20 point,
2681 23 point, and 26 point.  The point size of a font is the
2682 height of the five lines in a staff when displayed in the font.
2683
2684 Definitions for these sizes are the files @file{paperSZ.ly}, where
2685 @code{SZ} is one of 11, 13, 16, 20, 23 and 26.  If you include any of
2686 these files, the identifiers @code{paperEleven}, @code{paperThirteen},
2687 @code{paperSixteen}, @code{paperTwenty}, @code{paperTwentythree}, and
2688 @code{paperTwentysix} are defined respectively.  The default
2689 @code{\paper} block is also set.
2690
2691 The font definitions are generated using a Scheme function. For more
2692 details, see the file @file{font.scm}.
2693
2694 @subsection Paper size
2695
2696 @cindex paper size
2697 @cindex page size
2698 @cindex @code{papersize}
2699
2700 To change the paper size, you must first set the
2701 @code{papersize} variable at top level.  Set it to
2702 the strings @code{a4}, @code{letter}, or @code{legal}.  After this
2703 specification, you must set the font as described above.  If you want
2704 the default font, then use the 20 point font.  The new paper size will
2705 not take effect if the font is not loaded and selected afterwards.
2706
2707 @example
2708         papersize = "a4"
2709         \include "paper16.ly"
2710
2711         \score @{
2712                 ...
2713                 \paper @{ \paperSixteen @}
2714         @}
2715 @end example
2716
2717 The file "paper16.ly" will now include a file named @file{a4.ly}, which
2718 will set the paper variables @code{hsize} and @code{vsize} (used by
2719 @code{ly2dvi})
2720
2721 @node Context definitions
2722 @section Context definitions
2723
2724 @cindex context definition
2725 @cindex translator definition
2726 @cindex engraver hacking
2727
2728
2729 A notation contexts is defined by the following information
2730
2731 @enumerate 1
2732   @item  A name.
2733
2734   @item  The LilyPond modules that do the actual conversion of music to
2735        notation.  Each module is a so-called
2736        @emph{engraver}
2737 @cindex engraver
2738 .
2739
2740   @item  How these modules should cooperate, i.e. which ``cooperation
2741        module'' should be used.  This cooperation module is a special
2742        type of engraver.
2743
2744   @item  What other contexts the context can contain,
2745
2746   @item  What properties are defined.
2747 @end enumerate
2748
2749 A context definition has this syntax:
2750
2751 @example
2752
2753   \translator @code{@{}
2754                       @var{translatorinit} @var{translatormodifierlist}
2755                     @code{@}}
2756 @end example
2757
2758 @var{translatorinit} can be an identifier or of the form
2759
2760 @example
2761
2762   \type @var{typename} @code{;}
2763 @end example
2764
2765 @var{typename} is one of
2766
2767 @table @code
2768 @cindex @code{Engraver_group_engraver}
2769   @item @code{Engraver_group_engraver}  
2770     The standard cooperation engraver.
2771 @cindex @code{Score_engraver}
2772
2773   @item @code{Score_engraver}  
2774     This is cooperation module that should be in the top level context.
2775 @cindex @code{Grace_engraver_group}
2776
2777   @item @code{Grace_engraver_group}  
2778     This is a special cooperation module (resembling
2779     @code{Score_engraver}) that is used to created an embedded
2780     `miniscore'.
2781 @end table 
2782
2783 @var{translatormodifierlist} is a list of items where each item is
2784 one of
2785
2786 @itemize @bullet
2787   @item  @code{\consists} @var{engravername} @code{;}  
2788     Add @var{engravername} to the list of modules in this context. 
2789   The order of engravers added with @code{\consists} is
2790     significant.
2791   
2792   @item  @code{\consistsend} @var{engravername} @code{;}  
2793     Analogous to @code{\consists}, but makes sure that
2794     @var{engravername} is always added to the end of the list of
2795     engravers.
2796
2797     Some engraver types need to be at the end of the list; this
2798     insures they are put there, and stay there, if a user adds or
2799     removes engravers.  This command is usually not needed for
2800     end-users.
2801     
2802   @item  @code{\accepts} @var{contextname} @code{;}  
2803     Add @var{contextname} to the list of  context this context can
2804     contain.  The first listed context is the context to create by
2805     default.
2806
2807   @item @code{\denies}. The opposite of @code{\accepts}. Added for
2808 completeness, but is never used in practice.
2809  
2810   
2811   @item  @code{\remove} @var{engravername} @code{;}  
2812     Remove a previously added (with @code{\consists}) engraver.
2813   
2814   @item  @code{\name} @var{contextname} @code{;}  
2815     This sets name of the context, e.g. @code{Staff}, @code{Voice}.  If
2816     the name is not specified, the translator won't do anything.
2817
2818   @item  @var{propname} @code{=} @var{value} @code{;}  
2819     A property assignment.  It is allowed to use reals for
2820     @var{value}.
2821 @end itemize
2822
2823 In the @code{\paper} block, it is also possible to define translator
2824 identifiers.  Like other block identifiers, the identifier can only
2825 be used as the very first item of a translator.  In order to define
2826 such an identifier outside of @code{\score}, you must do
2827
2828 @quotation
2829
2830 @example 
2831 \paper @{
2832   foo = \translator @{ @dots{} @}
2833 @}
2834 \score @{
2835   \notes @{
2836     @dots{}
2837   @}
2838   \paper @{
2839     \translator @{ \foo @dots{} @}
2840   @}
2841 @} 
2842 @end example 
2843
2844 @end quotation
2845
2846
2847 @cindex paper types, engravers, and pre-defined translators
2848
2849 Some pre-defined identifiers can simplify modification of
2850 translators.  The pre-defined identifiers are:
2851
2852 @table @code
2853 @cindex @code{StaffContext}
2854   @item @code{StaffContext}  
2855     Default Staff context. 
2856 @cindex @code{RhythmicStaffContext}
2857
2858   @item @code{RhythmicStaffContext}  
2859     Default RhythmicStaff context. 
2860 @cindex @code{VoiceContext}
2861
2862   @item @code{VoiceContext}  
2863     Default Voice context.  
2864 @cindex @code{ScoreContext}
2865
2866   @item @code{ScoreContext}  
2867     Default Score context. 
2868 @cindex @code{ScoreWithNumbers}
2869
2870   @item @code{ScoreWithNumbers}  
2871     Score context with numbering at the Score level.
2872 @cindex @code{BarNumberingStaffContext}
2873
2874   @item @code{BarNumberingStaffContext}  
2875     Staff context with numbering at the Staff level.
2876 @cindex @code{HaraKiriStaffContext}
2877
2878   @item @code{HaraKiriStaffContext}  
2879     Staff context that does not print if it only contains rests. 
2880     Useful for orchestral scores.@footnote{Harakiri, also called
2881     Seppuku, is the ritual suicide of the Japanese Samourai warriors.}
2882 @cindex @code{OrchestralPartStaffContext}
2883
2884   @item @code{OrchestralPartStaffContext}
2885 @cindex @code{OrchestralScoreContext}
2886
2887   @item @code{OrchestralScoreContext}
2888 @end table
2889
2890 Using these pre-defined values, you can remove or add items to the
2891 translator:
2892
2893 @quotation
2894
2895 @example 
2896 \paper @{
2897   \translator @{
2898     \StaffContext
2899     \remove Some_engraver;
2900     \consists Different_engraver;
2901   @}
2902 @} 
2903 @end example 
2904
2905 @end quotation
2906
2907       
2908 @node Sound output
2909 @section Sound output
2910
2911 The MIDI block is analogous to the paper block, but it is somewhat
2912 simpler.  The @code{\midi} block can contain:
2913 @cindex MIDI block
2914
2915 @itemize @bullet
2916   @item  a @code{\tempo} definition
2917   @item  context definitions
2918 @end itemize
2919
2920 Assignments in the @code{\midi} block are not allowed.
2921
2922
2923
2924 @cindex context definition
2925
2926 Context definitions follow precisely the same syntax as within the
2927 \paper block.  Translation modules for sound are called performers.
2928 The contexts for MIDI output are defined in @file{ly/performer.ly}.
2929
2930
2931
2932 @node midilist
2933 @section MIDI instrument names
2934 @cindex instrument names
2935 @cindex @code{Staff.midiInstrument}
2936 @cindex @code{Staff.instrument}
2937
2938 The MIDI instrument name is set by the @code{Staff.midiInstrument}
2939 property or, if that property is not set, the @code{Staff.instrument}
2940 property.  The instrument name should be chosen from the following list.
2941 If the selected string does not exactly match, then LilyPond uses the
2942 default piano.
2943
2944 [FIXME: to appendix ]
2945
2946 @c @quotation
2947
2948 @example 
2949 "acoustic grand"            "contrabass"           "lead 7 (fifths)"
2950 "bright acoustic"           "tremolo strings"      "lead 8 (bass+lead)"
2951 "electric grand"            "pizzicato strings"    "pad 1 (new age)"
2952 "honky-tonk"                "orchestral strings"   "pad 2 (warm)"
2953 "electric piano 1"          "timpani"              "pad 3 (polysynth)"
2954 "electric piano 2"          "string ensemble 1"    "pad 4 (choir)"
2955 "harpsichord"               "string ensemble 2"    "pad 5 (bowed)"
2956 "clav"                      "synthstrings 1"       "pad 6 (metallic)"
2957 "celesta"                   "synthstrings 2"       "pad 7 (halo)"
2958 "glockenspiel"              "choir aahs"           "pad 8 (sweep)"
2959 "music box"                 "voice oohs"           "fx 1 (rain)"
2960 "vibraphone"                "synth voice"          "fx 2 (soundtrack)"
2961 "marimba"                   "orchestra hit"        "fx 3 (crystal)"
2962 "xylophone"                 "trumpet"              "fx 4 (atmosphere)"
2963 "tubular bells"             "trombone"             "fx 5 (brightness)"
2964 "dulcimer"                  "tuba"                 "fx 6 (goblins)"
2965 "drawbar organ"             "muted trumpet"        "fx 7 (echoes)"
2966 "percussive organ"          "french horn"          "fx 8 (sci-fi)"
2967 "rock organ"                "brass section"        "sitar"
2968 "church organ"              "synthbrass 1"         "banjo"
2969 "reed organ"                "synthbrass 2"         "shamisen"
2970 "accordion"                 "soprano sax"          "koto"
2971 "harmonica"                 "alto sax"             "kalimba"
2972 "concertina"                "tenor sax"            "bagpipe"
2973 "acoustic guitar (nylon)"   "baritone sax"         "fiddle"
2974 "acoustic guitar (steel)"   "oboe"                 "shanai"
2975 "electric guitar (jazz)"    "english horn"         "tinkle bell"
2976 "electric guitar (clean)"   "bassoon"              "agogo"
2977 "electric guitar (muted)"   "clarinet"             "steel drums"
2978 "overdriven guitar"         "piccolo"              "woodblock"
2979 "distorted guitar"          "flute"                "taiko drum"
2980 "guitar harmonics"          "recorder"             "melodic tom"
2981 "acoustic bass"             "pan flute"            "synth drum"
2982 "electric bass (finger)"    "blown bottle"         "reverse cymbal"
2983 "electric bass (pick)"      "skakuhachi"           "guitar fret noise"
2984 "fretless bass"             "whistle"              "breath noise"
2985 "slap bass 1"               "ocarina"              "seashore"
2986 "slap bass 2"               "lead 1 (square)"      "bird tweet"
2987 "synth bass 1"              "lead 2 (sawtooth)"    "telephone ring"
2988 "synth bass 2"              "lead 3 (calliope)"    "helicopter"
2989 "violin"                    "lead 4 (chiff)"       "applause"
2990 "viola"                     "lead 5 (charang)"     "gunshot"
2991 "cello"                     "lead 6 (voice)" 
2992 @end example 
2993
2994 @c @end quotation
2995
2996
2997 @node Pre-defined Identifiers
2998
2999 @section Pre-defined Identifiers
3000
3001 @cindex pre-defined identifiers
3002
3003
3004 Various identifiers are defined in the initialization files to
3005 provide shorthands for some settings.  Most of them are in
3006 @file{ly/declarations.ly} and @file{ly/property.ly}.
3007
3008 @table @code
3009 @cindex @code{\break}  
3010   @item @code{\break}
3011     Force a line break in music by using a large argument for the
3012     keyword @code{\penalty}.
3013
3014 @cindex @code{\nobreak}  
3015   @item @code{\nobreak}
3016     Prevent a line break in music by using a large negative argument
3017     for the keyword @code{\penalty}.
3018
3019 @cindex @code{\shiftOff}  
3020   @item @code{\shiftOff}
3021     Disable horizontal shifting of note heads that collide. 
3022
3023 @cindex @code{\shiftOn}  
3024   @item @code{\shiftOn}
3025     Enable note heads that collide with other note heads to be
3026     shifted horiztonally. Also @code{\shiftOnn} and @code{\shiftOnnn}
3027 set different shift values.
3028
3029 @cindex @code{\stemBoth}  
3030   @item @code{\stemBoth}
3031     Allow stems, beams, and slurs to point either upwards or
3032     downwards, decided automatically by LilyPond.
3033
3034 @cindex @code{\stemDown}  
3035   @item @code{\stemDown}
3036     Force stems, beams, and slurs to point down.
3037
3038 @cindex @code{\stemUp}  
3039   @item @code{\stemUp}
3040     Force stems, beams and slurs to point up.
3041
3042 @end table
3043
3044
3045
3046 @node Point and click
3047 @section Point and click
3048
3049 [todo]
3050
3051