]> git.donarmstrong.com Git - lilypond.git/commitdiff
doc fixes, rune pats
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 7 Jul 2002 01:32:07 +0000 (01:32 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 7 Jul 2002 01:32:07 +0000 (01:32 +0000)
27 files changed:
ChangeLog
Documentation/user/convert-ly.itexi
Documentation/user/converters.itely
Documentation/user/internals.itely
Documentation/user/introduction.itely
Documentation/user/invoking.itexi
Documentation/user/lilypond.tely
Documentation/user/literature.itely
Documentation/user/ly2dvi.itexi
Documentation/user/macros.itexi
Documentation/user/preface.itely
Documentation/user/refman.itely
Documentation/user/tutorial.itely
input/regression/accidental-octave.ly
lily/accidental-engraver.cc
lily/auto-beam-engraver.cc
lily/beam-engraver.cc
lily/include/translator-group.hh
lily/main.cc
lily/new-accidental-engraver.cc [new file with mode: 0644]
lily/scm-option.cc
lily/translator-group.cc
ly/engraver-init.ly
ly/property-init.ly
scm/drums.scm
scm/generate-documentation.scm
scm/grob-description.scm

index 3ce8c8c048fb5dd55e9bb9878448031e3a4b1505..0411b9a120e625b58fd59902ba630dbda093647c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2002-07-07  Han-Wen  <hanwen@cs.uu.nl>
+
+       * Documentation/user/tutorial.itely: doc carnage.
+
+2002-07-06  Rune Zedeler  <rune@zedeler.dk>
+
+       * Documentation/user/refman.itely: Documented accidentals
+       (incl. bugs), subdivideBeams and drum/percussion notation.
+
+       * lily/translator-group.cc, lily/include/translator-group.hh
+       (Translator_group::set_children_property): removed.
+
+       * lily/accidental-engraver.cc: don't use
+       Translator_group::set_children_property.
+
+       * lily/new-accidental-engraver.cc: Added. More correct
+       accidentals, but wrong spacing.
+
+       * lily/beam-enagraver.cc, lily/auto-beam-engraver.cc: Small
+       subdivideBeams-fixes.
+
+       * scm/drums.scm: Small changes/fixes in instruments and maps
+       
 2002-07-05  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * lexer-gcc-3.1.sh: Fixes and more comments.
index 3d77bcaf5a82f6f05b54159001304f316bda0981..6d296919c708710288b0e0afc2dd2cc42cb5ef1b 100644 (file)
@@ -1,49 +1 @@
 @c -*-texinfo-*-
-
-@node Upgrading from older LilyPond versions
-@chapter Upgrading from older LilyPond versions
-
-
-Convert-ly sequentially applies different conversions to upgrade a
-Lilypond input file.  It uses @code{\version} statements in the file to
-detect the old version number.  For example, to upgrade all lilypond
-files in the current directory and its subdirectories, use
-@example
-        convert-ly -e --to=1.3.150 `find . -name '*.ly' -print`
-@end example
-
-The program is invoked as follows:
-@example
-        convert-ly [@var{options}] @var{files}
-@end example
-
-
-The following options can be given:
-
-@table @code
-@item -a,--assume-old
-    If version number cannot be determined, apply all conversions.
-@item -e,--edit
-    Do an inline edit of the input file. Overrides @code{--output}.
-@item -f,--from=@var{from-patchlevel}
-    Set the level to convert from. If this is not set, convert-ly will
-    guess this, on the basis of @code{\version} strings in the file.
-@item -o,--output=@var{file}
-    Set the output file to write.  
-@item -n,--no-version
-    Normally, convert-ly adds a @code{\version} indicator 
-    to the output. Specifying this option suppresses this.  
-@item -s, --show-rules
-    Show all known conversions and exit.
-@item --to=@var{to-patchlevel}
-    Set the goal version of the conversion. It defaults to the latest
-    available version.
-@item -h, --help
-    Print usage help
-@end table
-
-
-
-@refbugs Bugs
-
-Not all language changes are handled. Only one output options can be specified.
index dd921039322629c43f247da9dcdc69aea64279fb..1bfe2a1e0f2222d92259f8b34d52e570af42a1a8 100644 (file)
@@ -1,17 +1,66 @@
 @c -*-texinfo-*-
 
-@node Importing other formats
-@chapter Importing other formats
+@node Converting from other formats
+@chapter Converting from other formats
 
 @menu
+* Older LilyPond versions::     
 * Importing MIDI::              
-* Importing Finale ::           
+* Importing Finale ::        Upgrading from older   
 * Importing ABC::               
 * Importing PMX::               
 * Importing Musedata ::         
 * Importing MUP::               
 @end menu
 
+
+@node  Older LilyPond versions
+@section  Older LilyPond versions
+
+Convert-ly sequentially applies different conversions to upgrade a
+Lilypond input file.  It uses @code{\version} statements in the file to
+detect the old version number.  For example, to upgrade all lilypond
+files in the current directory and its subdirectories, use
+@example
+        convert-ly -e --to=1.3.150 `find . -name '*.ly' -print`
+@end example
+
+The program is invoked as follows:
+@example
+        convert-ly [@var{options}] @var{files}
+@end example
+
+
+The following options can be given:
+
+@table @code
+@item -a,--assume-old
+    If version number cannot be determined, apply all conversions.
+@item -e,--edit
+    Do an inline edit of the input file. Overrides @code{--output}.
+@item -f,--from=@var{from-patchlevel}
+    Set the level to convert from. If this is not set, convert-ly will
+    guess this, on the basis of @code{\version} strings in the file.
+@item -o,--output=@var{file}
+    Set the output file to write.  
+@item -n,--no-version
+    Normally, convert-ly adds a @code{\version} indicator 
+    to the output. Specifying this option suppresses this.  
+@item -s, --show-rules
+    Show all known conversions and exit.
+@item --to=@var{to-patchlevel}
+    Set the goal version of the conversion. It defaults to the latest
+    available version.
+@item -h, --help
+    Print usage help
+@end table
+
+
+
+@refbugs
+
+Not all language changes are handled. Only one output options can be specified.
+
 @node  Importing MIDI
 @section Importing MIDI
 
index f9db09e0c2d6b38c6aa8fd2bed34b814dec0fd69..63c5f06b13a07e1fe8673bd1fab63bdf9bfb41f4 100644 (file)
@@ -7,8 +7,8 @@
 @c before saving changes
 
 
-@node Internals
-@chapter Internals
+@node Advanced Topics
+@chapter Advanced Topics
 
 
 When translating the input to notation, there are number of distinct
@@ -119,3 +119,777 @@ are output, line by line. The output is encoded in the form of
 The data types that are mentioned here are all discussed in this
 section.
 
+
+
+@c FIXME: Note entry vs Music entry at top level menu is confusing.
+@c . {Music entry}
+@menu
+* Interpretation context::      
+* Syntactic details::           
+* Lexical details::             
+@end menu
+
+@node Interpretation context
+@section Interpretation context
+
+@menu
+* Creating contexts::           
+* Default contexts::            
+* Context properties::          
+* Engravers and performers::    
+* Changing context definitions::  
+* Defining new contexts::       
+@end menu
+
+
+Interpretation contexts are objects that only exist during a run of
+LilyPond.  During the interpretation phase of LilyPond (when it prints
+"interpreting music"), the music expression in a @code{\score} block is
+interpreted in time order. This is the same order that humans hear and
+play the music.
+
+During this interpretation, the interpretation context holds the
+state for the current point within the music. It contains information
+like
+
+@itemize @bullet
+  @item What notes are playing at this point?
+  @item What symbols will be printed at this point?
+  @item What is the current key signature, time signature, point within
+       the measure, etc.?
+@end itemize
+
+Contexts are grouped hierarchically: A @internalsref{Voice} context is
+contained in a @internalsref{Staff} context (because a staff can contain
+multiple voices at any point), a @internalsref{Staff} context is contained in
+@internalsref{Score}, @internalsref{StaffGroup}, or @internalsref{ChoirStaff} context.
+
+Contexts associated with sheet music output are called @emph{notation
+contexts}, those for sound output are called @emph{performance
+contexts}. The default definitions of the standard notation and
+performance contexts can be found in @file{ly/engraver-init.ly} and
+@file{ly/performer-init.ly}, respectively.
+
+@node Creating contexts
+@subsection Creating contexts
+
+@cindex @code{\context}
+@cindex context selection
+
+Contexts for a music expression can be selected manually, using the
+following music expression.
+
+@example
+  \context @var{contexttype} [= @var{contextname}] @var{musicexpr}
+@end example
+
+This instructs lilypond to interpret @var{musicexpr} within the context
+ of type @var{contexttype} and with name @var{contextname}.  If this
+context does not exist, it will be created.  
+
+@lilypond[verbatim,singleline]
+\score {
+  \notes \relative c'' {
+    c4 <d4 \context Staff = "another" e4> f
+  }
+}
+
+@end lilypond
+
+In this example, the @code{c} and @code{d} are printed on the
+default staff.  For the @code{e}, a context Staff called
+@code{another} is specified; since that does not exist, a new
+context is created.  Within @code{another}, a (default) Voice context
+is created for the @code{e4}.  When all music referring to a
+context is finished, the context is ended as well.  So after the
+third quarter, @code{another} is removed.
+
+
+
+@node Default contexts
+@subsection Default contexts
+
+Most music expressions don't need an explicit @code{\context}
+declaration: they inherit the 
+notation context from their parent. Each note is a music expression, and
+as you can see in the following example, only the sequential music
+enclosing the three notes has an explicit context. 
+
+@lilypond[verbatim,singleline]
+\score { \notes \context Voice = goUp { c'4 d' e' } } 
+@end lilypond
+
+There are some quirks that you must keep in mind when dealing with
+defaults:
+
+First, every top level music is interpreted by the Score context, in other
+words, you may think of @code{\score} working like
+@example
+        \score @{
+                \context Score @var{music}
+        @}
+@end example
+
+Second, contexts are created automatically to be able to interpret the
+music expressions. Consider the following example.
+
+@lilypond[verbatim, singleline]
+\score { \context Score \notes { c'4 (  d' )e' } }
+@end lilypond
+
+The sequential music is interpreted by the Score context initially
+(notice that the @code{\context} specification is redundant), but when a
+note is encountered, contexts are setup to accept that note. In this
+case, a Thread, Voice and Staff are created. The rest of the sequential
+music is also interpreted with the same Thread, Voice and Staff context,
+putting the notes on the same staff, in the same voice.
+
+This is a convenient mechanism, but do not expect opening chords to work
+without @code{\context}. For every note, a separate staff is
+instantiated.
+
+@cindex explicit context
+@cindex starting with chords
+@cindex chords, starting with
+
+@lilypond[verbatim, singleline]
+\score { \notes <c'4 es'> } 
+@end lilypond
+
+Of course, if the chord is preceded by a normal note in sequential
+music, the chord will be interpreted by the Thread of the preceding
+note:
+@lilypond[verbatim,singleline]
+\score { \notes { c'4 <c'4 es'> }  }
+@end lilypond
+
+
+
+@node Context properties
+@subsection Context properties
+
+Notation contexts have properties. These properties are from
+the @file{.ly} file using the following  expression:
+@cindex @code{\property}
+@example
+  \property @var{contextname}.@var{propname} =  @var{value}
+@end example
+
+Sets the @var{propname} property of the context @var{contextname} to the
+specified Scheme expression @var{value}.  All @var{propname} and
+@var{contextname} are strings, which are typically unquoted.
+
+Properties that are set in one context are inherited by all of the
+contained contexts.  This means that a property valid for the
+@internalsref{Voice} context can be set in the @internalsref{Score} context (for
+example) and thus take effect in all @internalsref{Voice} contexts.
+
+Properties can be unset using the following expression:
+@example
+  \property @var{contextname}.@var{propname} \unset
+@end example
+
+@cindex properties, unsetting
+@cindex @code{\unset} 
+
+This removes the definition of @var{propname} in @var{contextname}. If
+@var{propname} was not defined in @var{contextname} (but was inherited
+from a higher context), then this has no effect.
+
+
+@refbugs
+
+The syntax of @code{\unset} is asymmetric: @code{\property \unset} is not
+the inverse of @code{\property \set}.
+
+@node Engravers and performers
+@subsection Engravers and performers
+
+[TODO]
+
+Basic building blocks of translation are called engravers; they are
+special C++ classes.
+
+
+
+@node Changing context definitions
+@subsection Changing context definitions
+
+@cindex context definition
+@cindex translator definition
+
+The most common way to define a context is by extending an existing
+context.  You can change an existing context from the paper block, by
+first initializing a translator with an existing context identifier:
+@example
+\paper @{
+  \translator @{
+    @var{context-identifier}
+  @} @}
+@end example
+Then you can add and remove engravers using the following syntax:
+@example
+ \remove @var{engravername}
+ \consists @var{engravername}
+@end example
+
+
+Here @var{engravername} is a string, the name of an engraver in the
+system.
+
+
+@lilypond[verbatim,singleline]
+\score {  \notes {
+        c'4 c'4 }
+  \paper {
+    \translator  { \StaffContext
+        \remove Clef_engraver
+       } } }
+@end lilypond
+
+@cindex engraver
+
+You can also set properties in a translator definition. The syntax is as
+follows:
+@example
+ @var{propname} = @var{value}
+ @var{propname} \set  @var{grob-propname} = @var{pvalue}
+ @var{propname} \override @var{grob-propname} =  @var{pvalue}
+ @var{propname} \revert @var{grob-propname} 
+@end example
+@var{propname} is a string, @var{grob-propname} a symbol, @var{value}
+and @code{pvalue} are Scheme expressions. These type of property
+assignments happen before interpretation starts, so a @code{\property}
+command will override any predefined settings.
+
+
+ To simplify editing translators, all standard contexts have standard
+identifiers called @var{name}@code{Context}, e.g. @code{StaffContext},
+@code{VoiceContext}, see @file{ly/engraver-init.ly}.
+
+@node Defining new contexts
+@subsection Defining new contexts
+
+If you want to build a context from scratch, you must also supply the
+following extra information:
+@itemize @bullet
+  @item  A name, specified by @code{\name @var{contextname}}.
+
+  @item A cooperation module. This is specified by   @code{\type
+@var{typename}}.
+@end itemize
+
+This is an example:
+@example
+\translator @code{
+  \type "Engraver_group_engraver"
+  \name "SimpleStaff"
+  \alias "Staff"
+  \consists "Staff_symbol_engraver"
+  \consists "Note_head_engraver"
+  \consistsend "Axis_group_engraver"
+}@
+@end example
+
+The argument of @code{\type} is the name for a special engraver that
+handles cooperation between simple engravers such as
+@code{Note_head_engraver} and @code{Staff_symbol_engraver}. Alternatives
+for this engraver are the following:
+@table @code
+@cindex @code{Engraver_group_engraver}
+  @item @code{Engraver_group_engraver}  
+    The standard cooperation engraver.
+
+@cindex @code{Score_engraver}
+
+  @item @code{Score_engraver}  
+    This is cooperation module that should be in the top level context,
+and only the top level context.
+
+@end table 
+
+Other modifiers   are
+
+@itemize @bullet
+  @item @code{\alias} @var{alternate-name}
+    This specifies a different name. In the above example,
+@code{\property Staff.X = Y} will also work on @code{SimpleStaff}s
+
+  @item  @code{\consistsend} @var{engravername} 
+    Analogous to @code{\consists}, but makes sure that
+    @var{engravername} is always added to the end of the list of
+    engravers.
+
+    Some engraver types need to be at the end of the list; this
+    insures they stay there even if a user adds or removes engravers.
+End-users generally don't need this command.
+    
+  @item  @code{\accepts} @var{contextname}
+    Add @var{contextname} to the list of contexts this context can
+    contain in the context hierarchy. The first listed context is the
+    context to create by default.
+
+  @item @code{\denies}. The opposite of @code{\accepts}. Added for
+completeness, but is never used in practice.
+  
+  @item  @code{\name} @var{contextname} 
+    This sets the type name of the context, e.g. @internalsref{Staff},
+    @internalsref{Voice}.  If the name is not specified, the translator won't do
+    anything. 
+@end itemize
+
+In the @code{\paper} block, it is also possible to define translator
+identifiers.  Like other block identifiers, the identifier can only
+be used as the very first item of a translator.  In order to define
+such an identifier outside of @code{\score}, you must do
+
+@quotation
+@example 
+\paper @{
+  foo = \translator @{ @dots{} @}
+@}
+\score @{
+  \notes @{
+    @dots{}
+  @}
+  \paper @{
+    \translator @{ \foo @dots{} @}
+  @}
+@} 
+@end example 
+
+@end quotation
+
+
+@cindex paper types, engravers, and pre-defined translators
+
+      
+@node Syntactic details
+@section Syntactic details
+@cindex Syntactic details
+
+This section describes details that were too boring to be put elsewhere.
+
+@menu
+* Identifiers::                 
+* Music expressions::           
+* Manipulating music expressions::  
+* Span requests::               
+* Assignments::                 
+* Lexical modes::               
+* Ambiguities::                 
+@end menu
+
+@c .  {Identifiers}
+@node Identifiers
+@subsection Identifiers
+@cindex  Identifiers
+
+@ignore
+ What has this section got to do with identifiers?
+ It seems more appropriate in the introduction to Chapter 4,
+ "Internals".
+
+   /MB
+@end ignore
+
+All of the information in a LilyPond input file, is internally
+represented as a Scheme value. In addition to normal Scheme data types
+(such as pair, number, boolean, etc.), LilyPond has a number of
+specialized data types,
+
+@itemize @bullet
+@item Input
+@item c++-function
+@item Music
+@item Identifier
+@item Translator_def
+@item Duration
+@item Pitch
+@item Score
+@item Music_output_def
+@item Moment (rational number)
+@end itemize
+
+LilyPond also includes some transient object types. Objects of these
+types are built during a LilyPond run, and do not `exist' per se within
+your input file. These objects are created as a result of your input
+file, so you can include commands in the input to manipulate them,
+during a lilypond run.
+
+@itemize @bullet
+@item Grob: short for Graphical object. 
+@item Molecule: device-independent page output object,
+including dimensions.  Produced by some Grob functions
+@item Translator: object that produces audio objects or Grobs. This is
+not yet user accessible.
+@item Font_metric: object representing a font.
+@end itemize
+
+
+@node Music expressions
+@subsection Music expressions
+
+@cindex music expressions
+
+Music in LilyPond is entered as a music expression.  Notes, rests, lyric
+syllables are music expressions, and you can combine music expressions
+to form new ones, for example by enclosing a list of expressions in
+@code{\sequential @{ @}} or @code{< >}.  In the following example, a
+compound expression is formed out of the quarter note @code{c} and a
+quarter note @code{d}:
+
+@example 
+\sequential @{ c4 d4 @} 
+@end example 
+
+@cindex Sequential music
+@cindex @code{\sequential}
+@cindex sequential music
+@cindex @code{<}
+@cindex @code{>}
+@cindex Simultaneous music
+@cindex @code{\simultaneous}
+
+The two basic compound  music expressions are simultaneous  and
+sequential music.
+
+@example
+  \sequential @code{@{} @var{musicexprlist} @code{@}}
+  \simultaneous @code{@{} @var{musicexprlist} @code{@}}
+@end example
+For both, there is a shorthand:
+@example
+  @code{@{} @var{musicexprlist} @code{@}}
+@end example
+for sequential and
+@example
+  @code{<} @var{musicexprlist} @code{>}
+@end example
+for simultaneous music.
+In principle, the way in which you nest sequential and simultaneous to
+produce music is not relevant.  In the following example, three chords
+are expressed in two different ways:
+
+@lilypond[fragment,verbatim,center]
+  \notes \context Voice {
+    <a c'> <b  d' > <c' e'>
+    < { a b  c' } { c' d' e' } >
+  }
+@end lilypond
+
+
+Other compound music expressions include
+@example
+ \repeat @var{expr}
+ \transpose @var{pitch} @var{expr}
+ \apply @var{func} @var{expr}
+ \context @var{type} = @var{id} @var{expr}
+ \times @var{fraction} @var{expr}
+@end example
+
+
+@c . {Manipulating music expressions}
+@node Manipulating music expressions
+@subsection  Manipulating music expressions
+
+The @code{\apply} mechanism gives you access to the internal
+representation of music. You can write Scheme-functions that operate
+directly on it. The syntax is 
+@example
+        \apply #@var{func} @var{music}
+@end example
+This means that @var{func} is applied to @var{music}.  The function
+@var{func} should return a music expression.
+
+This example replaces the text string of a script. It also shows a dump
+of the music it processes, which is useful if you want to know more
+about how music is stored.
+
+@lilypond[verbatim,singleline]
+#(define (testfunc x)
+        (if (equal? (ly-get-mus-property x 'text) "foo")
+                (ly-set-mus-property x 'text "bar"))
+        ;; recurse
+        (ly-set-mus-property x 'elements
+          (map testfunc (ly-get-mus-property x 'elements)))
+        (display x)
+        x        
+)
+\score { \notes
+  \apply #testfunc { c'4_"foo" }
+} 
+@end lilypond
+
+For more information on what is possible, see the automatically
+generated documentation.
+
+
+Directly accessing internal representations is dangerous: the
+implementation is subject to changes, so you should avoid this feature
+if possible.
+
+A final example is a function that reverses a piece of music in time:
+
+@lilypond[verbatim,singleline]
+#(define (reverse-music music)
+  (let* ((elements (ly-get-mus-property music 'elements))
+         (reversed (reverse elements))
+         (span-dir (ly-get-mus-property music 'span-direction)))
+    (ly-set-mus-property music 'elements reversed)
+    (if (dir? span-dir)
+        (ly-set-mus-property music 'span-direction (- span-dir)))
+    (map reverse-music reversed)
+    music))
+
+music = \notes { c'4 d'4( e'4 f'4 }
+
+\score { \context Voice {
+    \music
+    \apply #reverse-music \music
+  }
+}
+@end lilypond
+
+More examples are given in the distributed example files in
+@code{input/test/}.
+
+@c .   {Span requests}
+@menu
+* Span requests::               
+@end menu
+
+@node Span requests
+@subsection Span requests
+@cindex Span requests
+
+Notational constructs that start and end on different notes can be
+entered using span requests. The syntax is as follows:
+
+
+@example
+  \spanrequest @var{startstop} @var{type}
+@end example
+
+
+@cindex @code{\start}
+@cindex @code{\stop}
+
+This defines a spanning request. The @var{startstop} parameter is either
+-1 (@code{\start}) or 1 (@code{\stop}) and @var{type} is a string that
+describes what should be started.  Much of the syntactic sugar is a
+shorthand for @code{\spanrequest}, for example,
+
+@lilypond[fragment,verbatim,center]
+  c'4-\spanrequest \start "slur"
+  c'4-\spanrequest \stop "slur"
+@end lilypond
+
+Among the supported types are @code{crescendo}, @code{decrescendo},
+@code{beam}, @code{slur}. This is an internal command.  Users are
+encouraged to use the shorthands which are defined in the initialization
+file @file{spanners.ly}.
+
+
+@c .   {Assignments}
+@node Assignments
+@subsection Assignments
+@cindex Assignments
+
+Identifiers allow objects to be assigned to names during the parse
+stage.  To assign an identifier, you use @var{name}@code{=}@var{value}
+and to refer to an identifier, you precede its name with a backslash:
+`@code{\}@var{name}'.  @var{value} is any valid Scheme value or any of
+the input-types listed above.  Identifier assignments can appear at top
+level in the LilyPond file, but also in @code{\paper} blocks.
+
+An identifier can be created with any string for its name, but you will
+only be able to refer to identifiers whose names begin with a letter,
+being entirely alphabetical.  It is impossible to refer to an identifier
+whose name is the same as the name of a keyword.
+
+The right hand side of an identifier assignment is parsed completely
+before the assignment is done, so it is allowed to redefine an
+identifier in terms of its old value, e.g.
+
+@example
+foo = \foo * 2.0
+@end example
+
+When an identifier is referenced, the information it points to is
+copied.  For this reason, an identifier reference must always be the
+first item in a block.
+@example
+\paper  @{
+  foo = 1.0
+  \paperIdent % wrong and invalid
+@}
+
+\paper @{
+  \paperIdent % correct
+  foo = 1.0 @}
+@end example
+
+
+@c .  {Lexical modes}
+@node Lexical modes
+@subsection Lexical modes
+@cindex Lexical modes
+@cindex input mode
+@cindex mode, input 
+@cindex @code{\notes}
+@cindex @code{\chords}
+@cindex @code{\lyrics}
+
+To simplify entering notes, lyrics, and chords, LilyPond has three
+special input modes in addition to the default mode: note, lyrics and
+chords mode.  These input modes change the way that normal, unquoted
+words are interpreted: for example, the word @code{cis} may be
+interpreted as a C-sharp, as a lyric syllable `cis' or as a C-sharp
+major triad respectively.
+
+A mode switch is entered as a compound music expression
+@example
+@code{\notes} @var{musicexpr}
+@code{\chords} @var{musicexpr}
+@code{\lyrics} @var{musicexpr}.
+@end example
+
+In each of these cases, these expressions do not add anything to the
+meaning of their arguments.  They just instruct the parser in what mode
+to parse their arguments.
+
+Different input modes may be nested.
+
+@c .  {Ambiguities}
+@node Ambiguities
+@subsection Ambiguities
+@cindex ambiguities
+@cindex grammar
+
+
+The grammar contains a number of ambiguities. We hope to resolve them at
+some time.
+
+@itemize @bullet
+  @item  The assignment
+
+@example 
+foo = bar 
+@end example 
+         is interpreted as the string identifier assignment. However,
+it can also be interpreted as making a string identifier @code{\foo}
+containing @code{"bar"}, or a music identifier @code{\foo} containing
+the syllable `bar'.  The former interpretation is chosen.
+
+  @item  If you do a nested repeat like
+
+       @quotation
+
+@example 
+\repeat @dots{}
+\repeat @dots{}
+\alternative 
+@end example 
+
+       @end quotation
+
+       then it is ambiguous to which @code{\repeat} the
+       @code{\alternative} belongs.  This is the classic if-then-else
+       dilemma.  It may be solved by using braces.
+
+@end itemize
+
+@c .  {Lexical details}
+@node Lexical details
+@section Lexical details
+
+Even more boring details, now on lexical side of the input parser.
+
+@menu
+* Direct Scheme::               
+* Reals::                       
+* Strings::                     
+@end menu
+
+
+@node Direct Scheme
+@subsection Direct Scheme
+
+@cindex Scheme
+@cindex GUILE
+@cindex Scheme, in-line code
+
+
+
+@cindex GUILE
+@cindex Scheme
+@cindex accessing Scheme
+@cindex evaluating Scheme
+@cindex LISP
+
+LilyPond internally uses GUILE, a Scheme-interpreter. Scheme is a
+language from the LISP family. You can learn more about Scheme at
+@uref{http://www.scheme.org}. It is used to represent data throughout
+the whole program. The hash-sign (@code{#}) accesses GUILE directly: the
+code following the hash-sign is evaluated as Scheme.  The boolean value
+@var{true} is @code{#t} in Scheme, so for LilyPond @var{true} looks like
+@code{##t}.
+
+LilyPond contains a Scheme interpreter (the GUILE library) for
+internal use. In some places, Scheme expressions also form valid syntax:
+wherever it is allowed,
+@example
+  #@var{scheme}
+@end example
+evaluates the specified Scheme code.  Example:
+@example
+  \property Staff.TestObject \override #'foobar =  #(+ 1 2)
+@end example
+@code{\override} expects two Scheme expressions, so there are two Scheme
+expressions. The first one is a symbol (@code{foobar}), the second one
+an integer (namely, 3).
+
+In-line scheme may be used at the top level. In this case the result is
+discarded.
+
+Scheme is a full-blown programming language, and a full discussion is
+outside the scope of this document. Interested readers are referred to
+the website @uref{http://www.schemers.org/} for more information on
+Scheme.
+
+
+@node Reals
+@subsection Reals
+@cindex real numbers
+
+Formed from an optional minus sign and a sequence of digits followed
+by a @emph{required} decimal point and an optional exponent such as
+@code{-1.2e3}.  Reals can be built up using the usual operations:
+`@code{+}', `@code{-}', `@code{*}', and
+`@code{/}', with parentheses for grouping.
+
+@cindex @code{\mm},
+@cindex @code{\in}
+@cindex @code{\cm}
+@cindex @code{\pt}
+@cindex dimensions
+
+A real constant can be followed by one of the dimension keywords:
+@code{\mm} @code{\pt}, @code{\in}, or @code{\cm}, for millimeters,
+points, inches and centimeters, respectively.  This converts the number
+a number that is the internal representation of that dimension.
+
+
+@node Strings
+@subsection Strings
+@cindex string
+@cindex concatenate
+
+Begins and ends with the @code{"} character.  To include a @code{"}
+character in a string write @code{\"}.  Various other backslash
+sequences have special interpretations as in the C language.  A string
+that contains no spaces can be written without the quotes.  Strings can
+be concatenated with the @code{+} operator.
+
index 50c77843bb0179973e59f88dc0cd851659b44b2b..4e4a4d5610170d33ba2073ae79080c2e5eaa4b32 100644 (file)
+@c -*-texinfo-*-
+
 @node Introduction
 @chapter Introduction
 
-LilyPond is a free program that produces high quality sheet music.
-
-The features that set LilyPond apart from other music printing
-programs are
-
-@itemize
-@item Freely available under terms of the GNU GPL
-@item Carefully designed music font
-@item Lots of music formatting knowledge
-@item Sophisticated formatting functions
-@item Output is  configurable using Scheme
-@item Highly modular design
-@item Semantic input format
-@item Input can be generated, inspected and modified via builtin Scheme
- interpreter.
-@item Runs on both Unix and MS Windows
-@item Multiple output formats
-@item Easily embed musical fragments in LaTeX, Texinfo and HTML documents.
-@item Works as a compiler: edit input in your favorite text editor
-@end itemize
-
-If you need to print out existing arrangements, composition, new
-editions, or musical excercises, then LilyPond will suit you.
-LilyPond is not interactive, and is probably not suited for creating
-new compositions.
-
-@menu
-* Why LilyPond::               
-* The Feta Font::              
-* Engraving::                  
-* Semantic input format::      
-* A programming approach::     
-* About this manual::          
-* Bug reports::                        
-* Web site::                   
-@end menu
-
-@node Why LilyPond
-@section Why LilyPond
-
-LilyPond originally started out as an interesting hobby
-project. Intrigued by music notation we set out to write a program to
-produce high-quality music printouts, with minimal user intervention.
-
-Engraving, the art of printing music is a very complex craftmanship,
-that tries to make a typographically beautiful rendering of a piece of
-music.  The purpose of nicely engraved music is to ease the way music
-is read.  The typographical decisions have underlying logic, and to us
-scientists, this begs the question: what is this logic, and can we
-cast this logic into the more concrete form a computer program.
-
-LilyPond is our concrete answer to this question, but besides being an
-interesting hobby project, it also allows people that don't know much
-about notation and engraving to print fine sheet music.
-
-With LilyPond, we hope to give back a little to the Free Software
-Community that gave us so much, and if possible, give people the
-opportunity to publish sheet music with high quality layout.  In our
-utopic vision, some day LilyPond will help create more beautiful music.
-
-@node  The Feta Font
-@section The Feta Font
+LilyPond is a program to print sheet music. If you have used such
+programs before, then the way to use this program might be surprising
+at first sight. To print music with lilypond, you have to enter
+musical codes in a file. Then you run LilyPond on the file, and the
+music is produced without any user intervention. For example,
+something like this:
 
+@lilypond[fragment,verbatim, relative 1, intertext="produces this"]
+\key c \minor r8 c16 b c8 g as c16 b c8 d | g,4 
+@end lilypond
 
-Most of the rules concerning music symbols have not been explicitly
-laid down, so we have imitated the looks of symbols in beautiful hand
-engraved music. The starting point was to have a strong, bold look,
-with rounded symbol shapes, just like traditional engraving.
+We can very well imagine that encoding music using letters may appear
+strange, intimidating or even clumsy at first. Nevertheless, when you
+take the effort to learn the codes and the program you will find that
+it is not so difficult as it seems, entering music can be done
+quickly, and you never have to remember how you made the program do
+something complicated: it's all in the input code, and you only have
+read the file to see how it works. Moreover, when you use LilyPond,
+you are rewarded with very nicely looking output.
+
+This form of computing (produce the output in one go, without user
+intervention), is called @emph{batch} computing, and the program that
+is used is normally called a @emph{compiler}. In contrast, it is now
+fashionable to produce interactive programs that rely on a Graphical
+User Interface (GUI).
+
+When we started with developing LilyPond in a time that were studying
+at the university. Back then GUIs were not as ubiquitous as they are
+today, and we were immersed in the UNIX operating system, where it is
+very common to use compilers to achieve computing tasks, so our
+computerized music engraving experiment took on the form of a
+compiler.
+
+One other decision was also motivated by our academic background. In
+the scientific community it has always been a tradition to share
+knowledge, and to a lesser extent, to share the software you
+wrote. One of the most visible groups that stimulated this philosopy,
+was the Free Software Foundation, whose GNU project aimed to replace
+the closed and proprietary computing solutions with free (as in
+"Libre") variants. We jumped on that bandwagon, and that is the reason
+that you can still get LilyPond at no cost, and with no strings
+attached.
+
+When we started, we were interested in music notation, not as
+publishers or musicians, but as students and scientists. We wanted
+tried to figure to what extent formatting sheet music could be
+automated.  Making sheet music may seem trivial at first (``you print
+5 lines, and then put in the notes at different heights''),
+@emph{music engraving}, i.e. professional music typography, is in
+another ballpark.
+
+The term music engraving derives from the traditional process of music
+printing.  A few decades ago, sheet music was made by cutting and
+stamping the music mirrored into zinc or pewter plates. The plate
+would be inked, and the depressions caused by the cutting and stamping
+would hold ink thus forming an positive image. Stamping and cutting
+was completely done by hand, and making corrections was cumbersome, so
+engraving had to be correct in one go. As you can imagine this was a
+highly specialized skill, much more so than the traditional process of
+printing books.
+
+In fact, the traditional german craftmanship required six years of
+full-time training, before a student could call himself a master of
+the art. After that many more years of practical experience were
+needed to become an established music engraver.  Even today, in the
+era of high-speed computers, music requires lots of manual fine tuning
+before it acceptable to be published.
+
+The first step of making music prints is to have the symbols
+available.  Unfortunately, most of the knowledge about music engraving
+has not been laid down in an easily accessible form, so when we wanted
+to write a computer program to do create music typography, we
+encountered the first problem: there were no sets of musical symbols
+available: either they were not available freely, or they didn't look
+well to our subtle tastes. That was the reason for us to create a font
+of musical symbols, relying mostly on nice printouts of hand-engraved
+music.
 
-@iftex
-  {\font\fet=feta20 at 100pt
-  \fet\fetaquartrest\hskip 1cm\fetahalfhead\hskip 1cm\fetaflat}
-@end iftex
+@lilypond
+#(define magfact 2.0)
+\score {  \notes { as'2 r4 }
+         \paper {
+             linewidth = -1. 
+             \translator {
+                 \ScoreContext
+                 AccidentalPlacement \override #'right-padding = #3.0
+                 StaffSymbol \override #'transparent =   ##t
+                 Clef \override #'transparent = ##t
+                 TimeSignature \override #'transparent = ##t             
+                 Accidental \override #'font-magnification = #magfact
+                 Rest \override #'font-magnification = #magfact
+                 NoteHead \override #'font-magnification = #magfact
+                 Stem \override #'transparent = ##t
+                 } } }
+@end lilypond
 
-In the figure above, a few notable glyphs are shown. For example, in
-most music the half-notehead is not elliptic but diamond shaped.  The
-stem of a flat symbol should be slightly brushed, i.e. becoming wider
-at the top. Fine endings, such as the one on the bottom of the quarter
+In the figure above, a few notable glyphs are shown. For example, the
+half-notehead is not elliptic but slightly diamond shaped.  The stem
+of a flat symbol should be slightly brushed, i.e. becoming wider at
+the top. Fine endings, such as the one on the bottom of the quarter
 rest, should not end in sharp points, but rather in rounded shapes.
-
-Finally, the blackness of the font is carefully tuned to give a strong
-and dark visual impression. Many computer music fonts are rather
-light, leading to anemic look when they are printed.
-
-Although such details are not directly visible to the untrained eye,
-careful attention to such details gives lilypond output a more
-balanced appearance.  We believe that the Feta font is among the most
-elegant music font designs available today.
-
-The Feta font was implemented in the font design system METAFONT. The
-source code includes numerous comments on the specific design
-considerations of each glyph. PostScript Type1 versions of the font
-are also available.
-
-@node Engraving
-@section Engraving
-
-
-Music engraving used to be a craft requiring many years of training.
-In the old days, sheet music was made by cutting and stamping the
-music mirrored into zinc or pewter plates. The plate would be inked,
-and the depressions caused by the cutting and stamping would hold ink
-thus forming an positive image.
-
-Of all craftmanships, engraving was the most difficult to learn trade;
-completing the basic training took as long as six years.
-Unfortunately, little of this knowledge comes to us as explicitly
-formulated rules.
-
-The only books that specifically deal with music typography are the
-books by Ross, Wanske and Hader @cite{hader48,ross,wanske}, and we
-have found that are often lacking in detail. Of course, in order to
-accurately computerize a process, one has to have a very detailed
-description of what must be done.
+The blackness of the font must be carefully tuned to the thickness of
+lines, beams and slurs to give a strong yet balanced overall
+impression.
+
+It was a good decision to design our own font. The experience helps
+develop a typographical taste, and it makes one appreciate subtle
+design details. Without that experience, we would not have realized
+how ugly the fonts were that we admired at first.
+
+Producing a strong and balanced look is the real challenge of music
+engraving. It is a recurring theme with many variations. One of these
+variations is choosing spacing. The distances between notes should
+reflect the durations between notes, but adhering with mathematical
+precision to the duration will lead to a poor result. Shown here is an
+example of a motive, printed four times. It is printed using both
+exact, mathematical spacing, and with some corrections. Can you spot
+which is which?
 
 @lilypond
     \score { \notes {
+      \property Staff.NoteSpacing \set #'stem-spacing-correction
+        = #0.6
+      c'4 e''4 e'4 b'4 |
       c'4 e''4 e'4 b'4 |
       \property Staff.NoteSpacing \override #'stem-spacing-correction
       = #0.0
       \property Staff.StaffSpacing \override #'stem-spacing-correction
       = #0.0
-      c'4 e''4 e'4 b'4 |      
+      c'4 e''4 e'4 b'4 |
+      c'4 e''4 e'4 b'4 |            
     }
     \paper { linewidth = -1. } }
 @end lilypond
 
-@node Semantic input format
-@section Semantic input format
+The fragment that was printed uses only quarter notes: notes that are
+played in a constant regular rhythm. The spacing should reflect
+that. Unfortunately, the eye deceives us a little: the eye not only
+notices the distance between note heads, but also between consecutive
+stems. Depending on the different vertical positions, the notes of a
+upstem-downstem should be put farther apart, and the notes of a
+down-up combination should be put closer. The first two measures are
+printed with this correction, the last two measures without. The notes
+in the last two measures form downstem/upstems clumps of notes.
+
+Experts have the knowledge to make such adjustments themselves by
+hand. For a skilled engraver, a computer drawing program is sufficient
+to produce excellent music typography. However, laypeople don't have
+the knowledge to think of such details. For a musician, the interface
+of a program should be familiar. This is a place where there is a
+choice of two paradigms: most musicians are familiar with notation,
+and with music.  Most graphically oriented programs offer an interface
+that shows notation, and allow you to enter the music by placing notes
+on a staff. 
+
+
+Interactive programs always have to load and save their data from
+files on the disk.  In a program that deals with music notation, the
+notation always has to converted to some kind of representation of the
+music inside.
 
-One the key points of LilyPond, is that the input is musical: what you
-put into the program are musical concepts, such as pitches, durations,
-voices, etc.  The program then interprets these concepts, and produces
-graphic output: glyphs, curves, offsets.  In this way the program
-tries to act like an engraver. 
+[todo]
 
 
-If you only want to print music, this might not interest you so much,
-except for the fact that it means you don't have to worry much about
-formatting details.
+When we view the problem of making beautiful sheet music for a given
+piece of music as a scientific puzzle, then we can only solve that
+puzzle if it is well-stated. Hence, when we design an input format, we
+want it to be neatly defined and have precise semantics. Such formats
+also have the advantage of being easier to write code for. 
 
 
-Many music encodings exist today @cite{selfridge-field97:beyond-midi},
-but most of the encodings have not been tailored either for human use,
-or for processing it with a computer.  By its nature, LilyPond input
-has both features: it is concise, suitable for human input, and it can
-be processed automatically: it may be converted into MIDI or into print.
+Many music encodings exist today but most of the encodings have not
+been tailored either for human use, or for processing it with a
+computer.  By its nature, LilyPond input has both features: it is
+concise, suitable for human input, and it can be processed
+automatically: it may be converted into MIDI or into print.
 
 
 However, one big problem with music, is that there are no standards
@@ -167,57 +198,75 @@ shares this property with very music encodings. The recursive nature
 will appeal to the more hackerish musician.
 
 
-@node A programming approach
-@section A programming approach
 
-blabla
 
-@node  About this manual
-@section About this manual
+@ignore
 
-blabla
 
 
-@node Bug reports
-@section Bug reports
+Nowadays, we still don't know everything about music notation, and we
+are still trying to use
 
-@cindex bugs
-@cindex reporting bugs
 
+LilyPond is a free program that produces high quality sheet music.
 
-Since there is no finder's fee which doubles every year, there is no
-need to wait for the prize money to grow. So send a bug report today!
-
-LilyPond development moves quickly, so if you have a problem, it is
-wise to check if it has been fixed in a newer release.  If you think
-you found a bug, please send in a bugreport.  When you send us a
-bugreport, we have to diagnose the problem and if possible, duplicate
-it.  To make this possible, it is important that you include the
-following information in your report:
+The features that set LilyPond apart from other music printing
+programs are
 
-@itemize @bullet
+@itemize
+@item Freely available under terms of the GNU GPL
+@item Carefully designed music font
+@item Lots of music formatting knowledge
+@item Sophisticated formatting functions
+@item Output is  configurable using Scheme
+@item Highly modular design
+@item Semantic input format
+*@item Input can be generated, inspected and modified via builtin Scheme
+ interpreter.
+@item Runs on both Unix and MS Windows
+@item Multiple output formats
+@item Easily embed musical fragments in LaTeX, Texinfo and HTML documents.
+@item Works as a compiler: edit input in your favorite text editor
+@end itemize
 
-@item A sample input which causes the error.  Please have mercy on the
-developers, send a @emph{small} sample file.
+If you need to print out existing arrangements, composition, new
+editions, or musical excercises, then LilyPond will suit you.
+LilyPond is not interactive, and is probably not suited for creating
+new compositions.
 
-@item The version number of lilypond.
+@menu
+* Why LilyPond::               
+* The Feta Font::              
+* Engraving::                  
+* Semantic input format::      
+* A programming approach::     
+* About this manual::          
+* Bug reports::                        
+* Web site::                   
+@end menu
 
-@item A description of the platform you use (i.e., operating system,
-system libraries, whether you downloaded a binary release)
 
-@item If necessary, send a description of the bug itself.  If you
-include output a ly2dvi run, please use @code{--verbose} option of
-ly2dvi.
+@node Why LilyPond
+@section Why LilyPond
 
-@end itemize
+LilyPond originally started out as an interesting hobby
+project. Intrigued by music notation we set out to write a program to
+produce high-quality music printouts, with minimal user intervention.
 
-You can send the report to @email{bug-lilypond@@gnu.org}. This is a
-mailinglist, but you don't have to be subscribed to it to post.
+Engraving, the art of printing music is a very complex craftmanship,
+that tries to make a typographically beautiful rendering of a piece of
+music.  The purpose of nicely engraved music is to ease the way music
+is read.  The typographical decisions have underlying logic, and to us
+scientists, this begs the question: what is this logic, and can we
+cast this logic into the more concrete form a computer program.
 
+LilyPond is our concrete answer to this question, but besides being an
+interesting hobby project, it also allows people that don't know much
+about notation and engraving to print fine sheet music.
 
-@node Web site
-@section Web site
+With LilyPond, we hope to give back a little to the Free Software
+Community that gave us so much, and if possible, give people the
+opportunity to publish sheet music with high quality layout.  In our
+utopic vision, some day LilyPond will help create more beautiful music.
 
-If you are reading this manual in print, it is possible that the
-website contains updates to the manual. You can find the lilypond
-website at @uref{http://www.lilypond.org/}.
+@end ignore
index ed60a74322cc9f59915082565be2876c2af36d07..3b87a41261c6ab29c73a48a892817815bb6c1a37 100644 (file)
@@ -1,6 +1,12 @@
 @node Invoking LilyPond
-
 @chapter Invoking LilyPond
+
+@menu
+* Reporting bugs::             
+* Website::                    
+* Titling LilyPond scores::    
+@end menu
+
 @cindex Invoking LilyPond
 @cindex command line options
 @cindex options, command line
@@ -27,6 +33,7 @@ each be processed independently.  @footnote{The status of GUILE is not
 reset across invocations, so be careful not to change any default
 settings from within Scheme .}
 
+
 @section Command line options
 
 The following options are supported:
@@ -36,7 +43,10 @@ The following options are supported:
 @item -e,--evaluate=@var{code}
   Evaluates the Scheme @var{code} before parsing @file{.ly}
 files. Multiple @code{-e} options may be given. They will be evaluated
-sequentially.
+sequentially. The function @code{set-lily-option} may be invoked to
+set various debugging options.
+
+
 
 @item -f,--format=@var{format} Output format for sheet music. Choices
 are @code{tex} (for @TeX{} output, to be processed with plain @TeX{},
@@ -62,6 +72,8 @@ will be generated.
 Output rules to be included in Makefile.
 @item -o,--output=@var{FILE}
 Set the default output file to @var{FILE}.
+
+@ignore
 @item -s,--safe
 Disallow untrusted @code{\include} directives, in-line
 Scheme evaluation, backslashes in @TeX{}, code.
@@ -69,6 +81,8 @@ Scheme evaluation, backslashes in @TeX{}, code.
 @strong{WARNING}: the @code{--safe} option has not been reviewed for a
 long time. Do not rely on it for automatic invocation (e.g. over the
 web). Volunteers are welcome to do a new audit.
+@end ignore
+
 @item -v,--version
 Show version information 
 @item -V,--verbose
@@ -108,14 +122,14 @@ your @file{~/.login}
 These scripts set the following variables
 @table @code
 @item TEXMF
-This is to make sure that @TeX{} and lilypond find data files (among
-others @file{.tex}, @file{.mf} and @file{.tfm}). A typical setting would be
+ To make sure that @TeX{} and lilypond find data files (among
+others @file{.tex}, @file{.mf} and @file{.tfm}),
+you have to set @code{TEXMF} to point to the lilypond data
+file tree. A typical setting would be
 @example
 @{/usr/share/lilypond/1.6.0,@{!!/usr/share/texmf@}@}
 @end example
 
-you have to set @code{TEXMF} to point to the lilypond data
-file tree.
 
 @item GS_LIB
 For processing PostScript output (obtained with
@@ -154,3 +168,204 @@ This selects the language for the warning messages of LilyPond.
 @cindex LILYPONDPREFIX
 
 
+
+@cindex bugs
+@cindex reporting bugs
+
+@node Reporting bugs
+@section Reporting bugs
+
+Since there is no finder's fee which doubles every year, there is no
+need to wait for the prize money to grow. So send a bug report today!
+
+LilyPond development moves quickly, so if you have a problem, it is
+wise to check if it has been fixed in a newer release.  If you think
+you found a bug, please send in a bugreport.  When you send us a
+bugreport, we have to diagnose the problem and if possible, duplicate
+it.  To make this possible, it is important that you include the
+following information in your report:
+
+@itemize @bullet
+
+@item A sample input which causes the error.  Please have mercy on the
+developers, send a @emph{small} sample file.
+
+@item The version number of lilypond.
+
+@item A description of the platform you use (i.e., operating system,
+system libraries, whether you downloaded a binary release)
+
+@item If necessary, send a description of the bug itself.  If you
+include output a ly2dvi run, please use @code{--verbose} option of
+ly2dvi.
+
+@end itemize
+
+You can send the report to @email{bug-lilypond@@gnu.org}. This is a
+mailinglist, but you don't have to be subscribed to it to post.
+
+@node Website
+@section Website
+
+If you are reading this manual in print, it is possible that the
+website contains updates to the manual. You can find the lilypond
+website at @uref{http://www.lilypond.org/}.
+
+
+@node Titling LilyPond scores
+@section Titling LilyPond scores
+
+Nicely titled output is created through a separate program:
+@file{ly2dvi} is a script that uses LilyPond and La@TeX{} to create a
+nicely titled piece of sheet music, in DVI format or PostScript.
+
+@subsection Invoking ly2dvi
+
+@c ly2dvi needs at least one FILE, can't act as filter yet
+@example
+        ly2dvi [@var{option}]@dots{} @var{file}@dots{}
+@end example
+
+Ly2dvi supports the following options:
+
+@table @code
+@item -k,--keep
+    Keep the temporary directory including LilyPond and ly2dvi output
+files. The temporary directory is created in the current directory as @code{ly2dvi.dir}.
+@item -d,--dependencies
+    Write makefile dependencies for every input file.
+@item -h,--help
+    Print usage help.
+@item -I,--include=@var{dir}
+    Add @var{dir} to LilyPond's include path.
+@item -m,--no-paper
+    Produce MIDI output only.
+@item --no-lily
+    Do not run LilyPond; useful for debugging ly2dvi.
+@item -o,--output=@var{file}
+    Generate output to @var{file}.  The extension of @var{file} is ignored.
+@item -P,--postscript
+    Also generate PostScript output, using dvips.
+@item --preview
+    Also generate a picture of the first system of the score.
+@item -s,--set=@var{key}=@var{val}
+    Add @var{key}= @var{val} to the settings, overriding those specified
+in the files. Possible keys: @code{language}, @code{latexheaders},
+@code{latexpackages}, @code{latexoptions}, @code{papersize},
+@code{pagenumber}, @code{linewidth}, @code{orientation},
+@code{textheight}.
+@item -v,--version
+Show version information 
+@item -V,--verbose
+Be verbose
+@item -w,--warranty
+Show the warranty with which GNU LilyPond comes. (It comes with 
+@strong{NO WARRANTY}!)
+@end table
+
+@subsection Titling layout
+
+Ly2dvi extracts the following header fields from the LY files to
+generate titling:
+
+@table @code
+@item title
+    The title of the music. Centered on top of the first page.
+@item subtitle
+    Subtitle, centered below the title.
+@item poet
+    Name of the poet, left flushed below the subtitle.
+@item composer
+    Name of the composer, right flushed below the subtitle.
+@item meter
+    Meter string, left flushed below the poet.
+@item opus
+    Name of the opus, right flushed below the composer.
+@item arranger
+    Name of the arranger, right flushed below the opus.
+@item instrument
+    Name of the instrument, centered below the arranger
+@item piece
+    Name of the piece, left flushed below the instrument
+@item head
+    A text to print in the header of all pages. It is not called
+@code{header}, because @code{\header} is a reserved word in LilyPond.
+@item copyright
+    A text to print in the footer of the first page. Default is to 
+    print the standard footer also on the first page.
+@item footer
+    A text to print in the footer of all but the last page.
+@item tagline
+    Line to print at the bottom of last page. The default text is ``Lily
+was here, @var{version-number}''.
+@end table
+
+
+@cindex header
+@cindex footer
+@cindex page layout
+@cindex titles
+
+
+
+@subsection Additional parameters
+
+Ly2dvi responds to several parameters specified in a @code{\paper}
+section of the LilyPond file. They can be overridden by supplying a
+@code{--set} command line option.
+
+@table @code
+@item language
+    Specify La@TeX{} language: the @code{babel} package will be
+included.  Default: unset.
+
+        Read from the @code{\header} block.
+
+@item latexheaders
+    Specify additional La@TeX{} headers file.
+
+        Normally read from the @code{\header} block. Default value: empty
+
+@item latexpackages
+    Specify additional La@TeX{} packages file. This works cumulative,
+so you can add multiple packages using multiple @code{-s=latexpackages} options.
+       Normally read from the @code{\header} block. Default value:
+@code{geometry}.
+
+@item latexoptions
+    Specify additional options for the La@TeX{} @code{\documentclass}. You can put any valid value here. This was designed to allow ly2dvi to produce output for double-sided paper, with balanced margins and pagenumbers on alternating sides. To achieve this specify @code{twoside}
+
+@item orientation
+    Set orientation. Choices are @code{portrait} or @code{landscape}. Is
+read from the @code{\paper} block, if set.
+        
+@item textheight
+    The vertical extension of the music on the page. It is normally 
+    calculated automatically, based on the paper size.
+
+@item linewidth
+        The music line width. It is normally read from the @code{\paper}
+block.
+
+@item papersize
+   The paper size (as a name, e.g. @code{a4}). It is normally read from
+the @code{\paper} block.
+
+@item pagenumber
+   If set to @code{no}, no page numbers will be printed.
+
+
+  
+  @item fontenc
+     The font encoding, should be set identical to the @code{font-encoding}
+     property in the score.
+@end table
+
+@subsection Environment variables
+
+@table @code
+@item LANG
+selects the language for the warning messages of Ly2dvi and LilyPond.
+@end table
+
+
index 872f81b9de3fb8f654d5ecde8c28c2fee6f3309b..e14e543fbe1f4d965a669775e03a4fd1dd0390cc 100644 (file)
@@ -22,7 +22,7 @@
 @author    
 
 
-Copyright @copyright{} 1999--2001 by the authors
+Copyright @copyright{} 1999--2002 by the authors
 
   Permission is granted to copy, distribute and/or modify this document
   under the terms of the GNU Free Documentation License, Version 1.1
@@ -74,17 +74,14 @@ this and other documentation.
 @menu
 * Preface::                        Preface.
 * Introduction::                   What, Why, How.
-* Tutorial::                       A tutorial introduction to LilyPond.
+* Tutorial::                       A tutorial introduction to
+LilyPond.
 * Reference Manual::               Reference Manual.
+* Advanced Topics::                      How it all works.
 * Invoking LilyPond::              Operation.
-* Titling LilyPond scores::        Generating nice output with titles
-                                     using ly2dvi.
-* Upgrading from older LilyPond versions::
-                                     Upgrading input files.
-* Importing other formats::        Converting to lilypond source format.
+* Converting from other formats::        Converting to lilypond source format.
 * Merging text and music with lilypond-book::
                                    The lilypond-book manual.
-* Internals::                      How it all works.
 * Literature::                     Additional reading material.
 * Index::                          Unified index.
 * Refman appendix::
@@ -103,7 +100,6 @@ this and other documentation.
 @mbinclude internals.itely
 @mbinclude invoking.itexi
 @mbinclude ly2dvi.itexi
-@mbinclude convert-ly.itexi
 @mbinclude lilypond-book.itely
 @mbinclude converters.itely
 @mbinclude literature.itely
index f006c72319636b35818b3ac59a1eb0fb710259ce..61586ce44ff452af8df778304e955fca0de70d78 100644 (file)
@@ -17,7 +17,7 @@ unification for all different kinds of chord names.
 
 
 
-@item Gerou 19xx
+@item Gerou 1996
 
 Tom Gerou and Linda Lusk, Essential Dictionary of Music
 Notation.  Alfred Publishing, Van Nuys CA ISBN 0-88284-768-6
@@ -50,9 +50,10 @@ A standard work on music notation.
 Ted Ross, Teach yourself the art of music engraving and processing.
 Hansen House, Miami, Florida    1987
 
-This book is about engraving, i.e.  professional typesetting.  It contains
-directions on good typesetting, but the sections on reproduction
-technicalities, how to use pens and history are interesting.
+This book is about music engraving, i.e.  professional typesetting.
+It contains directions on stamping, use of pens and notational
+conventions.  The sections on reproduction technicalities, and history
+are also interesting.
 
 
 @item Stone 1980
@@ -60,9 +61,9 @@ technicalities, how to use pens and history are interesting.
 Kurt Stone, Music Notation in the Twentieth Century
 Norton, New York 1980.
 
-The most important book on notation in recent years: it describes music
-notation for modern serious music, but starts out with a thorough
-overview of existing traditional notation practices.
+This book describes music notation for modern serious music, but
+starts out with a thorough overview of existing traditional notation
+practices.
 
 @item Wanske 1988,
 
@@ -70,9 +71,10 @@ Helene Wanske, Musiknotation --- Von der Syntax des Notenstichs zum
 EDV-gesteuerten Notensatz.  Schott-Verlag, Mainz 1988.  ISBN
 3-7957-2886-x
 
-I. A very thorough overview of engraving practices of various
+A book in two parts: 
+1. A very thorough overview of engraving practices of various
 craftsmen. It includes detailed specs of characters, dimensions
-etc. II. a thorough overview of a anonymous (by now antiquated)
+etc. 2. a thorough overview of a anonymous (by now antiquated)
 automated system. EDV means E(lektronischen) D(aten)v(erarbeitung),
 electronic data processing.
 
index 89ba2d4ab28efd0c38c8326ec6cf2bc485c9ffc0..8b7ebf84410c52042cc7ef9de08e797beafab7cf 100644 (file)
@@ -1,158 +1,2 @@
 @c -*-texinfo-*-
 
-@node Titling LilyPond scores
-@chapter Titling LilyPond scores
-
-Nicely titled output is created through a separate program:
-@file{ly2dvi} is a script that uses LilyPond and La@TeX{} to create a
-nicely titled piece of sheet music, in DVI format or PostScript.
-
-@unnumberedsubsec Invoking ly2dvi
-
-@c ly2dvi needs at least one FILE, can't act as filter yet
-@example
-        ly2dvi [@var{option}]@dots{} @var{file}@dots{}
-@end example
-
-Ly2dvi supports the following options:
-
-@table @code
-@item -k,--keep
-    Keep the temporary directory including LilyPond and ly2dvi output
-files. The temporary directory is created in the current directory as @code{ly2dvi.dir}.
-@item -d,--dependencies
-    Write makefile dependencies for every input file.
-@item -h,--help
-    Print usage help.
-@item -I,--include=@var{dir}
-    Add @var{dir} to LilyPond's include path.
-@item -m,--no-paper
-    Produce MIDI output only.
-@item --no-lily
-    Do not run LilyPond; useful for debugging ly2dvi.
-@item -o,--output=@var{file}
-    Generate output to @var{file}.  The extension of @var{file} is ignored.
-@item -P,--postscript
-    Also generate PostScript output, using dvips.
-@item --preview
-    Also generate a picture of the first system of the score.
-@item -s,--set=@var{key}=@var{val}
-    Add @var{key}= @var{val} to the settings, overriding those specified
-in the files. Possible keys: @code{language}, @code{latexheaders},
-@code{latexpackages}, @code{latexoptions}, @code{papersize},
-@code{pagenumber}, @code{linewidth}, @code{orientation},
-@code{textheight}.
-@item -v,--version
-Show version information 
-@item -V,--verbose
-Be verbose
-@item -w,--warranty
-Show the warranty with which GNU LilyPond comes. (It comes with 
-@strong{NO WARRANTY}!)
-@end table
-
-@unnumberedsubsec Titling layout
-
-Ly2dvi extracts the following header fields from the LY files to
-generate titling:
-
-@table @code
-@item title
-    The title of the music. Centered on top of the first page.
-@item subtitle
-    Subtitle, centered below the title.
-@item poet
-    Name of the poet, left flushed below the subtitle.
-@item composer
-    Name of the composer, right flushed below the subtitle.
-@item meter
-    Meter string, left flushed below the poet.
-@item opus
-    Name of the opus, right flushed below the composer.
-@item arranger
-    Name of the arranger, right flushed below the opus.
-@item instrument
-    Name of the instrument, centered below the arranger
-@item piece
-    Name of the piece, left flushed below the instrument
-@item head
-    A text to print in the header of all pages. It is not called
-@code{header}, because @code{\header} is a reserved word in LilyPond.
-@item copyright
-    A text to print in the footer of the first page. Default is to 
-    print the standard footer also on the first page.
-@item footer
-    A text to print in the footer of all but the last page.
-@item tagline
-    Line to print at the bottom of last page. The default text is ``Lily
-was here, @var{version-number}''.
-@end table
-
-
-@cindex header
-@cindex footer
-@cindex page layout
-@cindex titles
-
-
-
-@unnumberedsubsec Additional parameters
-
-Ly2dvi responds to several parameters specified in a @code{\paper}
-section of the LilyPond file. They can be overridden by supplying a
-@code{--set} command line option.
-
-@table @code
-@item language
-    Specify La@TeX{} language: the @code{babel} package will be
-included.  Default: unset.
-
-        Read from the @code{\header} block.
-
-@item latexheaders
-    Specify additional La@TeX{} headers file.
-
-        Normally read from the @code{\header} block. Default value: empty
-
-@item latexpackages
-    Specify additional La@TeX{} packages file. This works cumulative,
-so you can add multiple packages using multiple @code{-s=latexpackages} options.
-       Normally read from the @code{\header} block. Default value:
-@code{geometry}.
-
-@item latexoptions
-    Specify additional options for the La@TeX{} @code{\documentclass}. You can put any valid value here. This was designed to allow ly2dvi to produce output for double-sided paper, with balanced margins and pagenumbers on alternating sides. To achieve this specify @code{twoside}
-
-@item orientation
-    Set orientation. Choices are @code{portrait} or @code{landscape}. Is
-read from the @code{\paper} block, if set.
-        
-@item textheight
-    The vertical extension of the music on the page. It is normally 
-    calculated automatically, based on the paper size.
-
-@item linewidth
-        The music line width. It is normally read from the @code{\paper}
-block.
-
-@item papersize
-   The paper size (as a name, e.g. @code{a4}). It is normally read from
-the @code{\paper} block.
-
-@item pagenumber
-   If set to @code{no}, no page numbers will be printed.
-
-
-  
-  @item fontenc
-     The font encoding, should be set identical to the @code{font-encoding}
-     property in the score.
-@end table
-
-@unnumberedsubsec Environment variables
-
-@table @code
-@item LANG
-selects the language for the warning messages of Ly2dvi and LilyPond.
-@end table
-
index 15e446bbab7b97bfe25fa68e25e5a4ccda235c87..326a4d290f74748881ce3217f1438963a658c100 100644 (file)
@@ -137,16 +137,31 @@ $\\flat$
 @uref{../lilypond-internals/\NAME\.html,\NAME\}
 @cindex \NAME\
 @end macro
-@macro seeinternals{NAME}
-See @internalsref{\NAME\}
-@end macro
 @end ifhtml
-@ifnothtml
-@macro seeinternals{NAME}
+
+@ifinfo
+@macro internalsref{NAME}
+@inforef{\NAME\,,lilypond-internals}
+@cindex \NAME\
 @end macro
+@end ifinfo
+
+@iftex
 @macro internalsref{NAME}
 @cindex \NAME\
-\NAME\
+@code{\NAME\}
 @end macro
-@end ifnothtml
+@end iftex
 
+
+@iftex
+@macro seeinternals{NAME}
+internals document,  @internalsref{\NAME\}
+@end macro
+@end iftex
+
+@ifnottex
+@macro seeinternals{NAME}
+@internalsref{\NAME\}
+@end macro
+@end ifnottex
index 6f62a3fbc0e4c2965fff27c0198532438c773cc4..5e33dd5ed54fb5784813f81deff5e4496ce4ea32 100644 (file)
@@ -15,7 +15,7 @@ philosophizing and heated e-mail exchanges Han-Wen started LilyPond in
 1996.  This time, Jan got sucked into Han-Wen's new project.  The rest
 is, as they say, history.
 
-@c some more here.
+[TODO some more here.]
 
 LilyPond would have been a far less useful program without the input
 of incountable number of individuals. We would like to thank all users
@@ -27,6 +27,7 @@ various piano support code, Heikki Junes for taking care of the
 Emacs-mode, Glen Prideaux for implementing lyric-phrasing.  Juergen
 Reuter for the ancient notation support, Rune Zedeler for many code
 improvements All translators that helped translate the error messages.
+Jeremie Lumbroso, 
 
 @ignore
   should mention many more people, these are from AUTHORS
index faa2711ee993fcdd19e7dca4956a3d17a1772dbe..9c5e35d000a3db67ce6de6a5e77779c54abe4dd5 100644 (file)
@@ -13,7 +13,6 @@
 @end macro
 
 
-
 @c .{Reference Manual}
 
 @node Reference Manual
@@ -35,13 +34,13 @@ encouraged to study the tutorial first.
 * Staff notation::              
 * Polyphony::                   
 * Beaming::                     
+* Accidentals::                 
 * Expressive marks::            
 * Ornaments::                   
 * Repeats::                     
 * Rhythmic music::              
 * Piano music::                 
 * Tablatures::                  
-* Lyrics::                      
 * Chords::                      
 * Writing parts::               
 * Ancient notation ::           
@@ -49,9 +48,6 @@ encouraged to study the tutorial first.
 * Page layout::                 
 * Output formats::              
 * Sound::                       
-* Interpretation context::      
-* Syntactic details::           
-* Lexical details::             
 @end menu
 
 @c FIXME: Note entry vs Music entry at top level menu is confusing.
@@ -75,7 +71,6 @@ blocks and @code{\paper} declarations.
 * Ties::                        
 * Automatic note splitting ::   
 * Tuplets::                     
-* Defining pitch names::        
 * Easy Notation note heads ::   
 @end menu
 
@@ -88,7 +83,6 @@ A note is printed by specifying its pitch, and then its duration.
 @lilypond[fragment,verbatim]
   cis'4 d'8 e'16 c'16
 @end lilypond
-The grob for a note head is called @internalsref{NoteHead}.
 
 @c .  {Pitches}
 @node Pitches
@@ -157,10 +151,8 @@ octave; each @code{,} lowers the pitch by an octave.
 @node Chromatic alterations
 @subsection Chromatic alterations
 
-Normally Accidentals signify that the pitch of a note differs from the
-key signature. Normally, they are printed automatically depending, but
-you may force accidentals in the following  ways:
-A reminder accidental
+Normally, accidentals are printed automatically, but you may force
+accidentals in the following ways: A reminder accidental
 @cindex reminder accidental
 @cindex @code{?}
 can be forced by adding an exclamation mark @code{!} after the pitch.  A
@@ -170,10 +162,8 @@ cautionary accidental,
 i.e., an accidental within parentheses can be obtained by adding the
 question mark `@code{?}' after the pitch.
 
-Each accidental symbol is an @internalsref{Accidental} grob. The
-placement of accidentals is handled by
-@internalsref{AccidentalPlacement}.
-
+The automatic production of accidentals can be tuned in many
+ways. Refer to @ref{Accidentals} for more information.
 
 @c .  {Rests}
 @node  Rests
@@ -186,8 +176,8 @@ A rest is entered like a note, with note name `@code{r}':
 r1 r2 r4 r8
 @end lilypond
 
-The grob is @internalsref{Rest}. Whole bar rests centered in the bar are
-specified using @code{R}, see @ref{Multi measure rests}.
+Whole bar rests centered in the bar are specified using @code{R}, see
+@ref{Multi measure rests}. See also @seeinternals{Rest}.
 
 For polyphonic music, it can be convenient to specify the rest position
 directly. You can do that by entering a note, with the keyword
@@ -251,12 +241,6 @@ produce any output, not even transparent output.
 @cindex duration
 @cindex @code{\duration}
 
-The syntax for a verbose duration specification is
-@example
- \duration @var{scmduration}
-@end example
-Here, @var{scmduration} is a Scheme object of type @code{Duration}.
-
 
 In Note, Chord, and Lyrics mode, durations may be designated by numbers
 and dots: durations are entered as their reciprocal values.  For notes
@@ -307,7 +291,10 @@ You can alter the length of duration by a fraction @var{N/M} by
 appending `@code{*}@var{N/M}' (or `@code{*}@var{N}' if @var{M=1}). This
 will not affect the appearance of the notes or rests produced.
 
-
+Durations can also be produced through GUILE extension mechanism. 
+@lilypond[verbatim,fragment]
+ c\duration #(make-duration 2 1)
+@end lilypond
 
 
 @node Ties
@@ -347,19 +334,20 @@ exactly the same concept.
 Ties should not be confused with slurs, which indicate articulation,
 and phrasing slurs, which indicate musical phrasing.
 
-The name of the tie grob is @internalsref{Tie}, and it is created in the
-@internalsref{Voice} context.
+See also  @seeinternals{Tie}.
+
 
 @refbugs
 
-At present, the tie is implemented as a separate thing, temporally
-located in between the notes. 
-Tieing only a subset of the note heads of a chord is not supported in a
-simple way.  It can be achieved by moving the tie-engraver into the Thread
-context and turning on and off ties per Thread.
+At present, the tie is represented as a separate event, temporally
+located in between the notes.  Tieing only a subset of the note heads
+of a chord is not supported in a simple way.  It can be achieved by
+moving the tie-engraver into the Thread context and turning on and off
+ties per Thread.
 
 @node Automatic note splitting 
 @subsection Automatic note splitting
+@c FIXME: This subsection doesn't belong in @ref{Note entry}.
 
 There is a facility for automatically converting long notes to  tied
 notes. This is done by replacing the @code{Note_heads_engraver} by the
@@ -378,9 +366,9 @@ notes. This is done by replacing the @code{Note_heads_engraver} by the
 @end lilypond
 
 This engraver splits all running notes at the bar line, and inserts
-ties. One of the uses of this is, is to debug complex scores: if the
-measures are not entirely filled, then the ties exactly show how much
-each measure is off.
+ties. One of its uses is to debug complex scores: if the measures are
+not entirely filled, then the ties exactly show how much each measure
+is off.
 
 @refbugs
 
@@ -427,52 +415,16 @@ denominator, but if you set it to the Scheme function
 @code{fraction-tuplet-formatter}, Lilypond will print @var{num}:@var{den}
 instead.
 
-@c todo: junk this?
-
-The typesetting of brackets and numbers is controlled by the properties
-@code{bracket-visibility} and @code{number-visibility}.  These
-properties can either be @code{#f}, @code{#t} or @code{'if-no-beam},
-meaning respectively off, on, and on if there is no beam. 
-
-@lilypond[fragment,  relative, singleline, verbatim]
-\property Voice.TupletBracket \set #'bracket-visibility = ##t
-\times 2/3{c'8 d e} \times 2/3{d4 e8} 
-\property Voice.TupletBracket \set #'bracket-visibility = #'if-no-beam
-\times 2/3{c d e} \times 2/3{d4 e8} 
-\property Voice.TupletBracket \set #'bracket-visibility = ##f
-\times 2/3{c d e} \times 2/3{d4 e8}
-\property Voice.TupletBracket \set #'number-visibility = ##f
-\times 2/3{c d e} \times 2/3{d4 e8}
-\property Voice.TupletBracket \set #'number-visibility = #'if-no-beam
-\times 2/3{c d e} \times 2/3{d4 e8}
-@end lilypond
 
 @cindex @code{tupletNumberFormatFunction}
 @cindex tuplet formatting 
 
-Tuplet brackets are printed as @internalsref{TupletBracket} grobs in
-the @internalsref{Voice} context.
-
-@c .  {Defining pitch names}
-@node Defining pitch names
-@subsection Defining pitch names
-
-@cindex defining pitch names
-@cindex pitch names, defining 
-
-Note names and chord modifiers can be customized for nationalities.  The
-syntax is as follows.
+See also @seeinternals{TupletBracket}.
 
-@cindex @code{\pitchnames}
-@cindex @code{\chordmodifiers}
-@example
-   \pitchnames @var{scheme-alist}
-   \chordmodifiers @var{scheme-alist}
-@end example
-
-See @file{ly/nederlands.ly} and @file{ly/chord-modifiers-init.ly} for
-specific examples on how to do this.
+@refbugs
 
+Nested tuplets are not formatted automatically. In this case, outer
+tuplet brackets should be moved automatically.
 
 @node Easy Notation note heads 
 @subsection Easy Notation note heads
@@ -492,17 +444,17 @@ Hal-Leonard Inc.  music publishers.
 }
 @end lilypond
 
-Note that @internalsref{EasyNotation} overrides a @internalsref{Score} context.  You
+Note that @code{EasyNotation} overrides a @internalsref{Score} context.  You
 probably will want to print it with magnification to make it more
-readable, see @ref{Output scaling}.
+readable.
 
 
 @cindex Xdvi
 @cindex ghostscript
 
-If you view the result with Xdvi, then staff lines will show through the
-letters.  Printing the postscript file obtained either by using dvips or
-the @code{-f ps} option of lilypond produces the correct result.
+If you view the result with Xdvi, then staff lines will show through
+the letters.  Printing the postscript file obtained with ly2dvi does
+produce the correct result.
 
 
 @node Easier music entry
@@ -591,7 +543,7 @@ additional @code{\relative} inside the @code{\transpose}.
 @cindex Bar check
 
 @cindex bar check
-@cindex @code{barCheckNoSynchronize}
+@cindex @code{barCheckSynchronize}
 @cindex @code{|}
 
 
@@ -615,8 +567,7 @@ durations. Incorrect durations often completely garble up the score,
 especially if it is polyphonic, so you should start correcting the score
 by scanning for failed bar checks and incorrect durations.  To speed up
 this process, you can use @code{skipTypesetting} (See @ref{Skipping
-corrected music})). Bar
-
+corrected music})). 
 
 @c .  {Point and click}
 @node Point and click
@@ -636,18 +587,16 @@ Xdvi} version 22.36 or newer.
   Note that most @TeX{} distributions ship with xdvik, which is a
   different and less well maintained program. To find out which xdvi you
   are running, try @code{xdvi --version} or @code{xdvi.bin --version}.
-@item emacs
+@item Emacs. Emacs is an extensible text-editor It is available from
+@uref{http://www.gnu.org/software/emacs/}. You need version 21 to use
+column location.
 @end itemize
 
-Xdvi must be configured to find the TeX fonts and music
+Xdvi must be configured to find the @TeX{} fonts and music
 fonts. Refer to the Xdvi documentation for more information.
 
-
 To use point-and-click, add one of these lines to the top of your .ly
-file. The first one is for line location only. The second one is more
-convenient, but requires patching @code{emacsclient} and
-@code{server.el}.
-
+file.
 @example
 #(set! point-and-click line-location)
 @end example
@@ -657,49 +606,33 @@ In the emacs startup file (usually @file{~/.emacs}), add the following
 (server-start)
 @end example
 
-Make sure that  the environment  variable @code{XEDITOR} is set
-to
+Make sure that the environment variable @code{XEDITOR} is set to
 @example
 emacsclient --no-wait +%l %f
 @end example
-The second one, that also specifies the column, only works if you have
-patched your emacsclient and server, and have compiled your @code{.ly}
-file using the @code{line-column-location} setting.
 
-When viewing, control-mousebutton 1 will take you to the originating
-spot in the @file{.ly} file. Control-mousebutton 2 will show all
+When viewing, Control-Mousebutton 1 will take you to the originating
+spot in the @file{.ly} file. Control-Mousebutton 2 will show all
 clickable boxes.
 
-If you want emacs to jump to the exact spot (and not just the line) on a
-click, you must enable column positioning. To do so, you need to patch
-emacsclient. Apply @file{emacsclient.patch} (included with the source
-package) to @file{emacsclient.c} and @file{server.el} from the emacs
-source code. Recompile and stick the recompiled emacsclient into a bin
-directory, and put @file{server.el} into a elisp directory
-(e.g. @file{~/usr/share/emacs/}). Add the following to your
-@file{.emacs} init file, before invoking server-start.
-
-@example
- (setq load-path (cons "~/usr/share/emacs" load-path))
-@end example
-
-Set @code{XEDITOR} to @code{emacsclient --no-wait +%l:%c %f}
-
-At the top of the @code{ly} file, replace the @code{set!} line with the
-following line
+If you use Emacs version 21, then you can make emacs jump to the exact
+spot (and not just the line) on a click, you must enable column
+positioning.  At the top of the @code{ly} file, replace the
+@code{set!} line with the following line
 @example
 #(set! point-and-click line-column-location)
 @end example
+Set @code{XEDITOR} to @code{emacsclient --no-wait +%l:%c %f}.
 
-One final hint: if you correct large files with point-and-click, then
-start correcting at the end of the file. When you start at the top, and
-insert one line, all subsequent locations will be off by a line.
+If you correct large files with point-and-click, be sure to start
+correcting at the end of the file. When you start at the top, and
+insert one line, all following locations will be off by a line.
 
 
 @refbugs
 
 When you convert the @TeX{} file to PostScript using @code{dvips}, it
-will complain about not finding @code{src:X:Y} files. Those complaints
+will complain about not finding @code{src:X:Y} files. These complaints
 are harmless, and can be ignored.
 
 @node Skipping corrected music
@@ -725,6 +658,9 @@ c d b bes a g c2 }
 @node Staff notation
 @section Staff notation
 
+This section deals with music notation that occurs on staff level,
+such as keys, clefs and time signatures.
+
 @cindex Staff notation
 
 @menu
@@ -822,23 +758,10 @@ name. For example,
 The grob for this symbol is @internalsref{Clef}. 
 
 
-The full syntax for this command is 
-@example
-  \clef @var{clefname}
-@end example
-where @var{clefname} is a string. This command is a shortcut for
-@example
-  \property Staff.clefGlyph = @var{glyph associated with clefname} 
-  \property Staff.clefPosition = @var{clef Y-position for clefname}
-  \property Staff.centralCPosition = @var{position for central C} 
-  \property Staff.clefOctavation = @var{extra transposition of clefname}
-@end example
-Upon any change in these properties lilypond creates a clef
-symbol. The mapping from @var{clefname} to the property values can be
-found in @file{scm/clef.scm}
-
-
-
+This command is equivalent to setting @code{clefGlyph},
+@code{clefPosition} (which controls the Y position of the clef),
+@code{centralCPosition} and @code{clefOctavation}. A clef is created
+when any of these properties are changed.
 
 
 @c .  {Time signature}
@@ -854,40 +777,22 @@ command.
  \time 2/4 c'2 \time 3/4 c'2. 
 @end lilypond
 
-The actual symbol that's printed can be customized with the style
-property.
-@lilypond[fragment, verbatim, singleline]
-\time 3/4 s2
-\property Staff.TimeSignature \override #'style = #'C
-\time 4/4 s2
-\property Staff.TimeSignature \override #'style = #'()
-\time 4/4 s2
-\property Staff.TimeSignature \override #'style = #'C
-\time 2/2 s2
-@end lilypond
+The actual symbol that's printed can be customized with the @code{style}
+property. Setting it to @code{#'()} uses fraction style for 4/4 and
+2/2 time.
+
 
 The grob for this symbol is @internalsref{TimeSignature}.  There are
 many more options for its layout. They are selected through the
 @code{style} grob property. See @file{input/test/time.ly} for more
 examples.
 
-
-The full syntax for this command is
-@example
-  \time @var{n}@code{/}@var{d} 
-@end example
-where @var{n} and @var{d} are integers. This command is internally
-translated, to the following:
-@example
-\property Score.timeSignatureFraction = #'(@var{n} . @var{d})
-\property Score.beatLength = #(make-moment 1 @var{d})
-\property Score.measureLength = #(make-moment @var{n} @var{d})
-@end example
-
-The property @code{timeSignatureFraction} determine where bar lines
-should be inserted, and how automatic beams should be generated.
-Changing the value of @code{timeSignatureFraction} also causes a
-fraction to be printed. 
+This command sets the property @code{timeSignatureFraction},
+@code{beatLength} and @code{measureLength}.  The property
+@code{timeSignatureFraction} determine where bar lines should be
+inserted, and how automatic beams should be generated.  Changing the
+value of @code{timeSignatureFraction} also causes a time signature
+symbol to be printed.
 
 @c .   {Partial}
 @subsection Partial
@@ -902,7 +807,7 @@ fraction to be printed.
 Partial measures, for example in upbeats, are entered using the
 @code{\partial} command:
 @lilypond[fragment,verbatim]
-\partial 4* 5/16  c'16 c8. f16 a'2. ~ a'8. a'16 | g'1
+\partial 4* 5/16  c'16 c4 f16 a'2. ~ a'8. a'16 | g'1
 @end lilypond
 
 The syntax for this command is 
@@ -922,21 +827,20 @@ indicating how much of the measure has passed at this point.
 @subsection Unmetered music
 
 Bar lines and bar numbers are calculated automatically. For unmetered
-music (e.g. cadenzas), this is not desirable. The property
-@code{Score.timing} can be used to switch off this automatic timing
+music (e.g. cadenzas), this is not desirable.  The commands
+@code{\cadenzaOn} and @code{\cadenzaOff} can be used to switch off the
+timing information:
 
 @lilypond[fragment,relative,singleline,verbatim]
 c'2.
-\property Score.timing = ##f
+\cadenzaOn
 c2
-\property Score.timing = ##t
+\cadenzaOff
 c4 c4 c4 
 @end lilypond
 
-The identifiers @code{\cadenzaOn} and @code{\cadenzaOff} can be used as
-shortcuts.
-
-
+The property @code{Score.timing} can be used to switch off this
+automatic timing
 
 @c .   {Bar lines}
 @node Bar lines
@@ -947,10 +851,9 @@ shortcuts.
 @cindex measure lines
 @cindex repeat bars
 
-Bar lines are inserted automatically by, but if you need a special
-types of barline, you can force one using the @code{\bar} command:
-@lilypond[fragment,verbatim]
-  c4 \bar "|:" c4
+Bar lines are inserted automatically, but if you need a special type
+of barline, you can force one using the @code{\bar} command:
+@lilypond[fragment,verbatim] c4 \bar "|:" c4
 @end lilypond
 
 The following bar types are available
@@ -984,21 +887,8 @@ top level, and they are connected between different staffs of a
 The grobs that are created at @internalsref{Staff} level. The name is
 @internalsref{BarLine}.
 
-The full syntax for this command is  
-@example
-  \bar @var{bartype}
-@end example
-where @var{bartype} is a string. This is a shortcut for doing
-@example
-  \property Score.whichBar = @var{bartype} 
-@end example
-
-
-@cindex Bar_line_engraver
-@cindex whichBar
-@cindex repeatCommands
-@cindex defaultBarType
-
+The command @code{\bar @var{bartype}} is a short cut for
+doing  @code{\property Score.whichBar = @var{bartype}}
 Whenever @code{whichBar} is set to a string, a bar line of that type is
 created.  @code{whichBar} is usually set automatically: at the start of
 a measure it is set to @code{defaultBarType}. The contents of
@@ -1008,32 +898,37 @@ a measure it is set to @code{defaultBarType}. The contents of
 @code{\bar  }.  These settings take precedence over the automatic
 @code{whichBar} settings. 
 
+
+@cindex Bar_line_engraver
+@cindex whichBar
+@cindex repeatCommands
+@cindex defaultBarType
+
+
+
 @c .   {Polyphony}
 @node Polyphony
 @section Polyphony
 @cindex polyphony
 
-Polyphonic parts, i.e. parts with more than one voice on a staff can be
-typeset with LilyPond.
-
-The easiest way to enter such fragments, is the Scheme function
-@code{voicify-music}. It will split chords using the separator
-@code{\\}, to make multiple voices.  You can use it for small,
-short-lived voices (make a chord of voices) or for single chords:
+The easiest way to enter such fragments with more than one voice on a
+staff is to split chords using the separator @code{\\}.  You can use
+it for small, short-lived voices (make a chord of voices) or for
+single chords:
 
 @lilypond[verbatim,fragment]
-\context Voice = VA \apply #voicify-music \relative c'' {
+\context Voice = VA \relative c'' {
  c4 < { f d e  } \\ { b c2 } > c4 < g' \\ b, \\  f \\ d >
 }
 @end lilypond
 
-The function @code{voicify-music} instantiates @internalsref{Voice}
-contexts, bearing the names @code{"1"}, @code{"2"}, etc.
+The separator causes @internalsref{Voice} contexts to be instantiated,
+bearing the names @code{"1"}, @code{"2"}, etc.
 
-To explicity typeset polyphonic music, instantiate a separate Voice
-context for each part, and use @code{\voiceOne}, up to
-@code{\voiceFour} to assign a stem directions and horizontal shift for
-each part.
+Sometimes, it is necessary to instantiate these contexts by hand: For
+Instantiate a separate Voice context for each part, and use
+@code{\voiceOne}, up to @code{\voiceFour} to assign a stem directions
+and horizontal shift for each part.
 @c
 
 @lilypond[singleline, verbatim]
@@ -1069,7 +964,7 @@ horizontal shifts and stem directions, as is shown  in the following example:
 Normally, note heads with a different number of dots are not merged, but
 if you set the grob property @code{merge-differently-dotted}, they are:
 @lilypond[verbatim,fragment,singleline]
-\apply #voicify-music < {
+\context Voice < {
      g'8 g'8 
      \property Staff.NoteCollision \override
         #'merge-differently-dotted = ##t
@@ -1081,7 +976,7 @@ if you set the grob property @code{merge-differently-dotted}, they are:
 Similarly, you can merge half note heads with eighth notes, by setting
 @code{merge-differently-headed}:
 @lilypond[fragment, relative=2,verbatim]
-\apply #voicify-music < {
+\context Voice < {
     c8 c4.
     \property Staff.NoteCollision
       \override #'merge-differently-headed = ##t
@@ -1091,16 +986,10 @@ Similarly, you can merge half note heads with eighth notes, by setting
 LilyPond also vertically shifts rests that are opposite of a stem. 
 
 @lilypond[singleline,fragment,verbatim]
-\context Voice \apply #voicify-music <
- { c''4  } \\  { r4 }
->
+\context Voice < c''4 \\  r4 >
 @end lilypond
 
-Note head collisions (horizontal shifting of note heads) are handled by
-the @internalsref{NoteCollision} grob. @internalsref{RestCollision}
-handles vertical shifting of rests.
-
-
+See also @internalsref{NoteCollision} and @internalsref{RestCollision}
 
 @refbugs
 
@@ -1123,8 +1012,7 @@ If you're not satisfied with the automatic beaming, you can enter the
 beams explicitly. If you have beaming patterns that differ from the
 defaults, you can also set the patterns for automatic beamer.
 
-The beam symbol is @internalsref{Beam} in @internalsref{Voice}
-context, both for automatically created and manual beams.
+See also @internalsref{Beam}.
 
 @c .    {Manual beams}
 @cindex Automatic beams
@@ -1151,7 +1039,7 @@ Normally, beaming patterns within a beam are determined automatically.
 When this mechanism fouls up, the properties
 @code{Voice.stemLeftBeamCount} and @code{Voice.stemRightBeamCount} can
 be used to control the beam subdivision on a stem.  If you set either
-property, it's value will be used only once, and then it is erased.
+property, its value will be used only once, and then it is erased.
 
 @lilypond[fragment,relative,verbatim]
   \context Staff {
@@ -1161,36 +1049,34 @@ property, it's value will be used only once, and then it is erased.
 @end lilypond
 @cindex @code{stemRightBeamCount}
 
-@ignore
-TODO: FIXME, we don't want this doc here.
-
- can be tweaked through
-grob-property @code{positions}. The value is a pair.
-specify vertical location of the left and right end point. Both are
-measured in half staff-spaces, and the middle staff line is the value
-of 0.
-
-@li lypond[fragment,relative,verbatim]
-  \property Voice.Beam \set #'position = #
-  \property Voice.Beam \set #'height = #0
-  [a'8 e' d c]
-@end lilyp ond
-
-Here's how you'd specify a weird looking beam that instead of being
-horizontal, falls two staff spaces:
-
 
-[FIXME]
+The property @code{subdivideBeams} can be set in order to subdivide
+all 16th or shorter beams at beat positions.  This accomplishes the
+same effect as twiddling with @code{stemLeftBeamCount} and
+@code{stemRightBeamCount}, but it take less typing.
 
 
-@li lypond[fragment,relative,verbatim]
-  \property Voice.Beam \set #'staff-position = #4
-  \property Voice.Beam \set #'height = #-4
-  [c8 c] 
+@example
+[c16 c c c c c c c]
+\property Voice.subdivideBeams = ##t
+[c16 c c c c c c c]
+[c32 c c c c c c c c c c c c c c c]
+\property Score.beatLength = #(make-moment 1 8)
+[c32 c c c c c c c c c c c c c c c]
+@end example
+@lilypond[]
+\score {
+    \notes \relative c' {
+        [c16 c c c c c c c]
+        \property Voice.subdivideBeams = ##t
+        [c16 c c c c c c c]
+        [c32 c c c c c c c c c c c c c c c]
+        \property Score.beatLength = #(make-moment 1 8)
+        [c32 c c c c c c c c c c c c c c c]
+    }
+}
 @end lilypond
-
-@end ignore
-
+@cindex subdivideBeams
 
 Kneed beams are inserted automatically, when a large gap between two
 adjacent beamed notes is detected. This behavior can be tuned through
@@ -1210,12 +1096,12 @@ the grob property @code{auto-knee-gap}.
 Auto knee beams can not be used together with hara kiri staffs.
 
 @menu
-* Beam typography::             
 * Setting automatic beam behavior ::  
 @end menu
 
-@node Beam typography
-@subsection Beam typography
+@ignore
+@no de Beam typography
+@sub section Beam typography
 
 One of the strong points of LilyPond is how beams are formatted. Beams
 are quantized, meaning that the left and right endpoints beams start
@@ -1229,7 +1115,7 @@ less than the slope of the notes themselves.
 Some beams should be horizontal. These are so-called concave beams. 
 
 [TODO: some pictures.]
-
+@end ignore
 
 @c .    {Automatic beams}
 @node Setting automatic beam behavior 
@@ -1325,6 +1211,232 @@ It is not possible to specify beaming parameters that act differently in
 different parts of a measure. This means that it is not possible to use
 automatic beaming in irregular meters such as @code{5/8}.
 
+@node Accidentals
+@section Accidentals
+@cindex Accidentals
+This section describes how to change the way that LilyPond automatically
+inserts accidentals before the running notes.
+
+@menu
+* Using the predefined accidental macros::  
+* Defining your own accidental typesettings::  
+@end menu
+
+@node Using the predefined accidental macros
+@subsection Using the predefined accidental macros
+The constructs for describing the accidental typesetting rules are
+quite hairy, so non-experts should stick to the macros defined in
+@file{ly/property-init.ly}.
+@cindex @file{property-init.ly}
+
+The normal way of using the macros is to enter the macro name right after the
+creation of the context in which the accidental typesetting described
+by the macro is to take effect. I.e. if you want to use
+piano-accidentals in a pianostaff then you issue
+@code{\pianoAccidentals} first thing after the creation of the piano
+staff:
+@example
+\score @{
+    \notes \relative c'' <
+        \context Staff = sa @{ cis4 d e2 @}
+        \context GrandStaff <
+            \pianoAccidentals
+            \context Staff = sb @{ cis4 d e2 @}
+            \context Staff = sc @{ es2 c @}
+        >
+        \context Staff = sd @{ es2 c @}
+    >
+@}
+@end example
+@lilypond[singleline]
+\score {
+    \notes \relative c'' <
+        \context Staff = sa { cis4 d e2 }
+        \context GrandStaff <
+            \pianoAccidentals
+            \context Staff = sb { cis4 d e2 }
+            \context Staff = sc { es2 c }
+        >
+        \context Staff = sd { es2 c }
+    >
+    \paper {
+        \translator {
+            \StaffContext
+            minimumVerticalExtent = #'(-4.0 . 4.0)
+        }
+    }
+}
+@end lilypond
+
+The macros are:
+@table @code
+@item \defaultAccidentals
+      @cindex @code{\defaultAccidentals}
+      This is the default typesetting behaviour. It should correspond
+      to 18th century common practice: Accidentals are
+      remembered to the end of the measure in which they occur and
+      only on their own octave.
+
+@item \voiceAccidentals
+      @cindex @code{\voiceAccidentals}
+      The normal behaviour is to remember the accidentals on
+      Staff-level.
+      This macro, however, typesets accidentals individually for each
+      voice.
+      Apart from that the rule is similar to
+      @code{\defaultAccidentals}.
+
+      Warning: This leads to some weird and often unwanted results
+      because accidentals from one voice DO NOT get cancelled in other
+      voices:
+@lilypond[singleline,relative,fragment,verbatim]
+    \context Staff <
+        \voiceAccidentals
+        \context Voice=va { \voiceOne es g }
+        \context Voice=vb { \voiceTwo c, e }
+    >
+@end lilypond
+      Hence you should only use @code{\voiceAccidentals}
+      if the voices are to be read solely by
+      individual musicians. if the staff should be readable also
+      by one musician/conductor then you should use
+      @code{\modernVoiceAccidentals} or @code{\modernVoiceCautionaries}
+      instead.
+
+@item \modernAccidentals
+      @cindex @code{\modernAccidentals}
+      This rule should correspond to the common practice in the 20th
+      century.
+      The rule is a bit more complex than @code{\defaultAccidentals}:
+      You get all the same accidentals, but temporary
+      accidentals also get cancelled in other octaves. Further more,
+      in the same octave, they also get cancelled in the following measure:
+@lilypond[singleline,fragment,verbatim]
+      \modernAccidentals
+      cis' c'' cis'2 | c'' c'
+@end lilypond
+
+@item \modernCautionaries
+      @cindex @code{\modernCautionaries}
+     This rule is similar to @code{\modernAccidentals}, but the
+     ``extra'' accidentals (the ones not typeset by
+     @code{\defaultAccidentals}) are typeset as cautionary accidentals
+     (i.e. in reduced size):
+@lilypond[singleline,fragment,verbatim]
+      \modernCautionaries
+      cis' c'' cis'2 | c'' c'
+@end lilypond
+
+@item \modernVoiceAccidentals
+      @cindex @code{\modernVoiceAccidentals}
+      Multivoice accidentals to be read both by musicians playing one voice
+      and musicians playing all voices.
+
+      Accidentals are typeset for each voice, but they ARE cancelled
+      across voices in the same @internalsref{Staff}.
+
+@item \modernVoiceCautionaries
+      @cindex @code{\modernVoiceCautionaries}
+      The same as @code{\modernVoiceAccidentals}, but with the
+      extra accidentals (the ones not typeset by
+      @code{\voiceAccidentals}) typeset as cautionaries.
+      Notice that even though all accidentals typeset by
+      @code{\defaultAccidentals} ARE typeset by this macro then some
+      of them are typeset as cautionaries.
+
+@item \pianoAccidentals
+      @cindex @code{\pianoAccidentals}
+      20th century practice for piano notation. Very similar to
+      @code{\modernAccidentals} but accidentals also get cancelled
+      across the staves in the same @internalsref{GrandStaff} or
+      @internalsref{PianoStaff}.
+
+@item \pianoCautionaries
+      @cindex @code{\pianoCautionaries}
+      As @code{\pianoAccidentals} but with the extra accidentals
+      typeset as cationaries.
+
+@item \noResetKey
+      @cindex @code{\noResetKey}
+      Same as @code{\defaultAccidentals} but with accidentals lasting
+      ``forever'' and not only until the next measure:
+@lilypond[singleline,fragment,verbatim,relative]
+      \noResetKey
+      c1 cis cis c
+@end lilypond
+
+@item \forgetAccidentals
+      @cindex @code{\forgetAccidentals}
+      This is sort of the opposite of @code{\noResetKey}: Accidentals
+      are not remembered at all - and hence all accidentals are
+      typeset relative to the key signature, regardless of what was
+      before in the music:
+@lilypond[singleline,fragment,verbatim,relative]
+      \forgetAccidentals
+      \key d\major c4 c cis cis d d dis dis
+@end lilypond
+@end table
+
+@node Defining your own accidental typesettings
+@subsection Defining your own accidental typesettings
+
+This section must be considered gurus-only, and hence it must be
+sufficient with a short description of the system and a reference to
+the internal documentation.
+
+The idea of the algorithm is to try several different rules and then
+use the rule that gives the highest number of accidentals.
+Each rule cosists of
+@table @asis
+@item Context:
+      In which context is the rule applied. I.e. if context is
+      @internalsref{Score} then all staves share accidentals, and if
+      context is @internalsref{Staff} then all voices in the same
+      staff share accidentals, but staves don't - like normally.
+@item Octavation:
+      Whether the accidental changes all octaves or only the current
+      octave.
+@item Lazyness:
+      Over how many barlines the accidental lasts.
+      If lazyness is @code{-1} then the accidental is forget
+      immidiately, and if lazyness is @code{#t} then the accidental
+      lasts forever.
+@end table
+
+As described in the internal documentation of
+@reng{Accidental_engraver}, the properties @code{autoAccidentals} and
+@code{autoCautionaries} contain lists of rule descriptions. Notice
+that the contexts must be listed from in to out - that is
+@internalsref{Thread} before @internalsref{Voice},
+@internalsref{Voice} before @internalsref{Staff}, etc. 
+see the macros in @file{ly/property-init.ly} for examples of how the
+properties are set.
+
+@refbugs
+
+Currently the simultaneous notes are considered to be entered in
+sequential mode. This means that in a chord the accidentals are
+typeset as if the notes in the chord happened one at a time - in the
+order in which they appear in the input file.
+
+Of course this is only a problem when you have simultainous notes
+which accidentals should depend on each other.
+Notice that the problem only occurs when using non-default accidentals
+- as the default accidentals only depend on other accidentals on the
+same staff and same pitch and hence cannot depend on other
+simultainous notes.
+
+This example shows two examples of the same music giving different
+accidentals depending on the order in which the notes occur in the
+input file:
+
+@lilypond[singleline,fragment,verbatim]
+\property Staff.autoAccidentals = #'( Staff (any-octave . 0) )
+cis'4 <c'' c'> r2 | cis'4 <c' c''> r2 | <cis' c''> r | <c'' cis'> r | 
+@end lilypond
+
+The only solution is to manually insert the problematic
+accidentals using @code{!} and @code{?}.
 
 @node Expressive marks
 @section Expressive marks
@@ -1348,8 +1460,7 @@ They are entered using parentheses:
   f'()g'()a' [a'8 b'(] a'4 g'2 )f'4
 @end lilypond
 
-The grob for this object is @internalsref{Slur}, generally in
-@internalsref{Voice} context.
+See also @seeinternals{Slur}.
 
 Slurs avoid crossing stems, and are generally attached to note heads.
 However, in some situations with beams, slurs may be attached to stem
@@ -1377,32 +1488,38 @@ stems might look better:
   d,32( d'4 )d8..
 @end lilypond
 
-
+@ignore
 Similarly, the curvature of a slur is adjusted to stay clear of note
 heads and stems.  When that would increase the curvature too much, the
-slur is reverted to its default shape.  The threshold for this decision
-is in @internalsref{Slur}'s grob-property @code{beautiful}.  It is loosely
-related to the enclosed area between the slur and the notes.  Usually,
-the default setting works well, but in some cases you may prefer a
-curved slur when LilyPond decides for a vertically moved one.  You can
-indicate this preference by increasing the @code{beautiful} value:
-
-@lilypond[verbatim,singleline,relative]
+slur is reverted to its default shape.  The threshold for this
+decision is in @internalsref{Slur}'s grob-property @code{beautiful}.
+It is loosely related to the enclosed area between the slur and the
+notes.  Usually, the default setting works well, but in some cases you
+may prefer a curved slur when LilyPond decides for a vertically moved
+one.  You can indicate this preference by increasing the
+@code{beautiful} value:
+
+@lilyp ond[verbatim,singleline,relative]
   \stemDown \slurUp
   c16( a' f' a a f a, )c,
   c( a' f' a a f d, )c
   \property Voice.Slur \override #'beautiful = #5.0
   c( a' f' a a f d, )c
 @end lilypond
+@end ignore
 
 @refbugs
 
 Producing nice slurs is a difficult problem, and LilyPond currently
 uses a simple, empiric method to produce slurs. In some cases, the
-results of this method don't look too good.  This is reflected by the
+results of this method are ugly.
+
+@ignore
+This is reflected by the
 @code{beautiful} property, which it is an arbitrary parameter in the
 slur formatter.  Useful values can only be determined by trial and
 error.
+@end ignore
 
 @cindex Adjusting slurs
 
@@ -1417,18 +1534,18 @@ indicate a musical sentence. It is started using @code{\(} and @code{\)}
 respectively.
 
 @lilypond[fragment,verbatim,center,relative]
-  \time 6/4 c' \( ( d ) e f ( e ) \) d
+  \time 6/4 c' \(  d () e f () e  \) d
 @end lilypond
 
 Typographically, the phrasing slur behaves almost exactly like a normal
-slur. The grob associated with it is @internalsref{PhrasingSlur}, in
-@internalsref{Voice} context.
+slur. See also  @seeinternals{PhrasingSlur}.
+
 
 @node Breath marks
 @subsection Breath marks
 
-Breath marks are entered using @code{\breathe}.  The result is a
-@internalsref{BreathingSign} grob in @internalsref{Voice} context.
+Breath marks are entered using @code{\breathe}.  See also
+@seeinternals{BreathingSign}.
 
 @lilypond[fragment,relative]
 c'4 \breathe d4
@@ -1494,7 +1611,6 @@ An application---or rather, a hack---is to fake octavation indications.
 @menu
 * Articulations::               
 * Text scripts::                
-* Adding scripts::              
 * Grace notes::                 
 * Glissando ::                  
 * Dynamics::                    
@@ -1511,7 +1627,8 @@ An application---or rather, a hack---is to fake octavation indications.
 
 A variety of symbols can appear above and below notes to indicate
 different characteristics of the performance. They are added to a note
-by adding @code{-}@var{script}
+by adding a dash and the the character signifying the
+articulation. They are demonstrated here.
 @lilypond[singleline]
   \score {
     \notes \context Voice {
@@ -1588,7 +1705,7 @@ finger changes, use markup texts:
 @cindex superscript
 @cindex subscript
 
-Grobs for these objects are @internalsref{Script} and @internalsref{Fingering}.
+See also @seeinternals{Script} and @seeinternals{Fingering}.
 
 @refbugs
 
@@ -1630,24 +1747,6 @@ Text scripts are created in form of @internalsref{TextScript} grobs, in
 special symbols in text scripts.
 
 
-@node Adding scripts
-@subsection  Adding scripts
-
-TODO: should junk this subsect?
-
-You can add scripts by editing @file{scm/script.scm} and
-@file{ly/script-init.ly}. This file contains a table, listing script
-definitions and aliases. The following syntax accesses a script
-definition from the table:
-
-@example
-  \script @var{alias}
-@end example
-
-Usually the @code{\script} keyword is not used directly.  Various
-helpful identifier definitions appear in @file{script.ly}.
-
-
 @c .   {Grace notes}
 @node Grace notes
 @subsection Grace notes
@@ -1659,7 +1758,7 @@ helpful identifier definitions appear in @file{script.ly}.
 @cindex grace notes
 
 Grace notes are ornaments  are written out ornaments
-@lilypond[relative=2,fragment] 
+@lilypond[relative=2,verbatim,ifragment] 
   c4  \grace c16  c4 \grace { [c16 d16] } c4 
 @end lilypond
 
@@ -1673,23 +1772,27 @@ Every point in musical time consists of two rational numbers: one
 denotes the logical time, one denotes the grace timing. The above
 example is shown here with timing tuples.
 
-@lilypond[relative=2,fragment] 
-  c4^"(0,0)"  \grace c16^"(1/4,-1/16)"  c4^"(1/4,0)"  \grace {
-  [c16^"(2/4,-1/8)"  d16^"(2/4,-1/16)" ] } c4^"(2/4,0)"  
+@lilypond[]
+\score { \notes \relative c''{ 
+  c4^"(0,0)"  \grace c16_"(1/4,-1/16)"  c4^"(1/4,0)"  \grace {
+  [c16_"(2/4,-1/8)"  d16^"(2/4,-1/16)" ] } c4_"(2/4,0)"
+  }
+\paper {  linewidth = 8.\cm }
+}
 @end lilypond
 
 The advantage of this approach is that you can use almost any lilypond
 construction together with grace notes, for example slurs and clef
 changes may appear halfway in between grace notes:
 
-@lilypond[relative=2,fragment] 
+@lilypond[relative=2,verbatim,fragment] 
   c4  \grace { [ c16 c, \clef bass c, b(] }  )c4 
 @end lilypond
 
 The placement of these grace notes is synchronized between different
 staffs, using this grace timing.
 
-@lilypond[relative=2,fragment] 
+@lilypond[relative=2,verbatim,fragment] 
 \context Staff = SA { e4 \grace { c16 d e f } e4 }
 \context Staff = SB { c4 \grace { g8 b } c4 }
 @end lilypond
@@ -1714,33 +1817,21 @@ stem.
 }
 @end lilypond
 
-A grace note expression has duration 0; the next real note is assumed to
-be the main note. If you want the note to appear after the main note,
-set @code{Voice.graceAlignPosition} to @code{1}.
-
 @refbugs
 
-
 Grace note synchronization can also lead to surprises. Staff notation,
 such as key signatures, barlines, etc. are also synchronized. Take
 care when you mix staffs with grace notes and staffs without.
 
 @lilypond[relative=2,fragment]
-\context Staff = SA { e4 \bar "|:" \grace c16 d4 }
-\context Staff = SB { c4 \bar "|:"  d4 }
+\context Staff = SA { e4 \bar "|:" \grace c16 d4 }
+  \context Staff = SB { c4 \bar "|:"  d4 } >
 @end lilypond
 
-Nesting @code{\grace} notes is not supported. The following may cause
-run-time errors:
-@c
-@example
-  @code{\grace @{ \grace c32 c16 @} c4}
-@end example
-Since the meaning of such a construct is unclear, we don't consider this
-a loss.  Similarly, juxtaposing two @code{\grace} sections is
-syntactically valid, but makes no sense and may cause runtime errors.
-Ending a staff or score with grace notes may also generate a run-time
-error, since there will be no main note to attach the grace notes to.
+Grace sections should only be used within sequential music
+expressions.  Nesting, juxtaposing, or ending sequential music with a
+grace section is not supported, and might produce crashes or other
+errors.
 
 @menu
 * Glissando ::                  
@@ -1756,8 +1847,8 @@ error, since there will be no main note to attach the grace notes to.
 
 @cindex @code{\glissando}
 
-A glissando line (grob @internalsref{Glissando}) can be requested by
-attaching a @code{\glissando} to a notte:
+A glissando line can be requested by attaching a @code{\glissando} to
+a note:
 
 @lilypond[fragment,relative,verbatim]
   c'-\glissando c'
@@ -1766,7 +1857,7 @@ attaching a @code{\glissando} to a notte:
 @refbugs
 
 Printing of an additional text (such as @emph{gliss.}) must be done
-manually.
+manually. See also @seeinternals{Glissando}.
 
 
 
@@ -1833,20 +1924,23 @@ want several marks during one note, you have to use spacer notes.
 You can also use a text saying @emph{cresc.} instead of hairpins. Here
 is an example how to do it:
 
+@lilypond[fragment,relative=2,verbatim]
+  c4 \cresc c4 \endcresc c4
+@end lilypond
+
+
 @cindex crescendo
 @cindex decrescendo
 
+You can also supply your own texts:
 @lilypond[fragment,relative,verbatim]
   \context Voice {
-    \property Voice.crescendoText = "cresc."
+    \property Voice.crescendoText = "cresc. poco"
     \property Voice.crescendoSpanner = #'dashed-line
     a'2\mf\< a a \!a 
   }
 @end lilypond
 
-For everyday use, we recommend the identifiers @code{\cresc},
-@code{endcresc}, @code{\dim} and @code{\enddim}.
-
 @cindex diminuendo
 
 Dynamics are grobs of @internalsref{DynamicText} and
@@ -1873,12 +1967,12 @@ To specify repeats, use the @code{\repeat} keyword.  Since repeats
 should work differently when played or printed, there are a few
 different variants of repeats.
 
-@table @asis
+@table @code
 @item unfold
 Repeated music is fully written (played) out.  Useful for MIDI
 output, and entering repetitive music.
 
-@item volta  
+@item volta
 This is the normal notation: Repeats are not written out, but
 alternative endings (voltas) are printed, left to right.
 
@@ -1980,16 +2074,7 @@ are also not repeated.
 It is possible to nest @code{\repeat}s, although this probably is only
 meaningful for unfolded repeats.
 
-Folded repeats offer little more over simultaneous music.  However, it
-is to be expected that more functionality -- especially for the MIDI
-backend -- will be implemented at some point in the future.
-
-Volta repeats are printed over all staves in a score. You must turn them
-off explicitly, for example by doing
-@example
-  \property Staff.VoltaBracket = \turnOff
-@end example
-in all but the top staff.
+Folded repeats offer little more over simultaneous music.
 
 @node Manual repeat commands
 @subsection Manual repeat commands
@@ -2003,7 +2088,7 @@ command can be
 @table @code
 @item 'start-repeat
  Print a |: bar line
-@item 'stop-repeat
+@item 'end-repeat
  Print a :| bar line
 @item (volta . @var{text})
   Print a volta bracket saying @var{text}.
@@ -2044,9 +2129,7 @@ Tremolo beams are @internalsref{Beam} grobs. Single stem tremolos are
 
 @refbugs
 
-
-At present, the spacing between tremolo beams is not regular, since the
-spacing engine does not notice that not all notes are printed.
+Tremolo beams confuse the spacing engine.
 
 @node Tremolo subdivisions
 @subsection Tremolo subdivisions
@@ -2097,14 +2180,6 @@ with slashes, and repeating that measure with percents.
 @node Rhythmic music
 @section Rhythmic music
 
-
-@menu
-* Rhythmic staves::             
-@end menu
-
-@node Rhythmic staves
-@subsection Rhythmic staves
-
 Sometimes you might want to show only the rhythm of a melody.  This can
 be done with the rhythmic staff. All pitches of notes on such a staff
 are squashed, and the  staff itself  looks has  a single staff line:
@@ -2116,6 +2191,302 @@ are squashed, and the  staff itself  looks has  a single staff line:
   }
 @end lilypond
 
+@menu
+* Percussion staves::           
+@end menu
+
+@node Percussion staves
+@subsection Percussion staves
+@cindex percussion
+@cindex drums
+To typeset more than one piece of percussion to be played by the same
+musician one typically uses a multiline staff where each staff
+position refers to a specific piece of percussion.
+
+LilyPond is shipped with a bunch of scheme functions which allows you
+to do this fairly easily.
+
+The system is based on the general midi drum-pitches.
+In order to use the drum pitches you include
+@file{ly/drumpitch-init.ly}. This file defines the pitches from the scheme
+variable @code{drum-pitch-names} - which definition can be read in
+@file{scm/drums.scm}. You see that each piece of percussion has a full
+name and an abbreviated name - and you may freely select whether to
+refer to the full name or the abbreviation in your music definition.
+
+To typeset the music on a staff you apply the scheme function
+@code{drums->paper} to the percussion music. This function takes a
+list of percussion instrument names, notehead scripts and staff
+positions (that is: pitches relative to the C-clef) and uses this to
+transform the input music by moving the pitch, changing the notehead
+and (optionally) adding a script:
+@lilypond[singleline,verbatim]
+\include "drumpitch-init.ly"
+up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
+down = \notes { bassdrum4 snare8 bd r bd sn4 }
+\score {
+    \apply #(drums->paper 'drums) \context Staff <
+        \clef percussion
+        \context Voice = up { \voiceOne \up }
+        \context Voice = down { \voiceTwo \down }
+    >
+}
+
+@end lilypond
+In the above example the music was transformed using the list @code{'drums}.
+Currently the following lists are defined in @file{scm/drums.scm}:
+@table @code
+@item 'drums
+To typeset a typical drum kit on a five line staff.
+@lilypond[]
+\include "drumpitch-init.ly"
+nam = \lyrics { cymc cyms cymr hh hhc hho hhho hhp cb hc
+    bd sn ss tomh tommh tomml toml tomfh tomfl }
+mus = \notes  { cymc cyms cymr hh hhc hho hhho hhp cb hc
+    bd sn ss tomh tommh tomml toml tomfh tomfl s16 }
+\score {
+    <
+        \apply #(drums->paper 'drums) \context Staff <
+            \clef percussion
+            \mus
+        >
+        \context Lyrics \nam 
+    >
+    \paper {
+        \translator {
+            \StaffContext
+            \remove Bar_engraver
+            \remove Time_signature_engraver
+            minimumVerticalExtent = #'(-4.0 . 5.0)
+        }
+        \translator {
+            \VoiceContext
+            \remove Stem_engraver
+        }
+   }   
+}
+@end lilypond
+Notice that the scheme supports six different toms.
+If you are using fewer toms then you simply select the toms that produce
+the desired result - i.e. to get toms on the three middle lines you
+use @code{tommh}, @code{tomml} and @code{tomfh}.
+
+Because the general midi contain no rimshots we use the sidestick for
+this purpose instead.
+@item 'timbales
+To typeset timbales on a two line staff.
+@lilypond[singleline]
+\include "drumpitch-init.ly"
+nam = \lyrics { timh ssh timl ssl cb }
+mus = \notes  { timh ssh timl ssl cb s16 }
+\score {
+    <
+        \apply #(drums->paper 'timbales) \context Staff <
+            \clef percussion
+            \mus
+        >
+        \context Lyrics \nam 
+    >
+    \paper {
+        \translator {
+            \StaffContext
+            \remove Bar_engraver
+            \remove Time_signature_engraver
+            StaffSymbol \override #'line-count = #2
+            StaffSymbol \override #'staff-space = #2
+            minimumVerticalExtent = #'(-3.0 . 4.0)
+        }
+        \translator {
+            \VoiceContext
+            \remove Stem_engraver
+        }
+
+    }   
+}
+@end lilypond
+@item 'congas
+To typeset congas on a two line staff.
+@lilypond[singleline]
+\include "drumpitch-init.ly"
+nam = \lyrics { cgh cgho cghm ssh cgl cglo cglm ssl }
+mus = \notes  { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
+\score {
+    <
+        \apply #(drums->paper 'congas) \context Staff <
+            \clef percussion
+            \mus
+        >
+        \context Lyrics \nam 
+    >
+    \paper {
+        \translator {
+            \StaffContext
+            \remove Bar_engraver
+            \remove Time_signature_engraver
+            StaffSymbol \override #'line-count = #2
+            StaffSymbol \override #'staff-space = #2
+            minimumVerticalExtent = #'(-3.0 . 4.0)
+        }
+        \translator {
+            \VoiceContext
+            \remove Stem_engraver
+        }
+    }   
+}
+@end lilypond
+@item 'bongos
+To typeset bongos on a two line staff.
+@lilypond[singleline]
+\include "drumpitch-init.ly"
+nam = \lyrics { boh boho bohm ssh bol bolo bolm ssl }
+mus = \notes  { boh boho bohm ssh bol bolo bolm ssl s16 }
+\score {
+    <
+        \apply #(drums->paper 'bongos) \context Staff <
+            \clef percussion
+            \mus
+        >
+        \context Lyrics \nam 
+    >
+    \paper {
+        \translator {
+            \StaffContext
+            \remove Bar_engraver
+            \remove Time_signature_engraver
+            StaffSymbol \override #'line-count = #2
+            StaffSymbol \override #'staff-space = #2
+            minimumVerticalExtent = #'(-3.0 . 4.0)
+        }
+        \translator {
+            \VoiceContext
+            \remove Stem_engraver
+        }
+    }   
+}
+@end lilypond
+@item 'percussion
+To typeset all kinds of simple percussion on one line staves.
+@lilypond[singleline]
+\include "drumpitch-init.ly"
+nam = \lyrics { tri trio trim gui guis guil cb cl tamb cab mar hc }
+mus = \notes  { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
+\score {
+    <
+        \apply #(drums->paper 'percussion) \context Staff <
+            \clef percussion
+            \mus
+        >
+        \context Lyrics \nam 
+    >
+    \paper {
+        \translator {
+            \StaffContext
+            \remove Bar_engraver
+            \remove Time_signature_engraver
+            StaffSymbol \override #'line-count = #1
+            minimumVerticalExtent = #'(-2.0 . 3.0)
+        }
+        \translator {
+            \VoiceContext
+            \remove Stem_engraver
+        }
+    }   
+}
+@end lilypond
+@end table
+
+If you don't like any of the predefined lists you can define your own
+list at the top of your file:
+
+@lilypond[singleline, verbatim]
+#(define mydrums `(
+        (bassdrum     default   #f        ,(make-pitch -1 2 0))
+        (snare        default   #f        ,(make-pitch 0 1 0))
+        (hihat        cross     #f        ,(make-pitch 0 5 0))
+        (pedalhihat   xcircle   "stopped" ,(make-pitch 0 5 0))
+        (lowtom              diamond   #f        ,(make-pitch -1 6 0))
+))
+\include "drumpitch-init.ly"
+up = \notes { hh8 hh hh hh hhp4 hhp }
+down = \notes { bd4 sn bd toml8 toml }
+\score {    
+    \apply #(drums->paper 'mydrums) \context Staff <
+        \clef percussion
+        \context Voice = up { \voiceOne \up }
+        \context Voice = down { \voiceTwo \down }
+    >
+}
+@end lilypond
+
+To use a modified existing list instead of building your own from
+scratch you can append your modifications to the start of the existing
+list:
+
+@example
+#(define mydrums (append `(
+   (bassdrum default #f ,(make-pitch -1 2 0))
+   (lowtom   diamond #f ,(make-pitch -1 6 0))
+) drums ))
+@end example
+
+@c FIXME: Too many levels of headers when using subsubsections.
+@c Perhaps junk subsection ``Percussion staves''
+@subsubsection Percussion staves with normal staves
+When you include @file{drumpitch-init.ly} then the default pitches
+are overridden so that you after the inclusion cannot use the common
+dutch pitch names anymore. Hence you might wan't to reinclude
+@file{nederlands.ly} after the drum-pattern-definitions:
+@lilypond[singleline,verbatim]
+\include "drumpitch-init.ly"
+up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
+down = \notes { bassdrum4 snare8 bd r bd sn4 }
+\include "nederlands.ly"
+bass = \notes \transpose c, { a4. e8 r e g e }
+\score {
+    <
+        \apply #(drums->paper 'drums) \context Staff = drums <
+            \clef percussion
+            \context Voice = up { \voiceOne \up }
+            \context Voice = down { \voiceTwo \down }
+        >
+        \context Staff = bass { \clef "F_8" \bass }
+    >
+}
+@end lilypond
+
+@subsubsection Percussion midi output
+In order to produce correct midi output you need to produce two score
+blocks - one for the paper and one for the midi.
+To use the percussion channel you set the property @code{instrument}
+to @code{'drums}. Because the drum-pitches themself are similar to the
+general midi pitches all you have to do is to insert the voices with
+none of the scheme functions to get the correct midi output:
+
+@example
+\score @{    
+    \apply #(drums->paper 'mydrums) \context Staff <
+        \clef percussion
+        \context Voice = up @{ \voiceOne \up @}
+        \context Voice = down @{ \voiceTwo \down @}
+    >
+    \paper@{@}
+@}
+\score @{    
+    \context Staff <
+        \property Staff.instrument = #'drums
+        \up \down
+    >
+    \midi@{@}
+@}
+@end example
+
+@refbugs
+
+This scheme is to be considered a temporary implementation. Even
+though the scheme will probably keep on working then the future might
+bring some other way of typesetting drums, and probably
+there will be made no great efforts in keeping things downwards
+compatible.
 
 @c . {Piano music}
 @node Piano music
@@ -2145,16 +2516,11 @@ other pianistic peculiarities.
 Voices can switch automatically between the top and the bottom
 staff. The syntax for this is
 @example
-        \autochange @var{contexttype} \context @var{childcontexttype}
-               @var{musicexp} 
-@end example
-@c
-This will switch the interpretation context of @var{musicexp} between
-a @var{contexttype} named @code{up} and @code{down}. Typically, you
-use @internalsref{Staff} for @var{contexttype}, and
-@internalsref{Voice} for @var{childcontexttype}. The autochanger
-switches on basis of pitch (central C is the turning point), and it
-looks ahead skipping over rests to switch rests in advance.
+        \autochange Staff \context Voice @{ @dots{}@var{music}@dots{} @}
+@end example        
+The autochanger switches on basis of pitch (central C is the turning
+point), and it looks ahead skipping over rests to switch rests in
+advance. Here is a practical example:
         
 @lilypond[verbatim,singleline]
 \score { \notes \context PianoStaff <
@@ -2166,8 +2532,7 @@ looks ahead skipping over rests to switch rests in advance.
        s1*2
 } > }
 @end lilypond
-
-Note how spacer rests are used to prevent the bottom staff from
+Spacer rests are used to prevent the bottom staff from
 terminating too soon.
 
 
@@ -2186,18 +2551,6 @@ current voice from its current staff to the Staff called
 @var{staffname}. Typically @var{staffname} is @code{"up"} or
 @code{"down"}.
 
-The formal definition of this construct is obtuse, but for the sake of
-completeness we give it here.
-@cindex @code{\translator}
-@example
-  \translator @var{contexttype} = @var{name}
-@end example
-Formally, this construct is a music expression indicating
-that the context which is a direct child of the context of type
-@var{contexttype} should be shifted to a context of type
-@var{contexttype} and the specified name.
-
-
 @c .   {Pedals}
 @node Pedals
 @subsection Pedals
@@ -2255,8 +2608,10 @@ For fine-tuning of the appearance of a pedal bracket, the properties
 may be extended to the end of the note head.
 
 @lilypond[fragment,verbatim]
-\property Staff.PianoPedalBracket \override #'shorten-pair = #'(0 . -1.0)
-c''4 \sostenutoDown d''4 e''4 c'4 f'4 g'4 a'4 \sostenutoUp
+\property Staff.PianoPedalBracket \override
+   #'shorten-pair = #'(0 . -1.0)
+c''4 \sostenutoDown d''4 e''4 c'4
+f'4 g'4 a'4 \sostenutoUp
 @end lilypond
 
 
@@ -2298,9 +2653,9 @@ arpeggio, you should set the arpeggio grob property
 
 @lilypond[fragment,relative,verbatim]
   \context Voice {
-     \property Voice.Arpeggio \override #'arpeggio-direction = #1
+     \property Voice.Arpeggio \set #'arpeggio-direction = #1
      <c\arpeggio e g c>
-     \property Voice.Arpeggio \override #'arpeggio-direction = #-1
+     \property Voice.Arpeggio \set #'arpeggio-direction = #-1
      <c\arpeggio e g c>
   }
 @end lilypond
@@ -2324,8 +2679,8 @@ arpeggiate the chord. To draw these brackets, set the
 
 @refbugs
 
-It is not possible to mix connected arpeggios and unconnected arpeggios
-at the same time.
+It is not possible to mix connected arpeggios and unconnected
+arpeggios in one PianoStaff at the same time.
 
 
 
@@ -2360,6 +2715,11 @@ The associated grob is @internalsref{VoiceFollower}.
 @node Tablatures
 @section Tablatures
 
+Tablature notation is used music for plucked string instruments.  It
+notates pitches not by using note heads, but by indicating on which
+string and fret a note must be played.  LilyPond offers limited
+support for tablature, by abusing the fingering system.
+
 @menu
 * Tablatures basic::            
 * Non-guitar tablatures::       
@@ -2372,8 +2732,8 @@ The associated grob is @internalsref{VoiceFollower}.
 
 Tablature can be typeset with Lilypond by using the
 @internalsref{TabStaff} and @internalsref{TabVoice} contexts. As
-tablatures is a recent feature in Lilypond, most of the guitar special
-effects (hammer, pull, bend, ...) are not yet supported.
+tablature is a recent feature in Lilypond, most of the guitar special
+effects such as hammer, pull, bend are not yet supported.
 
 With the @internalsref{TabStaff}, the string number associated to a note
 is given though the fingering mechanism, e.g. @code{c4-3} for a C
@@ -2398,15 +2758,10 @@ tuning defaults to the standard guitar tuning (with 6 strings).
 
 There are many ways to customize Lilypond tablatures.
 
-First you can change the number of string, e.g.
-@code{StaffSymbol \override #'line-count  = #5} to have only 5 strings.
-Because of a kind of bug in Lilypond, you MUST create a new type of
-context if you want different tablatures with diiferent number of
-strings.
-
-Then you can change the strings tuning. String tuning is given as a
-Scheme list with one integer number for each string, the number being
-the string note pitch if not fretted (open note).
+First you can change the number of strings, by setting the number of
+lines in the @internalsref{TabStaff}.  You can change the strings
+tuning. A string tuning is given as a Scheme list with one integer
+number for each string, the number being the pitch of an open string.
 
 Finally, it is possible to change the Scheme function to format the
 tablature note text. The default is @var{fret-number-tablature-format},
@@ -2450,207 +2805,6 @@ the standard staff.
 @end lilypond
 
 
-
-@node Lyrics
-@section Lyrics
-
-
-@menu
-* Lyrics mode::                 
-* Printing lyrics::             
-* Automatic syllable durations::  
-* More stanzas::                
-@end menu
-
-@c .  {Lyrics mode}
-@node Lyrics mode
-@subsection Lyrics mode
-@cindex Lyrics mode
-
-To print lyrics, you must first make a music expression from the lyric
-text.  That music expression can be printed by selecting an appropriate
-context.
-
-@cindex lyric mode
-@cindex @code{\lyrics}
-
-You can enter lyrics in a special input mode of LilyPond. This mode is
-called Lyrics mode, and it is introduced by the keyword @code{\lyrics}.
-The purpose of this mode is that you can enter lyrics as plain text,
-punctuation and accents without any hassle.
-
-Syllables are entered like notes, with pitches replaced by text.  For
-example, @code{Twin- kle twin- kle} enters four syllables.  Note that
-the hyphen has no special meaning for lyrics, and does not introduce
-special symbols.
-
-Spaces can be introduced into a lyric either by using quotes:
-@code{"He could"4 not4} or by using an underscore without quotes:
-@code{He_could4 not4}.  All unquoted underscores are converted to
-spaces.
-
-The precise definition of this mode can be found in @ref{Lyrics mode
-definition}. 
-
-@c .  {Printing lyrics}
-@node Printing lyrics
-@subsection Printing lyrics
-@cindex lyrics
-
-Lyrics are printed by interpreting them in the @internalsref{Lyrics}  context.
-
-@c Maybe more pedagogical to avoid \addlyrics in this first example? /MB
-@c Add tied and beamed melismata too.
-@lilypond[verbatim,singleline]
-\addlyrics
-  \notes \relative c' {
-    \time 7/4
-    \property Staff.automaticMelismata = ##t
-    d'2 c4 b16 ( a g a b a b ) c a2
-    b2 c4 b8 ( a16 g ) a4 g2 }
-  \context Lyrics \lyrics { 
-    Join us now __ and
-    share the soft -- ware; }
-@end lilypond
-
-
-Notes and syllable durations are matched automatically. This is
-accomplished using @code{\addlyrics}, which is documented in
-@ref{Automatic syllable durations}. Setting @code{automaticMelismata} in
-the melody staff will cause tied, slurred or beamed notes to be
-interpreted as melismata.
-
-The Lyric syllables are @code{LyricsVoice.LyricSyllable} grobs.
-
-@cindex extender
-@cindex lyric extender
-@cindex melisma
-
-As you can see, extender lines are entered as @code{__}.  This will
-create an extender, a line that extends over the entire duration of the
-lyric.  This line will run all the way to the start of the next lyric,
-so you may want to shorten it by using a blank lyric (using @code{_}).
-The grob for this symbol is @code{LyricsVoice.LyricExtender}.
-
-
-@cindex hyphen
-
-If you want to have hyphens centered between syllables (rather than
-attached to the end of the first syllable) you can use the special
-`@code{-}@code{-}' lyric as a separate word between syllables.  This
-will result in a hyphen whose length varies depending on the space
-between syllables. It will be centered between the syllables.  The grob
-for this symbol is @code{LyricsVoice.LyricHyphen}.
-
-@cindex Lyric hyphen
-
-@node Automatic syllable durations
-@subsection Automatic syllable durations
-@cindex Automatic syllable durations
-
-@cindex automatic lyric durations
-@cindex @code{\addlyrics}
-
-If you have lyrics that are set to a melody, you can copy the rhythm
-of that melody into the lyrics using @code{\addlyrics}.  The syntax for
-this is
-@example
-  \addlyrics @var{musicexpr1 musicexpr2}
-@end example
-
-Both @var{musicexpr1} and @var{musicexpr2} are interpreted, but every
-music event (``every syllable'') in @var{musicexpr2} is interpreted only
-when there are events in @var{musicexpr1}.
-
-@cindex @code{automaticMelismata}
-
-If the property @code{automaticMelismata} is set in the
-context of @var{musicexpr1}, no lyrics will be put on slurred or tied
-notes.
-
-@lilypond[verbatim,fragment]
-\addlyrics
-\transpose c'' {
-  \property Voice.automaticMelismata = ##t
-  c8 () cis d8. e16 f2
-}
-\context Lyrics \lyrics {
- do4 re mi fa }
-@end lilypond
-
-If you want the lyric lines to be above the melody staff, or in some
-other, more complex configuration, then build that configuration first
-using simultaneous music, and use @code{\addlyrics} after that.
-
-@lilypond[verbatim, singleline]
-\notes <
-  \context Lyrics = LA { s1 }
-  \context Staff = SA { s1 }
-  \addlyrics
-        \context Staff = SA \relative c' { c4 e g g }
-        \context Lyrics  = LA \lyrics { geen ge -- don -- der } >
-@end lilypond
-
-For @code{\addlyrics} you should use a single rhythm melody, and single
-rhythm lyrics (a constant duration is the obvious choice).  If you do
-not, you can get undesired effects when using multiple stanzas:
-
-@lilypond[verbatim,fragment]
-\addlyrics
-\transpose c'' {
-  c8 () cis d8. e16 f2
-}
-\context Lyrics \lyrics
-< { do4 re fa sol }
-  { do8 re fa sol } >
-@end lilypond
-
-It is valid (but probably not very useful) to use notes instead of
-lyrics for @var{musicexpr2}.
-
-@node More stanzas
-@subsection More stanzas
-
-@cindex phrasing
-
-If you have multiple stanzas printed underneath each other, the vertical
-groups of syllables should be aligned around punctuation. LilyPond can
-do this if you tell it which lyric lines belong to which melody.
-
-To this end, give the Voice context an identity, and set the LyricsVoice
-to a name starting with that identity followed by a dash.
-In the following example, the Voice
-identity is @code{duet}, and the identities of the LyricsVoices are
-@code{duet-1} and @code{duet-2}.
-
-
-@lilypond[singleline,verbatim]
-\score {
-\addlyrics
-  \notes \relative c'' \context Voice = duet { \time 3/4
-     g2 e4 a2 f4 g2.  }
-  \lyrics \context Lyrics <
-  \context LyricsVoice = "duet-1" {
-    \property LyricsVoice . stanza = "Bert"
-    Hi, my name is bert.    }
-  \context LyricsVoice = "duet-2" {
-    \property LyricsVoice . stanza = "Ernie" 
-    Ooooo, ch\'e -- ri, je t'aime. }
-  >
-}
-@end lilypond
-
-You can add stanza numbers by setting @code{LyricsVoice.Stanza} (for the
-first system) and @code{LyricsVoice.stz} for the following
-systems. Notice how you must surround dots with spaces in @code{\lyrics}
-mode.
-
-
-
-
-@cindex stanza numbering
-
-
 @c . {Chords}
 @node Chords
 @section Chords
@@ -2952,9 +3106,9 @@ marks.
 @cindex measure numbers
 @cindex currentBarNumber
 
-  They are printed at the
-start of the line.  The number itself is a property that can be set by
-modifying the @code{currentBarNumber} property, i.e.
+Bar numbers are printed by default at the start of the line.  The
+number itself is a property that can be set by modifying the
+@code{currentBarNumber} property, i.e.
 @example
   \property Score.currentBarNumber = #217
 @end example
@@ -2962,13 +3116,11 @@ modifying the @code{currentBarNumber} property, i.e.
 If you want boxed bar numbers, see the example file
 @code{input/test/boxed-molecule.ly}.
 
-Bar numbers are @internalsref{BarNumber} grobs.
+See also @seeinternals{BarNumber}.
 
 @refbugs
 
-It is not possible to have bar numbers printed at regular intervals
-only.
-
+Printing bar numbers at regular intervals is not implemented.
 Barnumbers can collide with the StaffGroup, if there is one at the
 top. To solve this, You have to twiddle with the
 @internalsref{padding} property of @internalsref{BarNumber} if your
@@ -3308,7 +3460,7 @@ block:
 
 LilyPond supports a variety of clefs, many of them ancient. These can
 be selected from the @code{ancient} font family, by setting
-@code{Staff.clefGlyph}) to the following values
+@code{Staff.clefGlyph}) to one of the following values
 
 @table @code
 @item clefs-C
@@ -3368,7 +3520,7 @@ LilyPond has limited support for figured bass:
 <
  \context FiguredBass
    \figures {
-       <_! 3+ 5- _ 7! 9 >4
+       <_! 3+ 5- >4
        < [4 6] 8 >
    }
  \context Voice { c4 g8 }
@@ -3382,35 +3534,35 @@ that takes care of making @internalsref{BassFigure} grobs.
 
 In figures input mode, a group of bass figures is delimited by
 @code{<} and @code{>}. The duration is entered after the @code{>}.
+@example
+       <4 6>
+@end example
 @lilypond[fragment]
 \context FiguredBass
 \figures { <4 6> }
 @end lilypond
-@example
-       <4 6>
-@end example
 
 Accidentals are added to the numbers if you alterate them by
 appending @code{-}, @code{!}  and @code{+}.
 
+@example
+  <4- 6+ 7!>
+@end example
 @lilypond[fragment]
   \context FiguredBass
 \figures { <4- 6+ 7!> }
 @end lilypond
-@example
-  <4- 6+ 7!>
-@end example
 
 Spaces or dashes may be inserted by using @code{_}. Brackets are
 introduced with @code{[} and @code{]}.
 
+@example
+       < [4 6] 8 [_ 12]>
+@end example
 @lilypond[fragment]
  \context FiguredBass
 \figures { < [4 6] 8 [_ 12]> }
 @end lilypond
-@example
-       < [4 6] 8 [_ 12]>
-@end example
 
 Although the support for figured bass may superficially resemble chord
 support, it works much simpler: in figured bass simply stores the
@@ -3444,8 +3596,6 @@ object, and set a grob property in that object.
 * Tuning per grob ::            
 * Font selection::              
 * Text markup::                 
-* Invisible grobs::             
-* Dirty tricks::                
 * Spacing::                     
 @end menu
 
@@ -3461,7 +3611,7 @@ context property.  By assigning to that property (using plain
 @code{\property}), you can change the resulting grobs.
 
 @lilypond[verbatim, fragment]
-c'4 \property Voice.Stem  = #'((meta . ((interfaces . ())))) c'4
+c'4 \property Voice.Stem  = #'()
 @end lilypond
 
 The @code{\property} assignment effectively empties the definition of
@@ -3661,9 +3811,10 @@ properties:
 @table @code
 @item font-family
  A symbol indicating the general class of the typeface.  Supported are
-@code{roman} (Computer Modern), @code{braces} (for piano staff braces),
-@code{music} (the standard music font), @code{dynamic} (font for dynamic
-signs) and @code{typewriter}
+@code{roman} (Computer Modern), @code{braces} (for piano staff
+braces), @code{music} (the standard music font), @code{ancient} (the
+ancient notation font) @code{dynamic} (font for dynamic signs) and
+@code{typewriter}
 
 @item font-shape
   A symbol indicating the shape of the font, there are typically several
@@ -3685,19 +3836,22 @@ A number indicating  the design size of the font.
 
 This is a feature of the Computer Modern Font: each point size has a
 slightly different design. Smaller design sizes are relatively wider,
-which enhances readability. Scalable type faces such TrueType and Adobe
-Type1 usually come as ``one design fits all sizes''.
+which enhances readability.
 
 @item font-name
   The name of the font, as a string, e.g. @code{"cmr12"}. This overrides
 all other font-qualifiers. 
+You may use this to use special fonts, which are not a part of the
+style sheet, or which have special encodings.
+
 @end table
 
 
 The font is selected by taking the first font that satisfies all
 qualifiers specified. You can override any of these fields through
 @code{\override} and @code{\revert}. The special value @code{*} matches
-any value for that qualifier.
+any value for that qualifier.  The value @code{*} is needed to
+override default settings which are always present. 
 
 @example
   \property Lyrics.LyricText \override #'font-series = #'bold
@@ -3716,22 +3870,16 @@ and @code{dynamic}.
 The style sheets and tables for selecting fonts are located in
 @file{scm/font.scm}. Refer to this file for more information.
 
-
-Setting @code{font-name} overrides all other qualifiers. The value for
-this property should be a string, the file name of the font. You may use
-this to use special fonts, which are not a part of the style sheet, or
-which have special encodings.
-
-The size of the font may be set with the grob property
-@code{font-magnification}.  It is the size of font, relative to its
-standard size. For example, @code{1.0} is normal size.
+The size of the font may be scaled with the grob property
+@code{font-magnification}.  For example, @code{2.0} blows up all
+letters by a factor 2 in both directions.
 
 @refbugs
 
 Relative size is not linked to any real size.
 
 There is no style sheet provided for other fonts besides the @TeX{}
-family.
+family, and the style sheet can not be modified easiyl.
 
 @cindex font selection
 @cindex font magnification
@@ -3778,7 +3926,7 @@ which are prepended to the property list.  The @var{key}-@var{value}
 pair is a grob property. A list of properties available is included in
 the generated documentation for @rint{Text_interface}.
 
-The following abbreviations are currently defined:
+The following abbreviations are defined:
 @table @code
 @item columns
  horizontal mode: set all text on one line (default)
@@ -3852,79 +4000,10 @@ marking:
 }
 @end lilypond
 
-@node Invisible grobs
-@subsection Invisible grobs
-@cindex invisible grobs
-
-@ignore
-
-ben nog steeds niet kapot van de informatiedichtheid hier.
-
---hwn
-
-@end ignore
-
-You can imagine a number of situations where you would want to make
-certain grobs not show up in the output.  There may be aesthetic
-reasons, to make the output resemble an (old) manuscript as close as
-possible, or to make lessons or exercises for students.
-
-Grobs can be made invisible in a number of ways:
-
-Here's an example with blanked-out notes and stems:
-@lilypond[singleline,verbatim]
-blanknotes = {
-  \property Voice.NoteHead \override
-    #'transparent = ##t
-  \property Voice.Stem \override
-    #'transparent = ##t }
-  
-unblanknotes = {
-  \property Voice.NoteHead \revert #'transparent
-  \property Voice.Stem \revert #'transparent }
-
-\score {
-  \notes\relative c'' {
-    \time 6/4
-    a b c b \blanknotes c \unblanknotes d
-  }
-}
-@end lilypond
-This method makes the grobs invisible but they still take the normal space. 
-To remove all traces of the grob, you can redefine the function
-typesetting them:
-@lilypond[verbatim]
-\score {
-  \notes\relative c'' {
-    \key c \minor
-    \time 6/4
-    as bes c bes c d \break
-    \property Staff.KeySignature \override #'molecule-callback = #'()
-    as bes c bes c d 
-  }
-  \paper{linewidth=5.0\cm indent=0}
-}
-@end lilypond
-
-A very rigorous way of removing grobs from the whole score is to remove
-the engraver that creates them. For example,
-@lilypond[singleline,verbatim]
-\score {\notes { c'4 d'8 e'8 g2 }
-  \paper { \translator {
-     \VoiceContext
-     \remove Stem_engraver
-  } }
-}
-@end lilypond
-However, as you can see, this can lead to unexpected effects.
+@refbugs
 
-@node Dirty tricks
-@subsection Dirty tricks
-@cindex embedded tex
-
-@lilypond[fragment,relative,verbatim]
-  a'^"3 $\\times$ \\`a deux"
-@end lilypond
+The syntax and semantics of markup texts are not clean, and both
+syntax and semantics are slated for a rewrite.
 
 @node Spacing
 @subsection Spacing
@@ -3950,7 +4029,10 @@ kneed stems.
 }
 @end lilypond
 
-
+The spacing algorithm is global: it searches the entire score for the
+shortest notes. Pieces that have major changes in duration density
+(eg. due to meter changes) will be printed in a uniform density, which
+is undesirable
 
 @c . {Page layout}
 @node Page layout
@@ -3968,7 +4050,6 @@ The part of LilyPond is documented here.
 * Paper size::                  
 * Line break::                  
 * Page break::                  
-* Output scaling::              
 @end menu
 
 @c .  {Paper block}
@@ -3990,20 +4071,6 @@ where each of the items is one of
 
   @item  A context definition.  See @ref{Interpretation context} for
        more information on context definitions.
-
-  @item  \stylesheet  declaration.  Its syntax is
-       @example
-               \stylesheet @var{alist}
-       @end example
-
-        See @file{scm/font.scm} for details of @var{alist}.
-  @item an @code{\elementdescriptions} declaration.
-        @example
-                \elementdescriptions @var{alist}
-        @end example
-        See @file{scm/grob-description.scm} for details of
-@var{alist}. This command is not user-serviceable.
-
 @end itemize
 
 @c .  {Paper variables}
@@ -4061,7 +4128,7 @@ produces a single line.
 @end table
 
 You may enter these dimension using units (@code{cm}, @code{in},
-@code{mm}, @code{pt}), or relative to another dimension
+@code{mm}, @code{pt})
 @example
         linewidth = 20.0 * \staffspace
         indent  = 0.5 \cm
@@ -4131,16 +4198,16 @@ Line breaks are normally computed automatically. They are chosen such
 that it looks neither cramped nor loose, and that consecutive lines have
 similar density.
 
-Occasionally you might want to override the automatic breaks; you can do
-this by specifying @code{\break}. This will force a line break at this
-point. Do remember that line breaks can only occur at places where there
-are bar lines.  If you want to have a line break where there is no
-bar line, you can force an invisible bar line by entering @code{\bar
-""}. Similarly, @code{\noBreak} forbids a line break at a certain point.
+Occasionally you might want to override the automatic breaks; you can
+do this by specifying @code{\break}. This will force a line break at
+this point.  Line breaks can only occur at places where there are bar
+lines.  If you want to have a line break where there is no bar line,
+you can force an invisible bar line by entering @code{\bar
+""}. Similarly, @code{\noBreak} forbids a line break at a certain
+point.
 
 If you want linebreaks at regular intervals, you can use the following:
 @example
-
 <  \repeat 7 unfold @{ s1 * 4 \break  @}
    @emph{real music}
 > 
@@ -4148,23 +4215,6 @@ If you want linebreaks at regular intervals, you can use the following:
 This makes the following 28 measures (assuming 4/4 time) be broken every
 4 measures.
 
-
-@cindex @code{\penalty}
-
-The @code{\break} and @code{\noBreak} commands are defined in terms of
-the penalty command:
-@example
-  \penalty @var{int} 
-@end example
-
-This encourages or discourages LilyPond to make a line break at this
-point.
-
-@refbugs
-
-The scaling of the @code{\penalty} argument is not well-defined.  The
-command is rather kludgey, and slated for rewriting.
-
 @c .  {Page break}
 @node Page break
 @subsection Page break
@@ -4173,35 +4223,12 @@ command is rather kludgey, and slated for rewriting.
 @cindex breaking pages
 
 Page breaks are normally computed by @TeX{}, so they are not under
-direct control of LilyPond.  However, you can insert a commands into the
-@file{.tex} output to instruct @TeX{} where to break pages, by inserting
-the command @code{\newpage}
-@cindex @code{\newpage}
+direct control of LilyPond.  However, you can insert a commands into
+the @file{.tex} output to instruct @TeX{} where to break pages. You
+can insert a @code{\newpage} from within lilypond. This is done by
+setting the @code{between-systems-strings} on the
+@internalsref{NonMusicalPaperColumn} where the system is broken.
 
-@example
-  \newpage
-@end example
-
-@c why do so difficult?
-@c maybe should explain contents of between-system.ly,
-@c but not now, we're talking about page breaks here.
-@c For more
-@c details, see the example file @file{input/test/between-systems.ly}
-
-
-@c .  {Output scaling}
-@node Output scaling
-@subsection Output scaling
-
-[TODO]
-
-@example
-dvips ...
-@end example
-
-@example
-pstops ...
-@end example
 
 
 @refbugs
@@ -4218,16 +4245,16 @@ meaning that you don't have access to continuously scaled fonts.
 LilyPond can output processed music in different output formats.  
 
 @menu
-* TeX output::                  
+* @TeX{} output::               
 * PostScript output::           
 * Scheme output::               
 * ASCIIScript output::          
 * Sketch output::               
 @end menu
 
-@node TeX output
-@subsection TeX output
-@cindex TeX output
+@node @TeX{} output
+@subsection @TeX{} output
+@cindex @TeX{} output
 
 LilyPond will use @TeX{} by default.  Even if you want to produce
 PostScript output for viewing or printing, you should normally have
@@ -4411,10 +4438,6 @@ instruments and ranges or change the default settings by overriding the
 Both loudness controls are combined to produce the final  MIDI volume. 
 
 
-@refbugs
-
-It is currently not possible to use the percussion channel (generally
-channel 10 of a MIDI file).
 
 @menu
 * MIDI block::                  
@@ -4466,912 +4489,3 @@ default (Grand Piano). It is not possible to select an instrument by
 number.
 
 
-
-
-
-
-
-
-@c FIXME: Note entry vs Music entry at top level menu is confusing.
-@c . {Music entry}
-@node Interpretation context
-@section Interpretation context
-
-@menu
-* Creating contexts::           
-* Default contexts::            
-* Context properties::          
-* Engravers and performers::    
-* Changing context definitions::  
-* Defining new contexts::       
-@end menu
-
-
-Interpretation contexts are objects that only exist during a run of
-LilyPond.  During the interpretation phase of LilyPond (when it prints
-"interpreting music"), the music expression in a @code{\score} block is
-interpreted in time order. This is the same order that humans hear and
-play the music.
-
-During this interpretation, the interpretation context holds the
-state for the current point within the music. It contains information
-like
-
-@itemize @bullet
-  @item What notes are playing at this point?
-  @item What symbols will be printed at this point?
-  @item What is the current key signature, time signature, point within
-       the measure, etc.?
-@end itemize
-
-Contexts are grouped hierarchically: A @internalsref{Voice} context is
-contained in a @internalsref{Staff} context (because a staff can contain
-multiple voices at any point), a @internalsref{Staff} context is contained in
-@internalsref{Score}, @internalsref{StaffGroup}, or @internalsref{ChoirStaff} context.
-
-Contexts associated with sheet music output are called @emph{notation
-contexts}, those for sound output are called @emph{performance
-contexts}. The default definitions of the standard notation and
-performance contexts can be found in @file{ly/engraver-init.ly} and
-@file{ly/performer-init.ly}, respectively.
-
-@node Creating contexts
-@subsection Creating contexts
-
-@cindex @code{\context}
-@cindex context selection
-
-Contexts for a music expression can be selected manually, using the
-following music expression.
-
-@example
-  \context @var{contexttype} [= @var{contextname}] @var{musicexpr}
-@end example
-
-This instructs lilypond to interpret @var{musicexpr} within the context
- of type @var{contexttype} and with name @var{contextname}.  If this
-context does not exist, it will be created.  
-
-@lilypond[verbatim,singleline]
-\score {
-  \notes \relative c'' {
-    c4 <d4 \context Staff = "another" e4> f
-  }
-}
-
-@end lilypond
-
-In this example, the @code{c} and @code{d} are printed on the
-default staff.  For the @code{e}, a context Staff called
-@code{another} is specified; since that does not exist, a new
-context is created.  Within @code{another}, a (default) Voice context
-is created for the @code{e4}.  When all music referring to a
-context is finished, the context is ended as well.  So after the
-third quarter, @code{another} is removed.
-
-
-
-@node Default contexts
-@subsection Default contexts
-
-Most music expressions don't need an explicit @code{\context}
-declaration: they inherit the 
-notation context from their parent. Each note is a music expression, and
-as you can see in the following example, only the sequential music
-enclosing the three notes has an explicit context. 
-
-@lilypond[verbatim,singleline]
-\score { \notes \context Voice = goUp { c'4 d' e' } } 
-@end lilypond
-
-There are some quirks that you must keep in mind when dealing with
-defaults:
-
-First, every top level music is interpreted by the Score context, in other
-words, you may think of @code{\score} working like
-@example
-        \score @{
-                \context Score @var{music}
-        @}
-@end example
-
-Second, contexts are created automatically to be able to interpret the
-music expressions. Consider the following example.
-
-@lilypond[verbatim, singleline]
-\score { \context Score \notes { c'4 (  d' )e' } }
-@end lilypond
-
-The sequential music is interpreted by the Score context initially
-(notice that the @code{\context} specification is redundant), but when a
-note is encountered, contexts are setup to accept that note. In this
-case, a Thread, Voice and Staff are created. The rest of the sequential
-music is also interpreted with the same Thread, Voice and Staff context,
-putting the notes on the same staff, in the same voice.
-
-This is a convenient mechanism, but do not expect opening chords to work
-without @code{\context}. For every note, a separate staff is
-instantiated.
-
-@cindex explicit context
-@cindex starting with chords
-@cindex chords, starting with
-
-@lilypond[verbatim, singleline]
-\score { \notes <c'4 es'> } 
-@end lilypond
-
-Of course, if the chord is preceded by a normal note in sequential
-music, the chord will be interpreted by the Thread of the preceding
-note:
-@lilypond[verbatim,singleline]
-\score { \notes { c'4 <c'4 es'> }  }
-@end lilypond
-
-
-
-@node Context properties
-@subsection Context properties
-
-Notation contexts have properties. These properties are from
-the @file{.ly} file using the following  expression:
-@cindex @code{\property}
-@example
-  \property @var{contextname}.@var{propname} =  @var{value}
-@end example
-
-Sets the @var{propname} property of the context @var{contextname} to the
-specified Scheme expression @var{value}.  All @var{propname} and
-@var{contextname} are strings, which are typically unquoted.
-
-Properties that are set in one context are inherited by all of the
-contained contexts.  This means that a property valid for the
-@internalsref{Voice} context can be set in the @internalsref{Score} context (for
-example) and thus take effect in all @internalsref{Voice} contexts.
-
-Properties can be unset using the following expression:
-@example
-  \property @var{contextname}.@var{propname} \unset
-@end example
-
-@cindex properties, unsetting
-@cindex @code{\unset} 
-
-This removes the definition of @var{propname} in @var{contextname}. If
-@var{propname} was not defined in @var{contextname} (but was inherited
-from a higher context), then this has no effect.
-
-
-@refbugs
-
-The syntax of @code{\unset} is asymmetric: @code{\property \unset} is not
-the inverse of @code{\property \set}.
-
-@node Engravers and performers
-@subsection Engravers and performers
-
-[TODO]
-
-Basic building blocks of translation are called engravers; they are
-special C++ classes.
-
-
-
-@c .  {Context definitions}
-@node Changing context definitions
-@subsection Changing context definitions
-
-@cindex context definition
-@cindex translator definition
-
-The most common way to define a context is by extending an existing
-context.  You can change an existing context from the paper block, by
-first initializing a translator with an existing context identifier:
-@example
-\paper @{
-  \translator @{
-    @var{context-identifier}
-  @} @}
-@end example
-Then you can add and remove engravers using the following syntax:
-@example
- \remove @var{engravername}
- \consists @var{engravername}
-@end example
-
-
-Here @var{engravername} is a string, the name of an engraver in the
-system.
-
-
-@lilypond[verbatim,singleline]
-\score {  \notes {
-        c'4 c'4 }
-  \paper {
-    \translator  { \StaffContext
-        \remove Clef_engraver
-       } } }
-@end lilypond
-
-@cindex engraver
-
-You can also set properties in a translator definition. The syntax is as
-follows:
-@example
- @var{propname} = @var{value}
- @var{propname} \set  @var{grob-propname} = @var{pvalue}
- @var{propname} \override @var{grob-propname} =  @var{pvalue}
- @var{propname} \revert @var{grob-propname} 
-@end example
-@var{propname} is a string, @var{grob-propname} a symbol, @var{value}
-and @code{pvalue} are Scheme expressions. These type of property
-assignments happen before interpretation starts, so a @code{\property}
-command will override any predefined settings.
-
-
- To simplify editing translators, all standard contexts have standard
-identifiers called @var{name}@code{Context}, e.g. @code{StaffContext},
-@code{VoiceContext}, see @file{ly/engraver-init.ly}.
-
-@node Defining new contexts
-@subsection Defining new contexts
-
-If you want to build a context from scratch, you must also supply the
-following extra information:
-@itemize @bullet
-  @item  A name, specified by @code{\name @var{contextname}}.
-
-  @item A cooperation module. This is specified by   @code{\type
-@var{typename}}.
-@end itemize
-
-This is an example:
-@example
-\translator @code{
-  \type "Engraver_group_engraver"
-  \name "SimpleStaff"
-  \alias "Staff"
-  \consists "Staff_symbol_engraver"
-  \consists "Note_head_engraver"
-  \consistsend "Axis_group_engraver"
-}@
-@end example
-
-The argument of @code{\type} is the name for a special engraver that
-handles cooperation between simple engravers such as
-@code{Note_head_engraver} and @code{Staff_symbol_engraver}. Alternatives
-for this engraver are the following:
-@table @code
-@cindex @code{Engraver_group_engraver}
-  @item @code{Engraver_group_engraver}  
-    The standard cooperation engraver.
-
-@cindex @code{Score_engraver}
-
-  @item @code{Score_engraver}  
-    This is cooperation module that should be in the top level context,
-and only the top level context.
-
-@cindex @code{Grace_engraver_group}
-
-  @item @code{Grace_engraver_group}  
-    This is a special cooperation module (resembling
-    @code{Score_engraver}) that is used to create an embedded
-    `miniscore'.
-@end table 
-
-Other modifiers   are
-
-@itemize @bullet
-  @item @code{\alias} @var{alternate-name}
-    This specifies a different name. In the above example,
-@code{\property Staff.X = Y} will also work on @code{SimpleStaff}s
-
-  @item  @code{\consistsend} @var{engravername} 
-    Analogous to @code{\consists}, but makes sure that
-    @var{engravername} is always added to the end of the list of
-    engravers.
-
-    Some engraver types need to be at the end of the list; this
-    insures they stay there even if a user adds or removes engravers.
-End-users generally don't need this command.
-    
-  @item  @code{\accepts} @var{contextname}
-    Add @var{contextname} to the list of contexts this context can
-    contain in the context hierarchy. The first listed context is the
-    context to create by default.
-
-  @item @code{\denies}. The opposite of @code{\accepts}. Added for
-completeness, but is never used in practice.
-  
-  @item  @code{\name} @var{contextname} 
-    This sets the type name of the context, e.g. @internalsref{Staff},
-    @internalsref{Voice}.  If the name is not specified, the translator won't do
-    anything. 
-@end itemize
-
-In the @code{\paper} block, it is also possible to define translator
-identifiers.  Like other block identifiers, the identifier can only
-be used as the very first item of a translator.  In order to define
-such an identifier outside of @code{\score}, you must do
-
-@quotation
-@example 
-\paper @{
-  foo = \translator @{ @dots{} @}
-@}
-\score @{
-  \notes @{
-    @dots{}
-  @}
-  \paper @{
-    \translator @{ \foo @dots{} @}
-  @}
-@} 
-@end example 
-
-@end quotation
-
-
-@cindex paper types, engravers, and pre-defined translators
-
-      
-
-
-
-
-@c . {Syntactic details}
-@node Syntactic details
-@section Syntactic details
-@cindex Syntactic details
-
-This section describes details that were too boring to be put elsewhere.
-
-@menu
-* Top level::                   
-* Identifiers::                 
-* Music expressions::           
-* Manipulating music expressions::  
-* Span requests::               
-* Assignments::                 
-* Lexical modes::               
-* Ambiguities::                 
-@end menu
-
-@c .  {Top level}
-@node Top level
-@subsection Top level
-@cindex Top level
-
-This section describes what you may enter at top level.
-
-
-@c .   {Score}
-@subsubsection Score
-@cindex Score
-
-@cindex score definition
-
-The output is generated combining a music expression with an output
-definition.  A score block has the following syntax:
-
-@example
-  \score @{ @var{musicexpr} @var{outputdefs} @}
-@end example
-
-@var{outputdefs} are zero or more output definitions.  If none is
-supplied, the default @code{\paper} block will be added.
-
-
-
-@c .   {Default output}
-@subsubsection Default output
-
-Default values for the @code{\paper} and @code{\midi} block are set by
-entering such a block at the top level.
-
-@c .   {Header}
-@subsubsection Header
-@cindex Header
-@cindex @code{\header}
-
-
-A header describes bibliographic information of the file's contents.  It
-can also appear in a @code{\score} block.  Tools like @code{ly2dvi} can
-use this information for generating titles.  Key values that are used by
-@code{ly2dvi} are: title, subtitle, composer, opus, poet, instrument,
-meter, arranger, piece and tagline.
-
-@cindex @code{ly2dvi}
-
-The syntax is
-@example
-  \header @{ @var{key1} = @var{val1}
-             @var{key2} = @var{val2} @dots{} @}
-@end example
-
-It is customary to put the @code{\header} at the top of the file.
-
-@subsubsection Default output
-
-A @code{\midi} or @code{\paper} block at top level sets the default
-paper block for all scores that lack an explicit paper block.
-
-@c .  {Identifiers}
-@node Identifiers
-@subsection Identifiers
-@cindex  Identifiers
-
-@ignore
- What has this section got to do with identifiers?
- It seems more appropriate in the introduction to Chapter 4,
- "Internals".
-
-   /MB
-@end ignore
-
-All of the information in a LilyPond input file, is internally
-represented as a Scheme value. In addition to normal Scheme data types
-(such as pair, number, boolean, etc.), LilyPond has a number of
-specialized data types,
-
-@itemize @bullet
-@item Input
-@item c++-function
-@item Music
-@item Identifier
-@item Translator_def
-@item Duration
-@item Pitch
-@item Score
-@item Music_output_def
-@item Moment (rational number)
-@end itemize
-
-LilyPond also includes some transient object types. Objects of these
-types are built during a LilyPond run, and do not `exist' per se within
-your input file. These objects are created as a result of your input
-file, so you can include commands in the input to manipulate them,
-during a lilypond run.
-
-@itemize @bullet
-@item Grob: short for Graphical object. 
-@item Molecule: device-independent page output object,
-including dimensions.  Produced by some Grob functions
-@item Translator: object that produces audio objects or Grobs. This is
-not yet user accessible.
-@item Font_metric: object representing a font.
-@end itemize
-
-
-@node Music expressions
-@subsection Music expressions
-
-@cindex music expressions
-
-Music in LilyPond is entered as a music expression.  Notes, rests, lyric
-syllables are music expressions, and you can combine music expressions
-to form new ones, for example by enclosing a list of expressions in
-@code{\sequential @{ @}} or @code{< >}.  In the following example, a
-compound expression is formed out of the quarter note @code{c} and a
-quarter note @code{d}:
-
-@example 
-\sequential @{ c4 d4 @} 
-@end example 
-
-@cindex Sequential music
-@cindex @code{\sequential}
-@cindex sequential music
-@cindex @code{<}
-@cindex @code{>}
-@cindex Simultaneous music
-@cindex @code{\simultaneous}
-
-The two basic compound  music expressions are simultaneous  and
-sequential music.
-
-@example
-  \sequential @code{@{} @var{musicexprlist} @code{@}}
-  \simultaneous @code{@{} @var{musicexprlist} @code{@}}
-@end example
-For both, there is a shorthand:
-@example
-  @code{@{} @var{musicexprlist} @code{@}}
-@end example
-for sequential and
-@example
-  @code{<} @var{musicexprlist} @code{>}
-@end example
-for simultaneous music.
-In principle, the way in which you nest sequential and simultaneous to
-produce music is not relevant.  In the following example, three chords
-are expressed in two different ways:
-
-@lilypond[fragment,verbatim,center]
-  \notes \context Voice {
-    <a c'> <b  d' > <c' e'>
-    < { a b  c' } { c' d' e' } >
-  }
-@end lilypond
-
-
-Other compound music expressions include
-@example
- \repeat @var{expr}
- \transpose @var{pitch} @var{expr}
- \apply @var{func} @var{expr}
- \context @var{type} = @var{id} @var{expr}
- \times @var{fraction} @var{expr}
-@end example
-
-
-@c . {Manipulating music expressions}
-@node Manipulating music expressions
-@subsection  Manipulating music expressions
-
-The @code{\apply} mechanism gives you access to the internal
-representation of music. You can write Scheme-functions that operate
-directly on it. The syntax is 
-@example
-        \apply #@var{func} @var{music}
-@end example
-This means that @var{func} is applied to @var{music}.  The function
-@var{func} should return a music expression.
-
-This example replaces the text string of a script. It also shows a dump
-of the music it processes, which is useful if you want to know more
-about how music is stored.
-
-@lilypond[verbatim,singleline]
-#(define (testfunc x)
-        (if (equal? (ly-get-mus-property x 'text) "foo")
-                (ly-set-mus-property x 'text "bar"))
-        ;; recurse
-        (ly-set-mus-property x 'elements
-          (map testfunc (ly-get-mus-property x 'elements)))
-        (display x)
-        x        
-)
-\score { \notes
-  \apply #testfunc { c'4_"foo" }
-} 
-@end lilypond
-
-For more information on what is possible, see the automatically
-generated documentation.
-
-
-Directly accessing internal representations is dangerous: the
-implementation is subject to changes, so you should avoid this feature
-if possible.
-
-A final example is a function that reverses a piece of music in time:
-
-@lilypond[verbatim,singleline]
-#(define (reverse-music music)
-  (let* ((elements (ly-get-mus-property music 'elements))
-         (reversed (reverse elements))
-         (span-dir (ly-get-mus-property music 'span-direction)))
-    (ly-set-mus-property music 'elements reversed)
-    (if (dir? span-dir)
-        (ly-set-mus-property music 'span-direction (- span-dir)))
-    (map reverse-music reversed)
-    music))
-
-music = \notes { c'4 d'4( e'4 f'4 }
-
-\score { \context Voice {
-    \music
-    \apply #reverse-music \music
-  }
-}
-@end lilypond
-
-More examples are given in the distributed example files in
-@code{input/test/}.
-
-@c .   {Span requests}
-@menu
-* Span requests::               
-@end menu
-
-@node Span requests
-@subsection Span requests
-@cindex Span requests
-
-Notational constructs that start and end on different notes can be
-entered using span requests. The syntax is as follows:
-
-
-@example
-  \spanrequest @var{startstop} @var{type}
-@end example
-
-
-@cindex @code{\start}
-@cindex @code{\stop}
-
-This defines a spanning request. The @var{startstop} parameter is either
--1 (@code{\start}) or 1 (@code{\stop}) and @var{type} is a string that
-describes what should be started.  Much of the syntactic sugar is a
-shorthand for @code{\spanrequest}, for example,
-
-@lilypond[fragment,verbatim,center]
-  c'4-\spanrequest \start "slur"
-  c'4-\spanrequest \stop "slur"
-@end lilypond
-
-Among the supported types are @code{crescendo}, @code{decrescendo},
-@code{beam}, @code{slur}. This is an internal command.  Users are
-encouraged to use the shorthands which are defined in the initialization
-file @file{spanners.ly}.
-
-
-@c .   {Assignments}
-@node Assignments
-@subsection Assignments
-@cindex Assignments
-
-Identifiers allow objects to be assigned to names during the parse
-stage.  To assign an identifier, you use @var{name}@code{=}@var{value}
-and to refer to an identifier, you precede its name with a backslash:
-`@code{\}@var{name}'.  @var{value} is any valid Scheme value or any of
-the input-types listed above.  Identifier assignments can appear at top
-level in the LilyPond file, but also in @code{\paper} blocks.
-
-An identifier can be created with any string for its name, but you will
-only be able to refer to identifiers whose names begin with a letter,
-being entirely alphabetical.  It is impossible to refer to an identifier
-whose name is the same as the name of a keyword.
-
-The right hand side of an identifier assignment is parsed completely
-before the assignment is done, so it is allowed to redefine an
-identifier in terms of its old value, e.g.
-
-@example
-foo = \foo * 2.0
-@end example
-
-When an identifier is referenced, the information it points to is
-copied.  For this reason, an identifier reference must always be the
-first item in a block.
-@example
-\paper  @{
-  foo = 1.0
-  \paperIdent % wrong and invalid
-@}
-
-\paper @{
-  \paperIdent % correct
-  foo = 1.0 @}
-@end example
-
-
-@c .  {Lexical modes}
-@node Lexical modes
-@subsection Lexical modes
-@cindex Lexical modes
-@cindex input mode
-@cindex mode, input 
-@cindex @code{\notes}
-@cindex @code{\chords}
-@cindex @code{\lyrics}
-
-To simplify entering notes, lyrics, and chords, LilyPond has three
-special input modes in addition to the default mode: note, lyrics and
-chords mode.  These input modes change the way that normal, unquoted
-words are interpreted: for example, the word @code{cis} may be
-interpreted as a C-sharp, as a lyric syllable `cis' or as a C-sharp
-major triad respectively.
-
-A mode switch is entered as a compound music expression
-@example
-@code{\notes} @var{musicexpr}
-@code{\chords} @var{musicexpr}
-@code{\lyrics} @var{musicexpr}.
-@end example
-
-In each of these cases, these expressions do not add anything to the
-meaning of their arguments.  They just instruct the parser in what mode
-to parse their arguments.  The modes are treated in more detail in
-@ref{Lyrics} and @ref{Chords}.
-
-Different input modes may be nested.
-
-@c .  {Ambiguities}
-@node Ambiguities
-@subsection Ambiguities
-@cindex ambiguities
-@cindex grammar
-
-
-The grammar contains a number of ambiguities. We hope to resolve them at
-some time.
-
-@itemize @bullet
-  @item  The assignment
-
-@example 
-foo = bar 
-@end example 
-         is interpreted as the string identifier assignment. However,
-it can also  be interpreted as making a string identifier @code{\foo}
-       containing @code{"bar"}, or a music identifier @code{\foo}
-       containing the syllable `bar'.  
-
-  @item  If you do a nested repeat like
-
-       @quotation
-
-@example 
-\repeat @dots{}
-\repeat @dots{}
-\alternative 
-@end example 
-
-       @end quotation
-
-       then it is ambiguous to which @code{\repeat} the
-       @code{\alternative} belongs.  This is the classic if-then-else
-       dilemma.  It may be solved by using braces.
-
-  @item The parser is not sophisticated enough to distinguish at the
-right time between
-        @code{c4*2 / 3 } and @code{c4*2 / g} (in chord mode).
-
-[checkme]
-
-@end itemize
-
-
-@c .  {Lexical details}
-@node Lexical details
-@section Lexical details
-
-Even more boring details, now on lexical side of the input parser.
-
-@menu
-* Comments::                    
-* Direct Scheme::               
-* Reals::                       
-* Strings::                     
-* Main input::                  
-* File inclusion::              
-* Version information::         
-@end menu
-
-
-@node Comments
-@subsection Comments
-
-@cindex comments
-@cindex block comment
-@cindex line comment
-
-@cindex @code{%}
-
-A one line comment is introduced by a @code{%} character. 
-Block comments are started by @code{%@{} and ended by @code{%@}}. 
-They cannot be nested.
-
-@node Direct Scheme
-@subsection Direct Scheme
-
-@cindex Scheme
-@cindex GUILE
-@cindex Scheme, in-line code
-
-
-LilyPond contains a Scheme interpreter (the GUILE library) for
-internal use. In some places, Scheme expressions also form valid syntax:
-wherever it is allowed,
-@example
-  #@var{scheme}
-@end example
-evaluates the specified Scheme code.  Example:
-@example
-  \property Staff.TestObject \override #'foobar =  #(+ 1 2)
-@end example
-@code{\override} expects two Scheme expressions, so there are two Scheme
-expressions. The first one is a symbol (@code{foobar}), the second one
-an integer (namely, 3).
-
-In-line scheme may be used at the top level. In this case the result is
-discarded.
-
-Scheme is a full-blown programming language, and a full discussion is
-outside the scope of this document. Interested readers are referred to
-the website @uref{http://www.schemers.org/} for more information on
-Scheme.
-
-
-@node Reals
-@subsection Reals
-@cindex real numbers
-
-Formed from an optional minus sign and a sequence of digits followed
-by a @emph{required} decimal point and an optional exponent such as
-@code{-1.2e3}.  Reals can be built up using the usual operations:
-`@code{+}', `@code{-}', `@code{*}', and
-`@code{/}', with parentheses for grouping.
-
-@cindex @code{\mm},
-@cindex @code{\in}
-@cindex @code{\cm}
-@cindex @code{\pt}
-@cindex dimensions
-
-A real constant can be followed by one of the dimension keywords:
-@code{\mm} @code{\pt}, @code{\in}, or @code{\cm}, for millimeters,
-points, inches and centimeters, respectively.  This converts the number
-a number that is the internal representation of that dimension.
-
-
-@node Strings
-@subsection Strings
-@cindex string
-@cindex concatenate
-
-Begins and ends with the @code{"} character.  To include a @code{"}
-character in a string write @code{\"}.  Various other backslash
-sequences have special interpretations as in the C language.  A string
-that contains no spaces can be written without the quotes.  Strings can
-be concatenated with the @code{+} operator.
-
-
-@node Main input
-@subsection Main input
-@cindex Main input
-
-@cindex @code{\maininput}
-
-The @code{\maininput} command is used in init files to signal that the
-user file must be read. This command cannot be used in a user file.
-
-@node File inclusion
-@subsection File inclusion
-@cindex @code{\include}
-@example
-  \include @var{filename}
-@end example
-
-Include @var{filename}.  The argument @var{filename} may be a quoted string (an
-unquoted string will not work here!) or a string identifier.  The full
-filename including the @file{.ly} extension must be given,
-
-
-@node Version information
-@subsection Version information 
-@cindex @code{\version}
-@example
-  \version @var{string} 
-@end example
-
-Specify the version of LilyPond that a file was written for.  The
-argument is a version string in quotes, for example @code{"1.2.0"}.
-This is used to detect invalid input, and to aid @code{convert-ly} a
-tool that automatically upgrades input files. See the chapter
-@ref{Upgrading from older LilyPond versions} for more information on
-@code{convert-ly}.
-
-@cindex convert-ly
-
-
-
-
-
-@c broken with  emacs-21
-@c {Local emac s  vars}
-@c Local varia bles:
-@c mode: texi nfo
-@c minor-mod e: font-lock
-@c minor-mo de: outline
-@c outline -layout: (-1 : 0)
-@c outlin e-use-mode-specific-leader: "@c \."
-@c outli ne-primary-bullet: "{"
-@c outli ne-stylish-prefixes: nil
-@c outli ne-override-protect: t
-@c End:
-
index e0592acfae0dac10fe4163d39777689838b16277..a79be72b540aa242e4f39a36710cf7e405489015 100644 (file)
 
 @menu
 * First steps::                 Music language of LilyPond
-* Cheat sheet::                 
 * Running LilyPond::            Printing music
-* The first real tune::         The first real tune
-* Lyrics and chords::           Lyrics and chords
+* Printing lyrics::             
+* A melody with chords ::       
+* More stanzas::                
 * More movements ::             Joining separate pieces of music
 * A piano excerpt::             Piano music
 * Fine tuning a piece::         
@@ -34,19 +34,16 @@ LilyPond to produce printed output; you should then be able to create
 your first sheets of music. The tutorial continues with more and more
 complex examples.
 
-
-@c title?
+Some of the examples discussed are included as separate files in the
+distribution, in the subdirectory @file{input/tutorial/} of the source
+package.
 
 @node First steps
 @section First steps
 
-@c @node Music language of LilyPond
-@c @section Music language of LilyPond
-
 In this section, we show how to make small, very simple pieces of
 music in LilyPond.  If you have not seen LilyPond input files before,
-this section is for you. The contents of this section are summarized
-in the Cheat Sheet (See @ref{Cheat sheet}).
+this section is for you.
 
 You get a simple note by typing its note name, from @code{a} through
 @code{g}. So if you enter
@@ -65,8 +62,8 @@ then the result looks like this:
 @end quotation
 @separate
 
-We continue showing  LilyPond input like we did previously: first a
-snippet of input, then the resulting output.
+We will continue with this format: first we show a snippet of input,
+then the resulting output.
 
 The length of a note is specified by adding a number, ``@code{1}'' for a
 whole note, ``@code{2}'' for a half note, and so on:
@@ -92,7 +89,7 @@ s16_" "
 If you don't specify a duration, the previous one is used: 
 @quotation
 @example
-a a a2 a
+a4 a a2 a
 @end example
 
 @c missing clef seems to raise more questions than actual pitch of notes,
@@ -211,10 +208,10 @@ At this point, the piece of music is ready to be printed.  This is done
 by combining the music with a printing command.
 
 The printing command is the so-called ``@code{\paper}'' block.  You
-will see later that the \paper block is necessary to customize all
-kinds of printing specifics.  The music and the \paper block are
-combined by enclosing them in ``@code{\score @{ ... @}}''.  This is
-what a full LilyPond source file looks like:
+will see later that the @code{\paper} block is necessary to customize
+printing specifics.  The music and the @code{\paper} block are combined by
+enclosing them in ``@code{\score @{ ... @}}''.  This is what a full
+LilyPond source file looks like:
 
 @quotation
 @example
@@ -244,10 +241,72 @@ what a full LilyPond source file looks like:
 @separate
 
 
-We continue with the introduction of the remaining musical constructs.
+@strong{SUMMARY}
+
+@multitable @columnfractions  .3 .3 .4  
+
+@item @b{Syntax}
+@tab @b{Description}
+@tab @b{Example}
+
+@item @code{1 2 8 16}
+@tab durations 
+@tab
+@lilypond[fragment, relative 1]
+\property Staff.TimeSignature = \turnOff
+\property Staff.autoBeaming = ##f
+\property Staff.Clef = \turnOff
+c1 c2 c8 c16
+@end lilypond
+
+@item @code{. ..}
+@tab augmentation dots
+@tab
+@lilypond[fragment, relative 1]
+\property Staff.TimeSignature = \turnOff
+\property Staff.Clef = \turnOff
+c4. c4..  
+@end lilypond
+
+@item @code{c d e f g a b }
+@tab scale 
+@tab
+@lilypond[fragment, relative 1]
+\property Staff.TimeSignature = \turnOff
+\property Staff.Clef = \turnOff
+c d e f g a b
+@end lilypond
+
+@item @code{\clef treble \clef bass }
+@tab clefs
+@tab
+@lilypond[fragment]
+\property Staff.TimeSignature \set #'transparent = ##t 
+\clef treble
+s4_" "
+\clef bass
+s4_" "
+@end lilypond
+
+@item @code{\time 3/4 \time 4/4 }
+@tab time signature
+@tab
+@lilypond[fragment]
+\property Staff.Clef \set #'transparent = ##t 
+\time 3/4
+s4_" "
+\time 4/4
+s16_" "
+@end lilypond
+
+@end multitable
+
 
 @c maybe legend here?
 
+
+We continue with the introduction of the remaining musical constructs.
+
 Normal rests are entered just like notes with the name ``@code{r}'':
 
 @quotation
@@ -321,15 +380,14 @@ g'
 @c bit on the long/complex/scary taste
 @c cheating a bit: two lines makes for a friendlier look
 This example shows notes, ties, octave marks, and rests in action.
-Don't worry about all the quotes.
 
 @quotation
 @example
 \score @{
   \notes @{
     \time 4/4
-    \clef violin
     \key d \minor
+    \clef violin
     r4 r8 d''8 cis''4 e''
     d''8 a'4. ~ a' b'8
     cis''4 cis''8 cis'' bis'4 d''8 cis'' ~
@@ -356,33 +414,25 @@ Don't worry about all the quotes.
 @end quotation
 
 @c accidentals...
-There are some interesting points to note in this example.  Firstly,
-accidentals (sharps and flats) don't have to be marked explicitly: you
+There are some interesting points to note in this example.
+Accidentals (sharps and flats) don't have to be marked explicitly: you
 just enter the note name, and LilyPond determines whether or not to
-print an accidental.  Secondly, bar lines and beams are drawn
-automatically.  Thirdly, LilyPond calculates line breaks for you; it
-doesn't matter where you make new lines in the source file.
+print an accidental.  Bar lines and beams are drawn automatically.
+LilyPond calculates line breaks for you; it doesn't matter where you
+make new lines in the source file. Finally, the order of time, key and
+clef changes is not relevant: lilypond will use standard notation
+conventions for ordering these items.
 
 The example also indicates that a piece of music written in a high
 register needs lots of quotes.  This makes the input less readable,
 and is therefore also a potential source of errors.
 
-@separate
-
-The solution is to use ``relative octave'' mode.  In practice, most
-music is entered using this mode.
-
-To use relative mode, add @code{\relative} before the piece of music.
-You must also give a note from which relative starts, in this case
-@code{c''}.
-
-@c In relative octave mode, quotes are used to mark large jumps in the
-@c melody.  Without any quotes or commas, the interval between a note and
-@c its predecessor is assumed to be a fourth or less.  Quotes and commas
-@c add octaves in up and down direction.
-
-If you type no octaviation quotes, relative mode chooses the note that
-is closest to the previous one, which is often just the one you need.
+The solution is to use ``relative octave'' mode.  In practice, this is
+the most convenient way to copy existing music.  To use relative mode,
+add @code{\relative} before the piece of music.  You must also give a
+note from which relative starts, in this case @code{c''}.  If you type
+no octavation quotes, relative mode chooses the note that is closest
+to the previous one, which is often just the one you need.
 @c don't use commas or quotes in this sentence
 For example: @code{c f} goes up; @code{c g} goes down:
 
@@ -406,7 +456,7 @@ For example: @code{c f} goes up; @code{c g} goes down:
 @c needed better, maybe even redundant explanation
 @c grappig: Pa vond het heel logies, en slim toen-i eenmaal begreep.
 @c in eerste instantie drong het `relative' niet door zonder extra uitleg.
-You can make a large interval by adding octaviation quotes.  Note that
+You can make a large interval by adding octavation quotes.  Note that
 quotes or commas do not determine the absolute height of a note;
 the height of a note is relative to the previous one.
 @c don't use commas or quotes in this sentence
@@ -430,6 +480,71 @@ For example: @code{c f,} goes down; @code{f, f} are both the same;
 @end quotation
 @separate
 
+
+@strong{SUMMARY}
+
+@multitable @columnfractions .3 .3 .4  
+
+@item @b{Syntax}
+@tab @b{Description}
+@tab @b{Example}
+
+@item @code{r4 r8}
+@tab rest 
+@tab
+@lilypond[fragment, relative 1]
+\property Staff.TimeSignature = \turnOff
+\property Staff.Clef = \turnOff
+r4 r8
+@end lilypond
+
+
+@item @code{~}
+@tab tie
+@tab
+@lilypond[fragment, relative 1]
+\property Score.timing = ##f
+\property Staff.TimeSignature = \turnOff
+\property Staff.autoBeaming = ##f
+\property Staff.Clef = \turnOff
+d ~ d
+@end lilypond
+
+
+@item @code{\key es \major }
+@tab key signature
+@tab
+@lilypond[fragment]
+\property Staff.TimeSignature \set #'transparent = ##t
+\clef treble
+\key es \major
+s4 
+@end lilypond
+
+@item @code{'}
+@tab raise octave
+@tab
+@lilypond[fragment, relative 1]
+\property Score.timing = ##f
+\property Staff.TimeSignature = \turnOff
+\property Staff.autoBeaming = ##f
+\property Staff.Clef = \turnOff
+a a'
+@end lilypond
+
+@item @code{,}
+@tab lower octave
+@tab
+@lilypond[fragment, relative 1]
+\property Score.timing = ##f
+\property Staff.TimeSignature = \turnOff
+\property Staff.autoBeaming = ##f
+\property Staff.Clef = \turnOff
+c c,
+@end lilypond
+
+@end multitable
+
 A slur is drawn across many notes, and indicates bound articulation
 (legato).  The starting note and ending note are marked with a
 ``@code{(}'' and a ``@code{)}'' respectively:
@@ -446,6 +561,13 @@ phrasing), you can also make a phrasing slur with @code{\(} and
 @code{\)}.
 
 @c lousy example
+@c ? --hwn
+@c fragment of 1st hrn in Adams' The Chairman Dances, with creative
+@c chromatic thing pasted in front.  (admittedly the original doesn't
+@c have a phrasing slur. The problem is that we don't want the slur
+@c and the Phrasing slur to collide. We're trying to make a good
+@c impression here.
+
 @quotation
 @lilypond[fragment,relative 1, verbatim]
 a8(\( ais b ) c cis2 b'2 a4 cis, \) c
@@ -478,15 +600,15 @@ demonstrated here:
 @end quotation
 
 In this example, @code{staffA} and @code{staffB} are names that are
-given to the staves.  For now, it doesn't matter what names you give, as
-long as each staff has a unique name.
+given to the staves.  It doesn't matter what names you give, as long
+as each staff has a unique name.
 
 @separate
 
 We can typeset a melody with two staves now:
 
 @quotation
-@lilypond[verbatim]
+@lilypond[verbatim,singleline]
 \score {
   \notes 
   < \context Staff = staffA {
@@ -564,8 +686,13 @@ When you want to combine chords with slurs and dynamics, technical
 detail crops up: you have type these commands next to the notes, which
 means that they have to be inside the @code{< >}:
 
+
 @quotation
-@lilypond[relative 0, fragment,verbatim]
+@example
+r4 <c8 e g \> ( > <c e g> <c e g>  < ) \! c8 f a>
+@end example
+@lilypond[relative 0, fragment]
+\slurUp
 r4 <c8 e g \> ( > <c e g> <c e g>  < ) \! c8 f a>
 @end lilypond
 @end quotation
@@ -584,10 +711,10 @@ Of course, it is a allowed, but the result might not be what you expect:
 @end quotation
 @separate
 
-Of course, it is possible to typeset pieces that start with a chord,
-but you must make explicit that the notes of chord are to be put on
-the same staff, in the same voice.  This is done by specifying
-@code{\context Staff} for the notes:
+If you have a piece that starts with a chord, then you must explicitly
+state that the notes of the chord are to be put on the same staff, in
+the same voice.  This is done by specifying @code{\context Staff} for
+the notes:
 
 @quotation
 @lilypond[verbatim,singleline]
@@ -598,147 +725,38 @@ the same staff, in the same voice.  This is done by specifying
 
 
 
+@strong{SUMMARY}
 
-@ignore
-[TODO add some more here
-
-* lyrics, chords (?)
-
-* \header
-
-* identifiers?
-
-]
-@end ignore
-
-This is the end of the simple tutorial. You know the basic ingredients
-of a music file, so this is the right moment to try your at hand at
-doing it yourself: try to type some simple examples, and experiment a
-little.
-
-When you're comfortable with the basics, then you might want to read the
-rest of this chapter. It also a manual in tutorial-style, but it is much
-more in-depth. It will also be very intimidating if you're not familiar
-with the basics.  It deals with some of the more advanced features of
-LilyPond. Topics include lyrics, chords, orchestral scores and parts,
-fine tuning output, polyphonic music, and integrating text and music.
-
-
-@c refer to this section
-@node Cheat sheet
-@section Cheat sheet
-
-
-@c need texinfo-4.0a or later for this
-
-
-@c both Tim and my father came independently with a request for a
-@c `legend' like this.
-
-@c what should be in it?
-
-
-
-@multitable @columnfractions .20 .20 .30  .20
+@multitable @columnfractions .3 .3 .4  
 
 @item @b{Syntax}
 @tab @b{Description}
 @tab @b{Example}
-@tab @b{Grob name}
 
-@item @code{1 2 8 16}
-@tab durations 
-@tab
-@lilypond[fragment, relative 1]
-\property Staff.TimeSignature = \turnOff
-\property Staff.autoBeaming = ##f
-\property Staff.Clef = \turnOff
-c1 c2 c8 c16
-@end lilypond
 
-@item @code{. ..}
-@tab augmentation dots
-@tab
-@lilypond[fragment, relative 1]
-\property Staff.TimeSignature = \turnOff
-\property Staff.Clef = \turnOff
-c4. c4..  
-@end lilypond
-@tab @internalsref{Dot}, @internalsref{DotColumn}
-
-@item @code{c d e f g a b }
-@tab scale 
+@item @code{( )}
+@tab slur
 @tab
 @lilypond[fragment, relative 1]
+\property Score.timing = ##f
 \property Staff.TimeSignature = \turnOff
+\property Staff.autoBeaming = ##f
 \property Staff.Clef = \turnOff
-c d e f g a b
+c( d )e
 @end lilypond
-@tab @internalsref{NoteHead}
 
-@item @code{es is}
-@tab flat/sharp
-@tab
-@lilypond[fragment, relative 2]
-\property Staff.TimeSignature = \turnOff
-\property Staff.Clef = \turnOff
-bes4 cis4  
-@end lilypond
-@tab @internalsref{Accidental}
 
-@item @code{-. -^ ->}
-@tab articulations (1)
+@item @code{\( \)}
+@tab phrasing slur
 @tab
 @lilypond[fragment, relative 1]
+\property Score.timing = ##f
 \property Staff.TimeSignature = \turnOff
+\property Staff.autoBeaming = ##f
 \property Staff.Clef = \turnOff
-c-. c-^ c->
+c\(  c() d \)e
 @end lilypond
-@tab @internalsref{Script}
 
-@item @code{-\trill -\fermata}
-@tab articulations (2)
-@tab
-@lilypond[fragment, relative 1]
-\property Staff.TimeSignature = \turnOff
-\property Staff.Clef = \turnOff
-c-\trill c-\fermata 
-@end lilypond
-@tab @internalsref{Script}
-
-@item @code{\time 3/4 \time 4/4 }
-@tab time signature
-@tab
-@lilypond[fragment]
-\property Staff.Clef \set #'transparent = ##t 
-\time 3/4
-s4_" "
-\time 4/4
-s16_" "
-@end lilypond
-@tab @internalsref{TimeSignature}
-
-@item @code{\clef treble \clef bass }
-@tab clefs
-@tab
-@lilypond[fragment]
-\property Staff.TimeSignature \set #'transparent = ##t 
-\clef treble
-s4_" "
-\clef bass
-s4_" "
-@end lilypond
-@tab @internalsref{Clef}
-
-@item @code{\sfz \mf }
-@tab dynamics
-@tab
-@lilypond[fragment,relative 1]
-\property Staff.TimeSignature = \turnOff
-\property Staff.Clef = \turnOff
-c\sfz c\mf
-@end lilypond
-@tab @internalsref{DynamicText}
 
 @item @code{[ ]}
 @tab beam
@@ -750,67 +768,36 @@ c\sfz c\mf
 \property Staff.Clef = \turnOff
 [a8 b]
 @end lilypond
-@tab @internalsref{Beam}
 
-@item @code{~}
-@tab tie
-@tab
-@lilypond[fragment, relative 1]
-\property Score.timing = ##f
-\property Staff.TimeSignature = \turnOff
-\property Staff.autoBeaming = ##f
-\property Staff.Clef = \turnOff
-d ~ d
-@end lilypond
-@tab @internalsref{Tie} 
 
-@item @code{( )}
-@tab slur
+@item @code{< \context Staff ... >}
+@tab more staffs
 @tab
-@lilypond[fragment, relative 1]
-\property Score.timing = ##f
-\property Staff.TimeSignature = \turnOff
-\property Staff.autoBeaming = ##f
-\property Staff.Clef = \turnOff
-c( d )e
+@lilypond[fragment]
+< \context Staff = SA { c'1 }
+  \context Staff = SB { c'1 } >
 @end lilypond
-@tab @internalsref{Slur}
 
-@item @code{'}
-@tab raise octave
+  
+@item @code{-> -.}
+@tab articulations
 @tab
 @lilypond[fragment, relative 1]
-\property Score.timing = ##f
 \property Staff.TimeSignature = \turnOff
-\property Staff.autoBeaming = ##f
 \property Staff.Clef = \turnOff
-a a'
+c-> c-.
 @end lilypond
-@tab
 
-@item @code{,}
-@tab lower octave
-@tab
-@lilypond[fragment, relative 1]
-\property Score.timing = ##f
-\property Staff.TimeSignature = \turnOff
-\property Staff.autoBeaming = ##f
-\property Staff.Clef = \turnOff
-c c,
-@end lilypond
-@tab
 
-@item @code{< >}
-@tab chord
+@item @code{-\mf -\sfz}
+@tab dynamics
 @tab
 @lilypond[fragment, relative 1]
-\property Score.timing = ##f
 \property Staff.TimeSignature = \turnOff
-\property Staff.autoBeaming = ##f
 \property Staff.Clef = \turnOff
-\context Voice { <a c> }
+c-\mf c-\sfz
 @end lilypond
-@tab 
+
 
 @item @code{\< \!}
 @tab crescendo
@@ -822,7 +809,6 @@ c c,
 \property Staff.Clef = \turnOff
 a\< a \!a
 @end lilypond
-@tab @internalsref{Hairpin}
 
 @item @code{\> \!}
 @tab decrescendo
@@ -834,11 +820,26 @@ a\< a \!a
 \property Staff.Clef = \turnOff
 a\> a \!a
 @end lilypond
-@tab @internalsref{Hairpin}
+
+
+@item @code{< >}
+@tab chord
+@tab
+@lilypond[fragment, relative 1]
+\context Voice <c e> 
+@end lilypond
 
 @end multitable
 
+You know the basic ingredients of a music file, so this is the right
+moment to try your at hand at doing it yourself: try to type some
+simple examples, and experiment a little.
 
+When you're comfortable with the basics, then you might want to read
+the rest of this chapter. It also a manual in tutorial-style, but it
+is much more in-depth, dealing with more advanced topics such as
+lyrics, chords, orchestral scores and parts, fine tuning output,
+polyphonic music, and integrating text and music.
 
 
 @node Running LilyPond
@@ -946,373 +947,145 @@ the PS file can be done with:
 @code{gsview32 test.ps}
 @end example
 @end quotation
-You can also print from the command line by executing:
-@quotation
-@example
-@code{gsview32 /s test.ps}
-@end example
-@end quotation
-
-
-@node The first real tune
-@section The first real tune
-
-
-The rest of this tutorial will demonstrate how to use Lilypond by
-presenting examples of input along with resulting output.  We will use
-English terms for notation.  In case you are not familiar with those,
-you may consult the glossary that is distributed with LilyPond.
-
-The examples discussed are included in the distribution, in the
-subdirectory @file{input/tutorial/}@footnote{When we refer to filenames,
-they are relative to the top directory of the source package. }
-
-To demonstrate what LilyPond input looks like, we start off with a
-full-fledged, yet simple example. It is a convoluted version
-of the famous minuet in J. S. Bach's @emph{Klavierb@"uchlein}. The file
-is included in the distribution as  @file{minuet.ly}.
-@cindex Bach, Johann Sebastian 
-
-@lilypond[verbatim]
-% all text after a percent sign is a comment
-% and is ignored by LilyPond
-\include "paper16.ly"
-\score {
-    \notes                        
-    \relative c'' \sequential {
-            \time 3/4                
-            \key g \major
-
-        \repeat "volta" 2 {
-            d4 g,8 a b c d4 g, g |
-            e'4 c8 d e fis g4 g, g |
-            c4 d8( )c b a( )b4 c8 b a g |
-            a4 [b8 a] [g fis] g2.  |
-        }
-
-        b'4 g8 a b g
-        a4 d,8 e fis d |
-        g4 e8 fis g d cis4 b8 cis a4 |
-        a8-. b-. cis-. d-. e-. fis-.
-        g4 fis e |
-        fis a,  r8 cis8
-        d2.-\fermata
-        \bar "|."
-    }
-    \paper {
-       % standard settings are too big and wide for a book
-       indent = 1.0 \cm
-       linewidth = 15.0 \cm
-   }
-}
-@end lilypond
-
-We will analyse the input, line by line.
-@separate
-@example
-        % all text after a percent sign is a comment
-        % and is ignored by LilyPond
-@end example 
-Percent signs introduce comments: everything after a percent sign is
-ignored. You can use this If you want to write down mental notes to
-yourself in a file, then you can enter preceded with a @code{%} sign.
-These lines are called comments. If you have long winded mental notes,
-you can make comments that span several lines by enclosing text in
-@code{%@{} and @code{%@}}.
-@cindex comment
-@cindex block comment
-@cindex line comment
-@separate
-@example 
-
-        \include "paper16.ly"
-@end example
-@cindex @code{\include}
-@cindex point, printer's
-@cindex staff size, setting
-@cindex font size, setting
-
-By default, LilyPond will typeset the music in a size such that each
-staff is 20 point (0.7 cm, or 0.27 inch) high.  We want smaller output
-(16 point staff height), so we must import the settings for that size,
-which is done here.
-@separate
-@example 
-
-        \score @{
-@end example 
-Music is printed by combining a piece of music with directions for
-outputting it.  This combination is formed in the @code{\score} block.
-@separate
-@example 
-
-        \notes                
-@end example 
-Prepare LilyPond for accepting notes.
-@cindex octaves, choosing
-@cindex pitch
-@separate
-@example 
-
-        \relative c''
-@end example
-@cindex relative
-@c removed duplicate introduction to octave marks /MB
-@c Shorten even more?
-
-@c As we will see, each note is described by its note name, duration,
-@c octave and possibly a chromatic alteration.  In this setup, the octave
-@c is indicated by using high quotes (@code{'}) and ``lowered quotes''
-@c (commas: @code{,}).  The central C is denoted by @code{c'}.  The C one
-@c octave higher is @code{c''}.  One and two octaves below the central C is
-@c denoted by @code{c} and @code{c,} respectively.
-
-Even though a piece of music often spans a range of several octaves,
-often melodies move in small intervals. Such melodies can be entered
-easily using @code{\relative}.  In this ``relative octave mode'',
-octaves of notes without quotes are chosen such that a note is as
-close as possible (graphically, on the staff) to the preceding note.
-If you add a high-quote an extra octave is added.  A lowered quote (a
-comma) will subtract an extra octave.
-
-Absolute starting pitch for this relative mode is given as the
-argument to @code{\relative}. In this case it is the @code{c''}, one
-octave above central C.
-@separate
-@example 
-
-        \sequential @{
-@end example 
-What follows is sequential music, i.e.,
-@cindex sequential music
-notes that are to be played and printed after each other.
-@separate
-@example 
-
-        \time 3/4
-@end example
-@cindex time signature, setting
-@cindex @code{\time}
-The @code{\time} command sets (or changes) the time signature of the
-current piece: a 3/4 sign is printed.  This setting is also used to
-generate bar lines at the right spots.
-@separate
-@example 
-
-        \key g \major
-@end example
-@cindex key signature, setting
-@cindex @code{\key}
-Set (or change) the current key signature to G-major.  Although in this
-example, the @code{\key} command happened to be entered after the
-@code{\time} command, in the output the time signature will be printed
-after the key signature; LilyPond knows about music typesetting
-conventions.
-@separate
-@example 
-
-        \repeat "volta" 2
-@end example 
-The following piece of music is played twice.  The first argument
-indicates the type of repeat.  In this case, @code{"volta"} means that
-prima volta/secunda volta brackets are used for the alternative
-endings---if there were any.
-
-A special notation for repeats allows you to get correct repeats in
-MIDI output. However, some extra trickery is needed to get this
-working, See @ref{Repeats and MIDI}.  
-@separate
-@example 
+You can also print from the command line by executing:
+@quotation
+@example
+@code{gsview32 /s test.ps}
+@end example
+@end quotation
 
-        @{
-@end example 
-The subject of the repeat is again sequential music.  Since
-@code{\sequential} is such a common construct, a shorthand is provided:
-just leave off @code{\sequential}, and the result is the same.
-@separate
-@example 
 
-        d4 g,8
-@end example 
-Two notes.  The first note is a quarter note with relative pitch
-@code{d}.  The relative music was started with a @code{c''}, so the real
-pitch of this note is @code{d''}.  The duration of a note is designated
-by a number; the @code{4} here represents a quarter note.
 
-The second note is an eight note with relative pitch @code{g,}.  The
-pitch is taken relative to the previous @code{d''}, making this
-note have real pitch @code{g'}.  The @code{8} represents an eight note.
-@separate
-@example 
+@node Printing lyrics
+@section Printing lyrics
+@cindex lyrics
 
-        a b
-@end example 
-Two more notes, with pitch @code{a} and @code{b}.  Because their
-duration is the same as the @code{g,8}, there is no need to enter the
-duration, but you may enter it anyway, i.e., @code{a8 b8}
-@separate
-@example 
+In this section we shall explain how to typeset the following
+fragment of The Free Software Song: 
+
+@lilypond[singleline]
+\score  { \notes { \addlyrics
+  \notes \relative c' {
+    \time 7/4
+    d'2 c4 b16 ( a g a b a b ) c a2
+    b2 c4 b8 ( a16 g ) a4 g2 }
+  \context Lyrics \lyrics { 
+    Join us now __ and
+    share the soft -- ware; }
+}
+\paper { linewidth = -1. }
+}
+@end lilypond
 
-        d4 g, g |
-@end example
-@cindex bar check
-@cindex @code{|}
-@cindex errors, finding 
-Three more notes.  The @code{|} character is a ``bar check''.  LilyPond
-will verify that bar checks are found at the start of a measure.  This can
-help you track down typing errors.
 
-@cindex alteration, chromatic
-@cindex chromatic alteration
-@separate
-@example 
+@cindex lyric mode
+@cindex @code{\lyrics}
 
-        c8 d e fis
 
-@end example 
-So far, no notes were chromatically altered.  Here is the first one
-that is: @code{fis}.  LilyPond uses Dutch note names, and ``Fis'' is
-the name for ``F sharp''.  There is no sharp sign in the output. The
-program keeps track of key signatures, and will only print accidentals
-if they are needed.  If you can not get used to Dutch names, then
-there also are names available in several other languages.
+To print lyrics, you must enter them, and then instruct lilypond to
+handle the lyrics by printing them.
+You can enter lyrics in a special input mode of LilyPond. This mode is
+called Lyrics mode, and it is introduced by the keyword @code{\lyrics}.
+The purpose of this mode is that you can enter lyrics as plain text,
+punctuation and accents without any hassle.
 
+Syllables are entered like notes, with pitches replaced by text.  For
+example, @code{Twin- kle twin- kle} enters four syllables.  Note that
+the hyphen has no special meaning for lyrics, and does not introduce
+special symbols.
 
-For groups of eighth notes and shorter, LilyPond can determine how the
-notes should form a beam.  In this case, the 4 eights are automatically
-printed as a beam.
-@separate
-@example 
+Spaces can be introduced into a lyric either by using quotes:
+@code{"He could"4 not4} or by using an underscore without quotes:
+@code{He_could4 not4}.  All unquoted underscores are converted to
+spaces.
 
-        c4 d8( )c b a( )b4 c8 b a g |
-@end example 
-The beginning and ending notes of a slur are marked with parentheses,
-@code{(} and @code{)} for start and end respectively.  The line above
-indicates two slurs.  These slur markers (parentheses) are entered
-between the slurred notes.
-@separate
-@example 
+These are the lyrics for the free software song:
 
-        a4 [b8 a] [g fis] 
-@end example 
-Automatic beaming can be overridden by inserting beam marks, @code{[}
-and @code{]}.  These beam markers (brackets) are put around the notes
-you want beamed.
-@separate
 @example 
-
-        g2.  |
+ \lyrics @{ 
+    Join us now __ and
+    share the soft -- ware; @}
 @end example
-@cindex augmentation dot
-@cindex dotted note
-A period adds a dot to the note.
-@separate
-@example 
 
-        @}
-@end example 
-The end of the sequential music to be repeated.  LilyPond will typeset a
-repeat bar.
-@separate
-@example 
+As you can see, extender lines are entered as @code{__}.  This will
+create an extender, a line that extends over the entire duration of
+the lyric.  This line will run all the way to the start of the next
+lyric, so you may want to shorten it by using a blank lyric (using
+@code{_}).
 
-        cis'4 b8 cis a4 |
-@end example 
-Accidentals are printed whenever necessary: the first C sharp of the bar
-will be printed with an accidental, the second one without.
-@separate
-@example 
 
-        a8-. b-. cis-. d-. e-. fis-.
+If you can use have hyphens at the end of a syllable, i.e.
+@example
+        soft- ware
 @end example
-@cindex articulation
-Staccato signs are entered as a dash and a period. Some other
-articulations may also be entered in this short form.
-@separate
-@example 
-
-        fis a, r8 cis8
+but then the hyphen will be attached to the to the end of the first
+syllable.
  
-@end example 
+If you want them centered between syllables you can use the special
+`@code{-}@code{-}' lyric as a separate word between syllables.  The
+hyphen will have variable length depending on the space between
+syllables. It will be centered between the syllables.  
  
-Rests are denoted by the special note name @code{r}.  
-@separate
-@example 
+Normally, the notes that you enter are transformed into note heads.
+Note heads alone make no sense, they need surrounding information: a key
+signature, a clef, staff lines, etc.  They need @emph{context}.  In
+LilyPond, these symbols are created by objects called `interpretation
+contexts'.  Interpretation contexts exist for generating notation
+(`notation context') and for generating sound (`performance
+context'). These objects only exist during a run of LilyPond.
 
-        d2.-\fermata
-@end example 
-All articulations have a verbose form, like @code{\fermata}.  The
-command @code{\fermata} is not part of the core of the language, but it
-is a shorthand for a more complicated description of a fermata symbol.
-@code{\fermata} names that description and is therefore called an
-identifier.
-@cindex identifier
-@cindex @code{\fermata}
-@separate
+When LilyPond interprets music, it will create a Staff context.
+We don't want that default here, because we want lyric.  The
+command
 @example
-        \bar "|."
-        @}
-@end example 
-Here the music ends.  LilyPond does not automatically typeset an end
-bar, we must explicitly request one, using @code{"|."}.
+  \context Lyrics
+@end example
+explicitly creates an interpretation context of 
+@code{Lyrics} type to interpret the song text that we entered.
 
-@separate
-@example 
+The melody of the song doesn't offer anything new:
+@example
+ \notes \relative c' @{
+    \time 7/4
+    d'2 c4 b16 ( a g a b a b ) c a2
+    b2 c4 b8 ( a16 g ) a4 g2 @}
+@end example
 
-        \paper @{
-                % standard settings are too big and wide for a book
-                indent = 1.0\cm
-                linewidth = 15.0\cm
-        @}
-@end example 
-The @code{\paper} block specifies how entered music should be converted
-to notation output.  Most of the details of the conversion (font sizes,
-dimensions, etc.) have been taken care of, but to fit the output in this
-document, it has to be narrower.  We do this by setting the line width
-to 14 centimeters (approximately 5.5 inches).
-@separate
-@example 
+Both can be combined with the @code{\addlyrics}:
+@example
+\addlyrics
+  \notes \relative c' @dots{}
+  \context Lyrics \lyrics @dots{} 
+@end example
 
-        @}
-@end example 
-The last brace ends the @code{\score} block.
+The lyrics are also music expressions,  similar to notes. What happens
+here, is that each syllable of the lyrics is put under the a note of
+the melody. 
+The complete file is listed here:
 
+@example
+\score  @{ \notes @{ \addlyrics
+  \notes \relative c' @{
+    \time 7/4
+    d'2 c4 b16 ( a g a b a b ) c a2
+    b2 c4 b8 ( a16 g ) a4 g2 @}
+  \context Lyrics \lyrics @{ 
+    Join us now __ and
+    share the soft -- ware; @}
+@}
+\paper @{ linewidth = -1. @}
+@}
+@end example
 
 
 
-@node Lyrics and chords
-@section Lyrics and chords
+@node A melody with chords 
+@section A melody with chords
 
-In this section we show how to typeset a song. This file is
-included as @file{flowing.ly}.
+In this section we show how to typeset a melody with chord
+accompaniment. This file is included as @file{flowing.ly}.
 
 @example 
-\header @{
-        title = "The river is flowing"
-        composer = "Traditional"
-@}
 \include "paper16.ly"
 melody = \notes \relative c' @{
         \partial 8
@@ -1323,11 +1096,6 @@ melody = \notes \relative c' @{
         \bar "|."
 @}
 
-text = \lyrics @{
-        The ri -- ver is flo- __ wing, flo -- wing and gro -- wing, the
-        ri -- ver is flo -- wing down to the sea.
-@}
-
 accompaniment =\chords @{
         r8
         c2:3- f:3-.7 d:min es4 c8:min r8
@@ -1337,14 +1105,10 @@ accompaniment =\chords @{
         \simultaneous @{
           %\accompaniment
           \context ChordNames \accompaniment
-
-          \addlyrics
             \context Staff = mel @{        
-              \property Staff.autoBeaming = ##f
-              \property Staff.automaticMelismata = ##t
               \melody 
             @}
-            \context Lyrics \text
+
         @}
         \midi  @{ \tempo 4=72 @}
         \paper @{ linewidth = 10.0\cm @}
@@ -1352,18 +1116,9 @@ accompaniment =\chords @{
 @end example 
 
 
-The result would look this.@footnote{The titling and font size shown
-may differ, since the titling in this document is not generated by
-@code{ly2dvi}.}
-
-@center @strong{The river is flowing}
-@center Traditional 
+The result would look this.
 
 @lilypond[center]
-\header {
-        title = "The river is flowing"
-        composer = "Traditional"
-}
 \include "paper16.ly"
 melody = \notes \relative c' {
         \partial 8
@@ -1374,11 +1129,6 @@ melody = \notes \relative c' {
         \bar "|."
 }
 
-text = \lyrics {
-        The ri -- ver is flo- __ wing, flo -- wing and gro -- wing, the
-        ri -- ver is flo -- wing down to the sea.
-}
-
 accompaniment =\chords {
         r8
         c2:3- f:3-.7 d:min es4 c8:min r8
@@ -1389,13 +1139,10 @@ accompaniment =\chords {
           %\accompaniment
           \context ChordNames \accompaniment
 
-          \addlyrics
             \context Staff = mel {
               \property Staff.autoBeaming = ##f
-              \property Staff.automaticMelismata = ##t
-              \melody 
+             \melody 
             }
-            \context Lyrics \text
         }
         \midi  { \tempo 4=72 }
         \paper { linewidth = 10.0\cm }
@@ -1403,27 +1150,7 @@ accompaniment =\chords {
 @end lilypond
 
 Again, we will dissect the file line by line.
-@separate
-@example 
-
-        \header @{
-@end example
-@cindex @code{\header}
-Information about the music you are about to typeset goes into a
-@code{\header} block.  The information in this block is not used by
-LilyPond, but it is passed into the output.  @file{ly2dvi} uses this
-information to print titles above the music.
-@separate
-@example 
 
-        title = "The river is flowing"
-        composer = "Traditional (?)"
-@end example
-@cindex assignments
-@cindex identifier assignment
-the @code{\header} block contains assignments.  In each assignment, a
-variable is set to a value. 
 @separate
 @example 
 
@@ -1486,25 +1213,7 @@ This ends the definition of @code{melody}.
 @cindex lyrics
 @cindex identifier assignment
 @cindex syllables, entering
-Another identifier assignment.  This one is for the lyrics. 
-Lyrics are formed by syllables that have duration, and not by
-notes. To make LilyPond parse words as syllables,  switch it  into
-lyrics mode with @code{\lyrics}.  Again, the brace after @code{\lyrics}
-is a shorthand for @code{\sequential @{}.
-@separate
-@example 
 
-  The ri -- ver is flo- __ wing,  flo -- wing and gro -- wing, the
-  ri- ver is flo- __ wing down to the sea.
-@}
-@end example
-@cindex extenders, lyric
-@cindex hyphens, lyric 
-The syllables  themselves are  separated by spaces.  You can get syllable
-extenders by entering @code{__}, and centered hyphens with
-@code{-}@code{-}.  We don't enter durations for  the syllables. They
-are  aligned with the melody later.
 @separate
 @example 
 
@@ -1614,21 +1323,7 @@ that mechanism in action.
 We don't want that default here, because we want chord names.  The
 command above explicitly creates an interpretation context of 
 @code{ChordNames} type to interpret the music @code{\accompaniment}. 
-@separate
-@example 
-
-        \addlyrics
-@end example
-@cindex @code{\addlyrics}
-@cindex lyrics and melody, combining
-@cindex combining lyrics and melody
 
-The lyrics should be aligned with the melody.  This is done by
-combining both with @code{\addlyrics}.  @code{\addlyrics} takes two
-pieces of music (usually a melody and lyrics, in that order) and
-aligns the syllables of the second piece under the notes of the
-first piece.
 @separate
 @example 
 
@@ -1656,38 +1351,7 @@ this @code{Staff}'s property to @code{##f}, which is the boolean value
 @var{false}, turns the automatic beaming mechanism off for the current
 staff.
 
-@ignore
-@cindex GUILE
-@cindex Scheme
-@cindex accessing Scheme
-@cindex evaluating Scheme
-@cindex LISP
-
-LilyPond internally uses GUILE, a Scheme-interpreter. Scheme is a
-language from the LISP family. You can learn more about Scheme at
-@uref{http://www.scheme.org}. It is used to represent data throughout
-the whole program. The hash-sign (@code{#}) accesses GUILE directly: the
-code following the hash-sign is evaluated as Scheme.  The boolean value
-@var{true} is @code{#t} in Scheme, so for LilyPond @var{true} looks like
-@code{##t}.
-
-If Scheme scares you, don't worry. You don't need to know Scheme to
-create beautiful sheet music.
-@end ignore
-
 
-@separate
-@example 
-
-        \property Staff.automaticMelismata = ##t
-@end example
-@cindex automaticMelismata
-@cindex melismata
-@cindex @code{\addlyrics} and slurs
-Similarly, we  don't want to print a  syllable when there is
-a slur. This sets up @code{\addlyrics} to not put lyrics under each
-separate note while there is a slur.
 @separate
 @example 
 
@@ -1699,16 +1363,7 @@ Finally, we put the melody on the current staff.  Note that the
 @code{\property} directives and @code{\melody} are grouped in sequential
 music,  so the property settings are done before the melody is
 processed.
-@separate
-@example 
 
-        \context Lyrics \text
-@end example 
-The second argument of @code{\addlyrics} is the text. The text also
-should not land on a Staff, but on a interpretation context for
-syllables, extenders, hyphens etc.  This context is called
-Lyrics.
 @separate
 @example 
 
@@ -1735,51 +1390,73 @@ also specifies an output method. You can specify the tempo using the
 We also want notation output.  The linewidth is short so the piece
 will be set in two lines.
 
-@node More movements 
-@section More movements
+@node More stanzas
+@section More stanzas
 
-[FIXME: merge here with, or move this to: Other ways to run LilyPond]
 
-You probably ran @file{ly2dvi} on the last example, and ended up with a
-viewable @file{.dvi} file.  However, between there are a few steps of
-which LilyPond is only one. To enhance your understanding of what's
-happening under the hood when you run @code{ly2dvi}, we explain what
-programs are run.
+@cindex phrasing
 
-@code{ly2dvi} is a program that calls a number of programs  in sequence.
-The first thing it does, is running LilyPond on the input file. After
-some calculations, a @file{.tex} is produced. The contents
-of this file are very  low-level instructions.
+If you have multiple stanzas printed underneath each other, the vertical
+groups of syllables should be aligned around punctuation. LilyPond can
+do this if you tell it which lyric lines belong to which melody.
+We show how you can do this by showing how you could print a frivolous
+fragment of a fictional Sesame Street duet. 
 
-For example, consider the following file (@file{miniatures.ly}) 
+@lilypond[singleline,verbatim]
+\score {
+\addlyrics
+  \notes \relative c'' \context Voice = duet { \time 3/4
+     g2 e4 a2 f4 g2.  }
+  \lyrics \context Lyrics <
+  \context LyricsVoice = "duet-1" {
+    \property LyricsVoice . stanza = "Bert"
+    Hi, my name is bert.    }
+  \context LyricsVoice = "duet-2" {
+    \property LyricsVoice . stanza = "Ernie" 
+    Ooooo, ch\'e -- ri, je t'aime. }
+  >
+}
+@end lilypond
 
+To this end, give the Voice context an identity, and set the
+LyricsVoice to a name starting with that identity followed by a dash.
+In the following example, the Voice identity is @code{duet},
 @example
-\version "1.5.60"
-\header @{
-  title = "Two miniatures"
-  tagline = "small is beautiful"
-@}
-
-#(set! point-and-click line-column-location)
+\context Voice = duet @{
+     \time 3/4
+     g2 e4 a2 f4 g2.  @}
+@end example
+and the
+identities of the LyricsVoices are @code{duet-1} and @code{duet-2}.
+@example
+  \context LyricsVoice = "duet-1" @{
+    Hi, my name is bert. @}
+  \context LyricsVoice = "duet-2" @{
+    Ooooo, ch\'e -- ri, je t'aime. @}
+@end example
 
-\paper @{ linewidth = -1.0 @}
+We add the names of the singers. This can be done by setting
+@code{LyricsVoice.Stanza} (for the first system) and
+@code{LyricsVoice.stz} for the following systems. Notice how you must
+surround dots with spaces in @code{\lyrics} mode.
 
-\score @{
-    \notes @{ c'4 d'4 @}
-    \header @{
-        opus = "Opus 1."
-        piece = "Up" @}
-@}
-\score @{
-    \notes @{ d'4 c'4 @}
-    \header @{
-        opus = "Opus 2."
-        piece = "Down" @}
-@}
+@example
+    \property LyricsVoice . stanza = "Bert"
+    @dots{}
+    \property LyricsVoice . stanza = "Ernie" 
 @end example
 
-The titling in this manual was not generated by ly2dvi, so we can't
-exactly show what it would look like, but the result should resemble this:
+
+@node More movements 
+@section More movements
+
+LilyPond only handles formatting sheet music. It doesn't concern
+itself with producing titles. This is the jobs of a simple wrapper
+program called ly2dvi. @code{ly2dvi} calls LilyPond to do the
+sheet music formatting. Then it produces titles, and ties together all
+inputs into a single @file{dvi} file. In this section, we show some of
+the options  for titling. We will  show how you can produce a file
+that looks like this:
 
 @center @strong{Two miniatures}
 @flushright
@@ -1807,83 +1484,93 @@ Opus 2.
   }
 @end lilypond
 
-This file is produced by ly2dvi in a few stages, with the help of text
-formatting tools. LilyPond produces two output files,
-@file{miniatures.tex} and @file{miniatures-1.tex}.  Both files contain
-only graphical music notation. @file{ly2dvi} looks at what output
-LilyPond produces, and adds page layout and titling to those files.  The
-result is a DVI file called @file{miniatures.dvi}.
+For example, consider the following file (@file{miniatures.ly}) 
+
+@example
+\version "1.5.60"
+\header @{
+  title = "Two miniatures"
+  composer = "F. Bar Baz" 
+  tagline = "small is beautiful" @}
+
+\paper @{ linewidth = -1.0 @}
 
-Next, now we'll look at the example line by line to explain new things.
+%@{
 
-@separate
-@example 
-\version "1.4.0"
-@end example 
-Lilypond and its language are still under development, and occasionally,
-details of the syntax are changed. This fragment indicates for which
-version the input file was written. When you compile this file, the
-version number will be checked, and you will get a warning when the file
-is too old.
+Mental note: discuss Schenkerian analysis of these key pieces.
 
-This version number is also used by the @code{convert-ly} program (See
-@ref{Upgrading from older LilyPond versions}), which is used to update
-the file to the latest lily version.
+%@}
 
-@separate
-@example
-  \header @{
-    title = "Two miniatures"  @}
-@end example
-This sets the titling information for the entire file.
-@separate
-@example
-    tagline = "small is beautiful" 
+
+\score @{
+    \notes @{ c'4 d'4 @}
+    \header @{
+        opus = "Opus 1."
+        piece = "Up" @}
+@}
+\score @{
+    \notes @{ d'4 c'4 @}
+    \header @{
+        opus = "Opus 2."
+        piece = "Down" @}
+@}
 @end example
-A signature line is printed at the bottom of the last page.
- This signature is produced from the @code{tagline} field of
-@code{\header}.  Many people find the default "Lily was here,
-@var{version number}" too droll. If that is the case,  assign
-something else to @code{tagline}, as shown above.
-@separate
-@example
-        #(set! point-and-click line-column-location)
+
+The information for the global titling is in a so-called header block.
+The information in this block is not used by
+LilyPond, but it is passed into the output.  @file{ly2dvi} uses this
+information to print titles above the music.
+@cindex assignments
+@cindex identifier assignment
+the @code{\header} block contains assignments.  In each assignment, a
+variable is set to a value. The header block for this file looks like
+this
+@cindex @code{\header}
+@example 
+  \header @{
+    title = "Two miniatures" 
+    composer = "F. Bar Baz"
+    tagline = "small is beautiful"
+  @}
 @end example
 
-This piece of Scheme code sets the Scheme variable
-@code{point-and-click} to the value @var{line-column-location} (which
-itself is a Scheme procedure).
+When you process a file with ly2dvi, a signature line is printed at
+the bottom of the last page.  This signature is produced from the
+@code{tagline} field of @code{\header}.  The default "Lily was here,
+@var{version number}" is convenient for us programmers. Archived
+the layout of different versions can be compared using archived
+print-outs (that include a version number).
 
-Editing input files can be complicated if you're working with
-large files: if you're digitizing existing music, you have to
-synchronize the .ly file, the sheet music on your lap and the sheet
-music on the screen.  The point-and-click mechanism makes it easy to
-find the origin of an error in the LY file: when you view the file with
-Xdvi and click on a note, your editor will jump to the spot where that
-note was entered.  For more information, see @ref{Point and click}.
+Many people find the default tagline too droll.  If that is the case,
+assign something else to @code{tagline}, as shown above.
 
 @separate
 @example
   \paper @{ 
+    linewidth = -1.0 @}
 @end example
 
-The @code{\score} blocks that follow in the file don't have
-@code{\paper} sections, so the settings of this block are substituted: A
-paper block at top level, i.e. not in a @code{\score} block sets the
-default page layout.
+A paper block at top level, i.e. not in a @code{\score} block sets the
+default page layout.  The following @code{\score} blocks don't have
+@code{\paper} sections, so the settings of this block are substituted:
+
+The variable @code{linewidth} normally sets the length of the systems
+on the page. However, a negative value has a special meaning. If
+@code{linewidth} is less than 0, no line breaks are inserted into the
+score, and the spacing is set to natural length: a short phrase takes
+up little space, a longer phrase more space.
 
-@separate
 @example
-  linewidth = -1.0 @}
-@end example
+%@{
 
+Mental note: discuss Schenkerian analysis of these key pieces.
 
+%@}
+@end example
 
-The variable @code{linewidth} normally sets the length of the systems on
-the page. However, a negative value has a special meaning. If
-@code{linewidth} is less than 0, no line breaks are inserted into the
-score, and the spacing is set to natural length: a short phrase takes up
-little space, a longer phrase more space.
+Mental notes to yourself can be put into comments. There are two types
+of comments. Line comments are introduced by @code{%}, and block
+comments are delimited by @code{%@{} and @code{%@}}.
 
 @separate
 @example
@@ -1927,6 +1614,44 @@ will be at the left.
 
 
 
+@example
+\version "1.5.60"
+\header @{
+  title = "Two miniatures"
+  composer = "F. Bar Baz" 
+  tagline = "small is beautiful" @}
+
+\paper @{ linewidth = -1.0 @}
+
+\score @{
+    \notes @{ c'4 d'4 @}
+    \header @{
+        opus = "Opus 1."
+        piece = "Up" @}
+@}
+\score @{
+    \notes @{ d'4 c'4 @}
+    \header @{
+        opus = "Opus 2."
+        piece = "Down" @}
+@}
+@end example
+
+
+@separate
+@example 
+\version "1.6.0"
+@end example 
+Lilypond and its language are still under development, and
+occasionally, details of the syntax are changed. This fragment
+indicates for which version the input file was written. When you
+compile this file, the version number will be checked, and you will
+get a warning when the file is too old.  This version number is also
+used by the @code{convert-ly} program (See @ref{Older 
+LilyPond versions}), which is used to update the file to the latest
+lily version.
+
+
 @node A piano excerpt
 @section A piano excerpt
 
@@ -2236,10 +1961,11 @@ edition by Schott/Universal Edition:
 The basic process that we follow is that we override defaults in the
 printing system. We do this by setting variables in so-called grobs.
 Printed symbols are internally represented by Graphical Objects
-(Grobs).  Each grob is described by a bunch of settings. These setting
-determine the fonts, offsets, sub-routines to be called on the grob,
-etc.  The initial values of these settings are set in the Scheme file
-@file{scm/grob-description.scm}.
+(Grobs).  Each grob is described by a bunch of settings.  Every
+setting is a variable: it has a name, and you can assign a value to
+the variable. These setting determine the fonts, offsets, sub-routines
+to be called on the grob, etc.  The initial values of these settings
+are set in the Scheme file @file{scm/grob-description.scm}.
 
 @cindex slur attachments
 
@@ -2286,8 +2012,8 @@ use. Before you proceed, please make sure that you are using the
 documentation that corresponds to the LilyPond version that you use.
 
 Suppose that you wanted to tune the behavior of the slur. The first
-step is to get some general info on slurs in lilypond. Turn to the
-index, and look up slur. The section on slurs says
+step is to get some general information on slurs in lilypond. Turn to
+the index, and look up ``slur''. The section on slurs says
 @quotation
 The grob for this object is @internalsref{Slur}, generally in
 @internalsref{Voice} context.
@@ -2301,7 +2027,9 @@ and select ``slur'' (the list is alphabetical.)
 
 Now you get a list of all the properties that the slur object
 supports, along with their default values. Among the properties we
-find the @code{attachment} property, leading to 
+find the @code{attachment} property with its default setting.
+The property documentation explains that the following setting will
+produce the desired effect:
 @example 
  \property Voice.Slur \set #'attachment = #'(stem . stem)
 @end example
@@ -2359,7 +2087,7 @@ downwards.
 @end example      
 The @code{extra-offset} is a low-level feature: it moves around
 objects in the printout; the formatting engine is completely oblivious
-to these offsets.
+to these offsets. The unit of these offsets are staff-spaces. 
 
 @cindex reverting grob properties
 @cindex undoing grob properties
@@ -2380,11 +2108,10 @@ There is three different types of variables in LilyPond, something
 which is confusing at first (and for some, it stays like that).
 Variables such as @code{extra-offset} and @code{attachment} are called
 grob properties. They are something different from the translator
-properties, like @code{autoBeaming} and
-@code{automaticMelismata}. Finally, music expressions are internally
-also stored using properties, so-called music properties. You will
-encounter the latter type if you run Scheme functions on music using
-@code{\apply}.
+properties, like @code{autoBeaming}. Finally, music expressions are
+internally also stored using properties, so-called music
+properties. You will encounter the latter type if you run Scheme
+functions on music using @code{\apply}.
 
 The second fingering instruction should be moved up a little, to avoid
 a collision with the slur. This could be achieved with
@@ -2482,9 +2209,10 @@ own name.  These pieces of music are then combined in different
 @code{\score} blocks to produce different combinations of the score.
 
 This orchestral score example consists of three input files.  In the
-first file, @file{os-music.ly}, we define the music for all instruments.
-This file will be used both for producing the score and the separate
-parts.
+first file, @file{os-music.ly}, we define the music for all
+instruments.  This file will be used both for producing the score and
+the separate parts. Other files reference this file by doing
+@code{\include "os-music.ly"}.
 
 If you were to run LilyPond on this file, no printable output would be
 produced.
@@ -2652,9 +2380,19 @@ First, we need to include the music definitions we made in
 @example
 #(set! point-and-click line-column-location)
 @end example
-In a large orchestral score like this you're bound to make some small
-mistakes, so we enable point and click (See @ref{Point and click})
-editing.
+
+This piece of Scheme code sets the Scheme variable
+@code{point-and-click} to the value @var{line-column-location} (which
+itself is a Scheme procedure).
+
+Editing input files can be complicated if you're working with large
+files: if you're digitizing existing music, you have to synchronize
+the .ly file, the sheet music on your lap and the sheet music on the
+screen.  The point-and-click mechanism makes it easy to find the
+origin of an error in the LY file: when you view the file with Xdvi
+and click on a note, your editor will jump to the spot where that note
+was entered.  For more information, see @ref{Point and click}.
+
 
 @separate
 @example
index f9bdb98024a619c1dc22362cd7699fd9f72690c8..54919a73b0a17d65efffaed64b35283ceabb4c56 100644 (file)
@@ -1,3 +1,4 @@
+
 \version "1.5.43.rz1"
 
 \header {
index 5ed5ef9e43a9230bfe9f72ef52372c3ee399ab85..edb22455c56953d8704ba4276c02fa021c54a54f 100644 (file)
@@ -87,6 +87,15 @@ public:
 };
 
 
+static void set_property_on_children (Translator_group * trans, const char * sym, SCM val)
+{
+  trans->set_property (sym, val);
+  for (SCM p = trans -> trans_group_list_; gh_pair_p (p); p = ly_cdr(p)) {
+    Translator_group *trg =  dynamic_cast<Translator_group*> (unsmob_translator (ly_car (p)));
+    set_property_on_children(trg,sym,ly_deep_copy(val));
+  }
+}
+
 Accidental_engraver::Accidental_engraver ()
 {
   accidental_placement_ = 0;
@@ -104,7 +113,7 @@ Accidental_engraver::initialize ()
       trans_ -> set_property ("localKeySignature",  ly_deep_copy (last_keysig_));
       trans_ = trans_->daddy_trans_l_;
     }
-  daddy_trans_l_->set_children_property ("localKeySignature", last_keysig_);
+  set_property_on_children (daddy_trans_l_,"localKeySignature", last_keysig_);
 }
 
 /*
@@ -455,7 +464,7 @@ Accidental_engraver::process_music ()
          trans_ -> set_property ("localKeySignature",  ly_deep_copy (sig));
          trans_ = trans_->daddy_trans_l_;
        }
-      daddy_trans_l_->set_children_property ("localKeySignature", sig);
+      set_property_on_children(daddy_trans_l_,"localKeySignature", sig);
 
       last_keysig_ = sig;
     }
index dded92c4e1860c93b0528b164447d118ed564ce8..6216b9f47533d77fcb876305e366d9c60618390e 100644 (file)
@@ -63,6 +63,7 @@ private:
   Moment beam_start_location_;
 
   bool subdivide_beams_;
+  Moment beat_length_;
   
   // We act as if beam were created, and start a grouping anyway.
   Beaming_info_list*grouping_p_;  
@@ -249,7 +250,8 @@ Auto_beam_engraver::begin_beam ()
   grouping_p_ = new Beaming_info_list;
   beam_start_moment_ = now_mom ();
   beam_start_location_ = *unsmob_moment (get_property ("measurePosition"));
-  subdivide_beams_ = gh_scm2bool(get_property("subdivideBeams")); 
+  subdivide_beams_ = gh_scm2bool(get_property("subdivideBeams"));
+  beat_length_ = *unsmob_moment (get_property ("beatLength"));
 }
 
 
@@ -292,8 +294,7 @@ Auto_beam_engraver::typeset_beam ()
 {
   if (finished_beam_p_)
     {
-      finished_grouping_p_->beamify(*unsmob_moment (get_property ("beatLength")),
-                                   subdivide_beams_);
+      finished_grouping_p_->beamify(beat_length_, subdivide_beams_);
       Beam::set_beaming (finished_beam_p_, finished_grouping_p_);
       typeset_grob (finished_beam_p_);
       finished_beam_p_ = 0;
@@ -481,5 +482,5 @@ stemRightBeamCount.
 ",
 /* creats*/       "Beam",
 /* acks  */       "stem-interface rest-interface beam-interface bar-line-interface",
-/* reads */       "autoBeaming autoBeamSettings subdivideBeams",
+/* reads */       "autoBeaming autoBeamSettings beatLength subdivideBeams",
 /* write */       "");
index 0c02fb9349ccd2b2707552945d2470aa0a7095fc..99c15143bf786564fb0d80d1847f828b51e2a40f 100644 (file)
@@ -38,6 +38,7 @@ protected:
   Moment beam_start_mom_;
 
   bool subdivide_beams_;
+  Moment beat_length_;
 
   void typeset_beam ();
   void set_melisma (bool);
@@ -190,9 +191,7 @@ Beam_engraver::typeset_beam ()
 {
   if (finished_beam_p_)
     {
-      finished_beam_info_p_->beamify(*unsmob_moment (get_property ("beatLength")),
-                                    subdivide_beams_);
-
+      finished_beam_info_p_->beamify(beat_length_, subdivide_beams_);
       Beam::set_beaming (finished_beam_p_, finished_beam_info_p_);
       typeset_grob (finished_beam_p_);
       delete finished_beam_info_p_;
@@ -215,7 +214,8 @@ Beam_engraver::start_translation_timestep ()
        {
          set_melisma (true);
        }
-      subdivide_beams_ = to_boolean(get_property("subdivideBeams")); 
+      subdivide_beams_ = to_boolean(get_property("subdivideBeams"));
+      beat_length_ = *unsmob_moment (get_property ("beatLength"));
     }
 }
 
@@ -306,7 +306,7 @@ ENTER_DESCRIPTION(Beam_engraver,
 printed with flags instead of beams.",
 /* creats*/       "Beam",
 /* acks  */       "stem-interface rest-interface",
-/* reads */       "beamMelismaBusy subdivideBeams",
+/* reads */       "beamMelismaBusy beatLength subdivideBeams",
 /* write */       "");
 
 
@@ -348,6 +348,6 @@ are at grace points in time.
 ",
 /* creats*/       "Beam",
 /* acks  */       "stem-interface rest-interface",
-/* reads */       "beamMelismaBusy subdivideBeams",
+/* reads */       "beamMelismaBusy beatLength subdivideBeams",
 /* write */       "");
 
index 1b7069e74046a77f2e246460fb34d837c9d1e195..74a3490d3cf4840ac0e780f13da219094d2d5ac1 100644 (file)
@@ -20,7 +20,6 @@
 // egcs
 typedef void (Translator::*Method_pointer) (void);
 #define set_property(x,y) internal_set_property(ly_symbol2scm(x),y)
-#define set_children_property(x,y) internal_set_children_property(ly_symbol2scm(x),y)
 
 class Scheme_hash_table;
 
@@ -44,7 +43,6 @@ public:
 
   void unset_property (SCM var_sym);
   void internal_set_property (SCM var_sym, SCM value);  
-  void internal_set_children_property (SCM var_sym, SCM value);  
   Translator_group *where_defined (SCM name_sym) const;
 
   String id_str_;
index 6bfd9413e85c37d9a124cf1a2222e258ba89607f..f467bdda24f347aa8f7e496bbce2bef5156ce8a7 100644 (file)
@@ -118,7 +118,12 @@ static Long_option_init options_static[] = {
   {0, "no-paper", 'm',  _i ("produce MIDI output only")},
   {_i ("FILE"), "output", 'o',  _i ("write output to FILE")},
   {_i ("DIR"), "dep-prefix", 'P',  _i ("prepend DIR to dependencies")},
+#if 0
+  /*
+    should audit again.
+   */
   {0, "safe", 's',  _i ("inhibit file output naming and exporting")},
+#endif
   {0, "version", 'v',  _i ("print version number")},
   {0, "verbose", 'V', _i ("verbose")},
   {0, "warranty", 'w',  _i ("show warranty and copyright")},
diff --git a/lily/new-accidental-engraver.cc b/lily/new-accidental-engraver.cc
new file mode 100644 (file)
index 0000000..262c306
--- /dev/null
@@ -0,0 +1,554 @@
+/*
+  accidental-engraver.cc -- implement accidental_engraver
+
+  (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  Modified 2001--2002 by Rune Zedeler <rz@daimi.au.dk>
+*/
+
+#include "musical-request.hh"
+#include "command-request.hh"
+#include "item.hh"
+#include "tie.hh"
+#include "rhythmic-head.hh"
+#include "engraver-group-engraver.hh"
+#include "accidental-placement.hh"
+#include "side-position-interface.hh"
+#include "engraver.hh"
+#include "arpeggio.hh"
+#include "warn.hh"
+
+#include "translator-group.hh"
+
+/**
+
+
+FIXME: should not compute vertical positioning of accidentals, but
+get them from the noteheads
+
+The algorithm for accidentals should be documented, and made
+tweakable.
+
+*/
+
+struct New_accidental_entry {
+  int pass_done_;
+  int number_accidentals_;
+  int number_cautionaries_;
+  bool different_;
+  Note_req * melodic_;
+  Grob * accidental_;
+  Translator_group *origin_;
+  Grob*  head_;
+  New_accidental_entry();
+};
+
+New_accidental_entry::New_accidental_entry()
+{
+  pass_done_ = 0;
+  number_accidentals_ = 0;
+  number_cautionaries_ = 0;
+  different_ = false;
+  melodic_ = 0;
+  accidental_ = 0;
+  origin_ = 0;
+  head_ = 0;
+}
+
+struct New_accidental_engraver : Engraver {
+protected:
+  TRANSLATOR_DECLARATIONS (New_accidental_engraver);
+  virtual void process_music ();
+  virtual void acknowledge_grob (Grob_info);
+  virtual void stop_translation_timestep ();
+  virtual void initialize ();
+  virtual void process_acknowledged_grobs ();
+  virtual void finalize ();
+  virtual void process_grobs_first_pass ();
+  virtual void process_grobs_second_pass ();
+
+  public:
+
+  /*
+    TODO -> property.
+    
+    This is not a property, and it is not protected.  This poses a
+    very small risk of the value being GC'd from under us.
+  */
+  SCM last_keysig_;
+
+  /*
+    Urgh. Since the accidentals depend on lots of variables, we have to
+    store all information before we can really create the accidentals.
+  */
+  Link_array<Grob> arpeggios_;
+
+  Grob * accidental_placement_;
+  
+
+  /*
+    The next 
+   */
+  Array<New_accidental_entry> accidental_arr_;
+  
+  Link_array<Grob> tie_arr_;
+
+
+};
+
+
+New_accidental_engraver::New_accidental_engraver ()
+{
+  accidental_placement_ = 0;
+  last_keysig_ = SCM_EOL;
+}
+
+/* inserts the source alist into the destination alist, erasing old entries.
+   result is: dest = merged
+*/ 
+static SCM merge_alists_front_x (SCM src, SCM dest) {
+  if(gh_pair_p(src)) {
+    dest = merge_alists_front_x(ly_cdr(src),dest);
+    dest = ly_assoc_front_x(dest, ly_caar(src), ly_cdar(src));
+  }
+  return dest;
+}
+
+static void merge_property_on_children (Translator_group * trans,
+                                      const char * from_sym, const char * to_sym)
+{
+  SCM from = trans->get_property(from_sym);
+  SCM to = trans->get_property(to_sym);
+  to = merge_alists_front_x(from, to);
+  trans->set_property (to_sym,  to);
+  trans->set_property (from_sym, SCM_EOL);
+  for (SCM p = trans -> trans_group_list_; gh_pair_p (p); p = ly_cdr(p)) {
+    Translator_group *trg =  dynamic_cast<Translator_group*> (unsmob_translator (ly_car (p)));
+    merge_property_on_children(trg, from_sym, to_sym);
+  }
+}
+
+static void merge_property_on_family (Translator_group * trans,
+                                     const char * from_sym, const char * to_sym)
+{
+  merge_property_on_children (trans, from_sym, to_sym);
+  trans = trans->daddy_trans_l_;
+  while (trans)
+    {
+      SCM from = trans->get_property(from_sym);
+      SCM to = trans->get_property(to_sym);
+      to = merge_alists_front_x(from, to);
+      trans->set_property (to_sym,  to);
+      trans->set_property (from_sym, SCM_EOL);
+      trans = trans->daddy_trans_l_;
+    }
+}
+
+static void set_property_on_children (Translator_group * trans, const char * sym, SCM val)
+{
+  trans->set_property (sym, val);
+  for (SCM p = trans -> trans_group_list_; gh_pair_p (p); p = ly_cdr(p)) {
+    Translator_group *trg =  dynamic_cast<Translator_group*> (unsmob_translator (ly_car (p)));
+    set_property_on_children(trg,sym,ly_deep_copy(val));
+  }
+}
+
+static void set_property_on_family(Translator_group * trans, const char * sym, SCM val)
+{
+  set_property_on_children (trans, sym, val);
+  trans = trans->daddy_trans_l_;
+  while (trans)
+    {
+      trans -> set_property (sym,  ly_deep_copy (val));
+      trans = trans->daddy_trans_l_;
+    }
+}
+
+void
+New_accidental_engraver::initialize ()
+{
+  // to ensure that process_music will initialize last_keysig_
+  last_keysig_ = SCM_BOOL_F;
+}
+
+/*
+calculates the number of accidentals on basis of the current local key sig
+  (passed as argument)
+  Returns number of accidentals (0, 1 or 2).
+    Negative (-1 or -2) if accidental has changed.
+
+*/
+static int
+number_accidentals (SCM sig, Note_req * note_l, Pitch *pitch, SCM curbarnum, SCM lazyness, 
+                   bool ignore_octave_b)
+{
+  int n = pitch->notename_i_;
+  int o = pitch->octave_i_;
+  int a = pitch->alteration_i_;
+  int curbarnum_i = gh_scm2int (curbarnum);
+  int accbarnum_i = 0;
+
+  SCM prev;
+  if (ignore_octave_b)
+    prev = ly_assoc_cdr (gh_int2scm (n), sig);
+  else
+    prev = gh_assoc (gh_cons (gh_int2scm (o), gh_int2scm (n)), sig);
+
+  /* should really be true unless prev == SCM_BOOL_F */
+  if (gh_pair_p (prev) && gh_pair_p (ly_cdr (prev)))
+    {
+      accbarnum_i = gh_scm2int (ly_cddr (prev));
+      prev = gh_cons (ly_car (prev), ly_cadr (prev));
+    }
+  
+  /* If an accidental was not found or the accidental was too old */
+  if (prev == SCM_BOOL_F ||
+      (gh_number_p (lazyness) && curbarnum_i > accbarnum_i + gh_scm2int (lazyness)))
+    prev = gh_assoc (gh_int2scm (n), sig);
+
+
+  SCM prev_acc = (prev == SCM_BOOL_F) ? gh_int2scm (0) : ly_cdr (prev);
+
+  int p = gh_number_p (prev_acc) ? gh_scm2int (prev_acc) : 0;
+
+  int num;
+  if (a == p
+      && !to_boolean (note_l->get_mus_property ("force-accidental"))
+      && gh_number_p (prev_acc))
+    num = 0;
+  else if ( (abs (a)<abs (p) || p*a<0) && a != 0 )
+    num = 2;
+  else
+    num = 1;
+  
+  return a == p ? num : -num;
+}
+
+static int
+number_accidentals (Note_req * note_l, Pitch *pitch, Translator_group * origin_l, 
+                   SCM accidentals, SCM curbarnum)
+{
+  int number = 0;
+
+  bool diff = false;
+  if (gh_pair_p (accidentals) && !gh_symbol_p (ly_car (accidentals)))
+    warning (_f ("Accidental typesetting list must begin with context-name: %s", 
+                ly_scm2string (ly_car (accidentals)).ch_C ()));
+  
+  while (gh_pair_p (accidentals) && origin_l)
+    {
+      // If pair then it is a new accidentals typesetting rule to be checked
+      if (gh_pair_p (ly_car (accidentals)))
+       {
+         SCM type = gh_caar (accidentals);
+         SCM lazyness = gh_cdar (accidentals);
+         SCM localsig = origin_l->get_property ("localKeySignature");
+         
+         bool same_octave_b = 
+           gh_eq_p (ly_symbol2scm ("same-octave"), type);
+         bool any_octave_b = 
+           gh_eq_p (ly_symbol2scm ("any-octave"), type);
+
+         if (same_octave_b || any_octave_b)
+           {
+             int n = number_accidentals
+               (localsig, note_l, pitch, curbarnum, lazyness, any_octave_b);
+             diff = diff || (n < 0);
+             number = max (number, abs (n));     
+           }
+         else
+           warning (_f ("unknown accidental typesetting: %s. Ignored", 
+                        ly_symbol2string (type).ch_C ()));
+       }
+      
+
+      /*
+       if symbol then it is a context name. Scan parent contexts to find it.
+      */
+      else if (gh_symbol_p (ly_car (accidentals)))
+       {
+         String context = ly_symbol2string (ly_car (accidentals));
+         
+         while (origin_l && !origin_l->is_alias_b (context))
+           origin_l = origin_l->daddy_trans_l_;
+      
+         if (!origin_l)
+           warning (_f ("Symbol is not a parent context: %s. Ignored", 
+                        context.ch_C ()));
+       }
+      else warning (_f ("Accidental typesetting must be pair or context-name: %s", 
+                       ly_scm2string (ly_car (accidentals)).ch_C ()));
+      
+      accidentals = ly_cdr (accidentals);
+    }
+  return diff ? -number : number;
+}
+
+
+/* 
+  Perhaps one should join the two functions into one function taking an
+  argument (pass).
+  OTOH even though code would be smaller, spaghetti-level would increase.
+*/
+void
+New_accidental_engraver::process_grobs_first_pass ()
+{
+  SCM accidentals =  get_property ("autoAccidentals");
+  SCM cautionaries =  get_property ("autoCautionaries");
+  SCM barnum = get_property ("currentBarNumber");
+
+  for (int i = 0; i  < accidental_arr_.size (); i++) 
+    {
+      if (accidental_arr_[i].pass_done_ >= 1)
+       continue;
+      accidental_arr_[i].pass_done_  = 1;
+
+      Grob * support_l = accidental_arr_[i].head_;
+      Note_req * note_l = accidental_arr_[i].melodic_;
+      Translator_group * origin_l = accidental_arr_[i].origin_;
+      Pitch * pitch = unsmob_pitch (note_l->get_mus_property ("pitch"));
+
+      int num;
+      num = number_accidentals (note_l, pitch, origin_l, accidentals, barnum);
+      accidental_arr_[i].number_accidentals_ = abs(num);
+      accidental_arr_[i].different_ = num<0;
+
+      num = number_accidentals (note_l, pitch, origin_l, cautionaries, barnum);
+      accidental_arr_[i].number_cautionaries_ = abs(num);
+      accidental_arr_[i].different_ = accidental_arr_[i].different_ || num<0;
+
+      bool tie_changes = false;
+      for (int j = 0; j < tie_arr_.size (); j++)
+       if (support_l == Tie::head (tie_arr_[j], RIGHT))
+         tie_changes = accidental_arr_[i].different_;
+      int n = pitch->notename_i_;
+      int o = pitch->octave_i_;
+      int a = pitch->alteration_i_;
+      SCM o_s = gh_int2scm (o);
+      SCM n_s = gh_int2scm (n);
+      SCM on_s = gh_cons (o_s,n_s);
+      
+      while (origin_l)
+       {
+         SCM sigch = origin_l->get_property ("localKeySignatureChanges");
+         SCM alt;
+         if (tie_changes)
+           /*
+             Remember an alteration that is different both from
+             that of the tied note and of the key signature.
+           */
+           alt = SCM_BOOL_T;
+         else
+           alt = gh_int2scm (a);
+         bool other_alt_same_oct = false;
+         bool other_alt_any_oct = false;
+         for (SCM j = sigch; gh_pair_p(j); j = ly_cdr(j)) {
+           SCM entry = ly_car(j);
+           /* if same notename has a different alt already recorded: */
+           if(gh_equal_p(ly_cdar(entry),n_s) && !gh_equal_p(ly_cadr(entry),alt))
+             {
+               /* if it is also in same octave */
+               if(gh_equal_p(ly_caar(entry),o_s))
+                 other_alt_same_oct = true;
+               else
+                 other_alt_any_oct = true;
+             }
+         }
+         if(other_alt_same_oct)
+           alt = SCM_BOOL_T;
+         sigch = ly_assoc_front_x (sigch, on_s, gh_cons(alt,barnum)); 
+         if(other_alt_any_oct && !other_alt_same_oct) {
+           sigch = ly_assoc_front_x (sigch, on_s, gh_cons(SCM_BOOL_T,barnum));
+         }
+         origin_l->set_property ("localKeySignatureChanges",  sigch);
+         origin_l = origin_l->daddy_trans_l_;  
+       }
+    }
+}
+
+void
+New_accidental_engraver::process_grobs_second_pass ()
+{
+  SCM accidentals =  get_property ("autoAccidentals");
+  SCM cautionaries =  get_property ("autoCautionaries");
+  SCM barnum = get_property ("currentBarNumber");
+  
+  bool extra_natural_b = get_property ("extraNatural") == SCM_BOOL_T;
+  for (int i = 0; i  < accidental_arr_.size (); i++) 
+    {
+      if (accidental_arr_[i].pass_done_ >= 2)
+       continue;
+      accidental_arr_[i].pass_done_  = 2;
+      Grob * support_l = accidental_arr_[i].head_;
+      Note_req * note_l = accidental_arr_[i].melodic_;
+      Translator_group * origin_l = accidental_arr_[i].origin_;
+      
+      Pitch * pitch = unsmob_pitch (note_l->get_mus_property ("pitch"));
+
+      int num;
+      num = number_accidentals (note_l, pitch, origin_l, accidentals, barnum);
+      accidental_arr_[i].number_accidentals_ =
+       max (accidental_arr_[i].number_accidentals_, abs(num));
+      accidental_arr_[i].different_ = accidental_arr_[i].different_ || num<0;
+
+      num = number_accidentals (note_l, pitch, origin_l, cautionaries, barnum);
+      accidental_arr_[i].number_cautionaries_ =
+       max (accidental_arr_[i].number_cautionaries_, abs(num));
+      accidental_arr_[i].different_ = accidental_arr_[i].different_ || num<0;
+
+
+      bool cautionary = to_boolean (note_l->get_mus_property ("cautionary"));
+      
+      if (accidental_arr_[i].number_cautionaries_ >accidental_arr_[i].number_accidentals_ )
+       {
+         num = accidental_arr_[i].number_cautionaries_;
+         cautionary = true;
+       }
+      else
+         num = accidental_arr_[i].number_accidentals_;
+
+      bool tie_changes = false;
+      Grob *tie_break_reminder = 0;
+      for (int j = 0; j < tie_arr_.size (); j++)
+       if (support_l == Tie::head (tie_arr_[j], RIGHT))
+         {
+           tie_changes = accidental_arr_[i].different_;
+           tie_break_reminder = tie_arr_[j];
+         }
+      
+      if (num)
+       {
+         Grob * a = new Item (get_property ("Accidental"));
+         a->set_parent (support_l, Y_AXIS);
+         
+         if (!accidental_placement_)
+           {
+             accidental_placement_ = new Item (get_property ("AccidentalPlacement"));
+             announce_grob (accidental_placement_, a->self_scm());
+           }
+         
+         Accidental_placement::add_accidental (accidental_placement_, a);
+         announce_grob (a, SCM_EOL);
+         
+         
+         SCM accs = gh_cons (gh_int2scm (pitch->alteration_i_), SCM_EOL);
+         if (num == 2 && extra_natural_b)
+           accs = gh_cons (gh_int2scm (0), accs);
+         
+         if (cautionary)
+           {
+             a->set_grob_property ("cautionary", SCM_BOOL_T);
+           }
+         
+         if (tie_break_reminder)
+           {
+             a->set_grob_property ("tie", tie_break_reminder->self_scm());
+           }
+         
+         
+         support_l->set_grob_property ("accidental-grob", a->self_scm ());
+         
+         a->set_grob_property ("accidentals", accs);
+         accidental_arr_[i].accidental_ = a;
+         /*
+           We add the accidentals to the support of the arpeggio, so it is
+           put left of the accidentals. 
+         */
+         for (int i = 0;  i < arpeggios_.size ();  i++)
+           Side_position_interface::add_support (arpeggios_[i], a);
+       }       
+    }
+}
+
+void
+New_accidental_engraver::process_acknowledged_grobs ()
+{
+  if (accidental_arr_.size () && accidental_arr_.top().pass_done_ < 1)
+    process_grobs_first_pass ();
+}
+
+void
+New_accidental_engraver::finalize ()
+{
+
+}
+
+void
+New_accidental_engraver::stop_translation_timestep ()
+{
+  merge_property_on_family(daddy_trans_l_, "localKeySignatureChanges", "localKeySignature");
+  if (accidental_arr_.size () && accidental_arr_.top().pass_done_ < 2)
+    process_grobs_second_pass ();
+
+  for (int i = 0; i < accidental_arr_.size(); i++)
+    {
+      Grob *a = accidental_arr_[i].accidental_;
+      if (a)
+       {
+         typeset_grob (a);
+       }
+    }
+
+  if (accidental_placement_)
+    typeset_grob(accidental_placement_);
+  accidental_placement_ = 00;
+
+  set_property_on_family(daddy_trans_l_, "localKeySignatureChanges", SCM_EOL);  
+  accidental_arr_.clear();
+  arpeggios_.clear ();
+  tie_arr_.clear ();
+}
+
+void
+New_accidental_engraver::acknowledge_grob (Grob_info info)
+{
+  Note_req * note_l =  dynamic_cast <Note_req *> (info.music_cause ());
+
+  if (note_l && Rhythmic_head::has_interface (info.grob_l_))
+    {
+      New_accidental_entry entry ;
+      entry.head_ = info.grob_l_;
+      entry.origin_ = info.origin_trans_l_->daddy_trans_l_;
+      entry.melodic_ = note_l;
+
+      accidental_arr_.push (entry);
+    }
+  else if (Tie::has_interface (info.grob_l_))
+    {
+      tie_arr_.push (info.grob_l_);
+    }
+  else if (Arpeggio::has_interface (info.grob_l_))
+    {
+      arpeggios_.push (info.grob_l_); 
+    }
+  
+}
+
+void
+New_accidental_engraver::process_music ()
+{
+  SCM sig = get_property ("keySignature");
+
+  /* Detect key sig changes.
+     Update all parents and children
+  */
+  if (last_keysig_ != sig)
+    {
+      set_property_on_family(daddy_trans_l_, "localKeySignature", sig);
+      set_property_on_family(daddy_trans_l_, "localKeySignatureChanges", SCM_EOL); //This souldn't be neccesary
+      last_keysig_ = sig;
+    }
+}
+
+
+
+
+
+ENTER_DESCRIPTION (New_accidental_engraver,
+"Make accidentals.  Catches note heads, ties and notices key-change
+events.  Due to interaction with ties (which don't come together
+with note heads), this needs to be in a context higher than Tie_engraver.",
+                  
+              "Accidental",
+              "rhythmic-head-interface tie-interface arpeggio-interface",
+              "localKeySignature localKeySignatureChanges extraNatural autoAccidentals autoCautionaries",
+                  "localKeySignature localKeySignatureChanges");
index fca566f9bde50e8602b89f29d3b337b974973faa..504c6089f099356c616b8bb522437d61771089ab 100644 (file)
@@ -60,6 +60,8 @@ LY_DEFINE(set_lily_option,"set-lily-option", 2, 0, 0,  (SCM var, SCM val),
 List all options.
 @item midi-debug
 If set to true, generate human  readable MIDI
+@item internal-type-checking
+Set paranoia for property assignments 
 @end table
 
 This function is useful to call from the command line: @code{lilypond -e
index 3ce7279c4183ba3194588c82db5e1b899e384efa..0e5e9cb5335c146d2e5146619ba2e1ed4a4a0f3b 100644 (file)
@@ -312,16 +312,6 @@ Translator_group::internal_set_property (SCM sym, SCM val)
   properties_dict ()->set (sym, val);
 }
 
-void
-Translator_group::internal_set_children_property (SCM sym, SCM val)
-{
-  internal_set_property (sym, val);
-  for (SCM p = trans_group_list_; gh_pair_p (p); p = ly_cdr(p)) {
-    Translator_group *trg =  dynamic_cast<Translator_group*> (unsmob_translator (ly_car (p)));
-    trg->internal_set_children_property(sym,ly_deep_copy(val));
-  }
-}
-
 /*
   TODO: look up to check whether we have inherited var? 
  */
index 44828b48f5dcbe9147aee450d55732d1bef77c13..d2378d0d701207b2a8abed38835808f2e142e908 100644 (file)
@@ -379,6 +379,7 @@ ScoreContext = \translator {
        centralCPosition = #-6
        
         automaticPhrasing = ##t
+       automaticMelismata = ##t
        
        defaultBarType = #"|"
 
index cfe089871c32f9c7af048758f6569e82b445711e..8ee4ca1a2c9b482fcb2d6ccf33e6b31c42caafec 100644 (file)
@@ -148,7 +148,7 @@ voiceAccidentals = {
 % in other octaves and in the next measure.
 modernAccidentals = {
   \property Score.extraNatural = ##f
-  \property Score.autoAccidentals = #'(Staff (same-octave . 0) (any-octave . 0) (any-octave . 1))
+  \property Score.autoAccidentals = #'(Staff (same-octave . 0) (any-octave . 0) (same-octave . 1))
   \property Score.autoCautionaries = #'()  
 }
 
@@ -156,7 +156,7 @@ modernAccidentals = {
 modernCautionaries = {
   \property Score.extraNatural = ##f
   \property Score.autoAccidentals = #'(Staff (same-octave . 0))
-  \property Score.autoCautionaries = #'(Staff (any-octave . 0) (any-octave . 1))  
+  \property Score.autoCautionaries = #'(Staff (any-octave . 0) (same-octave . 1))  
 }
 
 % Multivoice accidentals to be read both by musicians playing one voice
@@ -165,8 +165,8 @@ modernCautionaries = {
 modernVoiceAccidentals = {
   \property Staff.extraNatural = ##f
   \property Staff.autoAccidentals = #'(
-    Voice (same-octave . 0) (any-octave . 0) (any-octave . 1)
-    Staff (same-octave . 0) (any-octave . 0) (any-octave . 1)
+    Voice (same-octave . 0) (any-octave . 0) (same-octave . 1)
+    Staff (same-octave . 0) (any-octave . 0) (same-octave . 1)
   )
   \property Staff.autoCautionaries = #'()  
 }
@@ -179,8 +179,8 @@ modernVoiceCautionaries = {
     Voice (same-octave . 0) 
   )
   \property Staff.autoCautionaries = #'(
-    Voice (any-octave . 0) (any-octave . 1)
-    Staff (same-octave . 0) (any-octave . 0) (any-octave . 1)
+    Voice (any-octave . 0) (same-octave . 1)
+    Staff (same-octave . 0) (any-octave . 0) (same-octave . 1)
   )  
 }
 
@@ -188,12 +188,23 @@ modernVoiceCautionaries = {
 % Accidentals are cancelled across the staves in the same grand staff as well
 pianoAccidentals = {
   \property GrandStaff.autoAccidentals = #'(
-    Staff (same-octave . 0) (any-octave . 0) (any-octave . 1)
-    GrandStaff (any-octave . 1)
+    Staff (same-octave . 0) (any-octave . 0) (same-octave . 1)
+    GrandStaff (any-octave . 0) (same-octave . 1)
   )
   \property GrandStaff.autoCautionaries = #'()  
 }
 
+pianoCautionaries = {
+  \property GrandStaff.autoAccidentals = #'(
+    Staff (same-octave . 0)
+  )
+  \property GrandStaff.autoCautionaries = #'(
+    Staff (any-octave . 0) (same-octave . 1)
+    GrandStaff (any-octave . 0) (same-octave . 1)
+  )  
+}
+
+
 % Do not reset the key at the start of a measure.  Accidentals will be
 % printed only once and are in effect until overridden, possibly many
 % measures later.
index 3e88da7196fe822a05bf11ad0159285693f6759f..517cb979bb764fcd30675062d4dcf87e2a5c1d6f 100644 (file)
        (crashcymbalb     cymcb ,(make-pitch -1 5 0))
        (vibraslap        vibs  ,(make-pitch -1 5 1))
        (ridecymbalb      cymrb ,(make-pitch -1 6 0))
+       (mutehibongo      bohm  ,(make-pitch -1 6 1))
        (hibongo          boh   ,(make-pitch 0 0 0))
+       (openhibongo      boho  ,(make-pitch 0 1 -2))
+       (mutelobongo      bolm  ,(make-pitch -1 6 2))
        (lobongo          bol   ,(make-pitch 0 0 1))
+       (openlobongo      bolo  ,(make-pitch 0 1 -1))
        (mutehiconga      cghm  ,(make-pitch 0 1 0))
+       (muteloconga      cglm  ,(make-pitch 0 2 -2))
        (openhiconga      cgho  ,(make-pitch 0 1 1))
        (hiconga          cgh   ,(make-pitch 0 2 -1))
        (openloconga      cglo  ,(make-pitch 0 1 2))
        (hihat            cross         #f        ,(make-pitch 0 3 0))
        (highfloortom     default       #f        ,(make-pitch -1 5 0))
        (pedalhihat       cross         #f        ,(make-pitch -1 2 0))
-       (lowtom           default       #f        ,(make-pitch 0 0 0))
+       (lowtom           default       #f        ,(make-pitch -1 6 0))
        (openhihat        cross         "open"    ,(make-pitch 0 3 0))
        (halfopenhihat    xcircle       #f        ,(make-pitch 0 3 0))
-       (lowmidtom        default       #f        ,(make-pitch 0 1 0))
+       (lowmidtom        default       #f        ,(make-pitch 0 0 0))
        (himidtom         default       #f        ,(make-pitch 0 2 0))
        (crashcymbala     xcircle       #f        ,(make-pitch 0 5 0))
        (crashcymbal      xcircle       #f        ,(make-pitch 0 5 0))
 (define congas `(
        (losidestick      cross         #f        ,(make-pitch -1 6 0))
        (loconga          default       #f        ,(make-pitch -1 6 0))
-       (openloconga      default       ,"open"   ,(make-pitch -1 6 0))
+       (openloconga      default       "open"    ,(make-pitch -1 6 0))
+       (muteloconga      default       "stopped" ,(make-pitch -1 6 0))
        (hisidestick      cross         #f        ,(make-pitch 0 1 0))
        (hiconga          default       #f        ,(make-pitch 0 1 0))
        (openhiconga      default       "open"    ,(make-pitch 0 1 0))
  ))
 
 (define bongos `(
+       (losidestick      cross         #f        ,(make-pitch -1 6 0))
        (lobongo          default       #f        ,(make-pitch -1 6 0))
+       (openlobongo      default       "open"    ,(make-pitch -1 6 0))
+       (mutelobongo      default       "stopped" ,(make-pitch -1 6 0))
+       (hisidestick      cross         #f        ,(make-pitch 0 1 0))
        (hibongo          default       #f        ,(make-pitch 0 1 0))
+       (openhibongo      default       "open"    ,(make-pitch 0 1 0))
+       (mutehibongo      default       "stopped" ,(make-pitch 0 1 0))
  ))
 
 
index 420e4f31c0f621dd7cc93cff93db0c92352e8d31..5e092b2dc39f1962203d0b6a9d9f17cd25c808ac 100644 (file)
@@ -74,7 +74,7 @@
        ("grob overview" . "Detailed description of all Grobs")
        ("interfaces" . "Grob Interfaces")
        ("backend properties" . "Grob properties")
-       ("function documentation" . "Grob properties")       
+       ("function documentation" . "All embedded functions")
        ("Index" . "index")
        ))
 
index 04ad946b57f8855f47f7e1f038775419bf51f0b2..439dae00c50d1874b340af321d4fc1ad9664f6f8 100644 (file)
        (neutral-direction . -1)
        (adjust-if-on-staffline . #t)
        (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
-       (font-family . music)
+       (font-family . ancient)
        (space-alist . (
                        (first-note . (minimum-space . 0.0))
                        ))