]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/notation/rhythms.itely
Issue 4127: allow mid-measure \time
[lilypond.git] / Documentation / notation / rhythms.itely
index 61c7b65b92d0128e262b0a213b2ae73b1a19a7fd..a2c506cbbe4485d747e37f3be2c95d9d583380e6 100644 (file)
@@ -7,7 +7,7 @@
     Guide, node Updating translation committishes..
 @end ignore
 
-@c \version "2.16.0"
+@c \version "2.19.2"
 
 @node Rhythms
 @section Rhythms
@@ -93,6 +93,15 @@ note.
 a a a2 a a4 a a1 a
 @end lilypond
 
+Durations occuring on their own within a music sequence will take
+their pitches from the preceding note or chord.
+
+@lilypond[quote,verbatim,relative=2]
+\time 8/1
+c \longa \breve 1 2
+4 8 16 32 64 128 128
+@end lilypond
+
 @cindex notes, dotted
 @cindex dotted notes
 @cindex notes, double-dotted
@@ -143,7 +152,7 @@ the staff; see @ref{Direction and placement}.
 @snippets
 
 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
-{alternative-breve-note.ly}
+{alternative-breve-notes.ly}
 
 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
 {changing-the-number-of-augmentation-dots-per-note.ly}
@@ -186,26 +195,35 @@ rests from 128th to maxima (8 x whole) may be printed.
 @cindex tuplets
 @cindex triplets
 
-@funindex \times
-@funindex times
+@funindex \tuplet
+@funindex tuplet
 
-Tuplets are made from a music expression by multiplying all the
-durations with a fraction:
+Tuplets are made from a music expression with the @code{\tuplet}
+command, multiplying the speed of the music expression by a fraction:
 
 @example
-\times @var{fraction} @{ @var{music} @}
+\tuplet @var{fraction} @{ @var{music} @}
 @end example
 
 @noindent
-The duration of @code{@var{music}} will be multiplied by the
-fraction.  The fraction's denominator will be printed over or
-under the notes, optionally with a bracket.  The most common
-tuplet is the triplet in which 3 notes have the duration of 2, so
-the notes are 2/3 of their written length.
+The fraction's numerator will be printed over or under the notes,
+optionally with a bracket.  The most common tuplets are triplets
+(3@tie{}notes sound within the duration normally allowed for@tie{}2).
+
+@lilypond[quote,verbatim,relative=2]
+a2 \tuplet 3/2 { b4 4 4 }
+c4 c \tuplet 3/2 { b4 a g }
+@end lilypond
+
+@cindex tuplet grouping
+@noindent
+When entering long passages of tuplets, having to write a separate
+@code{\tuplet} command for each group is inconvenient.  It is possible
+to specify the duration of one tuplet group directly before the music
+in order to have the tuplets grouped automatically:
 
 @lilypond[quote,verbatim,relative=2]
-a2 \times 2/3 { b4 b b }
-c4 c \times 2/3 { b4 a g }
+g2 r8 \tuplet 3/2 8 { cis16 d e e f g g f e }
 @end lilypond
 
 @cindex tuplet bracket placement
@@ -217,22 +235,27 @@ c4 c \times 2/3 { b4 a g }
 @funindex \tupletNeutral
 @funindex tupletNeutral
 
-Tuplet brackets may be manually placed above or below the staff;
-see @ref{Direction and placement}.
+Tuplet brackets may be manually placed above or below the staff:
+
+@lilypond[quote,verbatim,relative=2]
+\tupletUp \tuplet 3/2 { c8 d e }
+\tupletNeutral \tuplet 3/2 { c8 d e }
+\tupletDown \tuplet 3/2 { f,8 g a }
+\tupletNeutral \tuplet 3/2 { f8 g a }
+@end lilypond
 
 Tuplets may be nested:
 
 @lilypond[quote,verbatim,relative=2]
 \autoBeamOff
-c4 \times 4/5 { f8 e f \times 2/3 { e[ f g] } } f4
+c4 \tuplet 5/4 { f8 e f \tuplet 3/2 { e[ f g] } } f4
 @end lilypond
 
-Modifying nested tuplets which begin at the same musical moment
-must be done with @code{\tweak}.
-
-To modify the duration of notes without printing a tuplet bracket,
-see @ref{Scaling durations}.
+Modifying nested tuplets which begin at the same musical moment must be
+done with @code{\tweak}.
 
+To modify the duration of notes without printing a tuplet bracket, see
+@ref{Scaling durations}.
 
 @predefined
 @code{\tupletUp},
@@ -250,7 +273,7 @@ see @ref{Scaling durations}.
 @funindex tupletSpannerDuration
 
 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
-{entering-several-tuplets-using-only-one--times-command.ly}
+{entering-several-tuplets-using-only-one--tuplet-command.ly}
 
 @cindex Tuplet number changes
 
@@ -278,6 +301,7 @@ Learning Manual:
 @rlearning{Tweaking methods}.
 
 Notation Reference:
+@ref{Direction and placement},
 @ref{Time administration},
 @ref{Scaling durations},
 @ref{The tweak command},
@@ -291,20 +315,6 @@ Internals Reference:
 @rinternals{TupletNumber},
 @rinternals{TimeScaledMusic}.
 
-@cindex grace notes within tuplet brackets
-
-@knownissues
-Grace notes may be placed within tuplet brackets, @emph{except}
-when a staff begins with a grace note followed by a tuplet.  In this
-particular case, the grace note must be placed before the @code{\times}
-command to avoid errors.
-
-@cindex tempo marks within tuplet brackets
-
-When using a tuplet at the beginning of a piece with a @code{\tempo}
-mark, the music must be explicitly entered in a @code{\new Voice}
-block, as discussed in @rlearning{Voices contain music}.
-
 
 @node Scaling durations
 @unnumberedsubsubsec Scaling durations
@@ -380,6 +390,15 @@ Notation Reference:
 Snippets:
 @rlsr{Rhythms}.
 
+@knownissues
+The calculation of the position within a measure must take into
+account all the scaling factors applied to the notes within that
+measure and any fractional carry-out from earlier measures.  This
+calculation is carried out using rational numbers.  If an intermediate
+numerator or denominator in that calculation exceeds 2^30 the
+execution and typesetting will stop at that point without indicating
+an error.
+
 
 @node Ties
 @unnumberedsubsubsec Ties
@@ -396,10 +415,19 @@ indicate articulation, or @emph{phrasing slurs}, which indicate
 musical phrasing.  A tie is just a way of extending a note
 duration, similar to the augmentation dot.}
 
-A tie is entered using the tilde symbol (@code{~}).
+A tie is entered by appending a tilde symbol (@code{~}) to the first
+of each pair of notes being tied.  This indicates that the note
+should be tied to the following note, which must be at the same pitch.
 
 @lilypond[quote,verbatim,relative=2]
-a2 ~ a
+a2~ 4~ 16 r r8
+@end lilypond
+
+Ties can make use of the @q{last explicit pitch} interpretation of
+isolated durations:
+
+@lilypond[quote,verbatim,relative=2]
+a2~ 4~ 16 r r8
 @end lilypond
 
 Ties are used either when the note crosses a bar line, or when
@@ -408,8 +436,8 @@ used when note values cross larger subdivisions of the measure:
 
 @lilypond[verbatim,quote]
 \relative c' {
-  r8 c8 ~ c2 r4 |
-  r8^"not" c2 ~ c8 r4
+  r8 c2 r4 |
+  r8^"not" c28 r4
 }
 @end lilypond
 
@@ -423,11 +451,12 @@ ties them across bar lines.
 
 When a tie is applied to a chord, all note heads whose pitches
 match are connected.  When no note heads match, no ties will be
-created.  Chords may be partially tied by placing the tie inside
+created.  Chords may be partially tied by placing the ties inside
 the chord.
 
 @lilypond[quote,verbatim,relative=1]
-<c e g> ~ <c e g>
+<c e g>2 ~ 2
+<c e g>4~ <c e g c>
 <c~ e g~ b> <c e g b>
 @end lilypond
 
@@ -443,7 +472,7 @@ When a second alternative of a repeat starts with a tied note, you
 have to specify the repeated tie as follows:
 
 @lilypond[quote,relative=2,verbatim]
-\repeat volta 2 { c g <c e>2 ~ }
+\repeat volta 2 { c g <c e>2~ }
 \alternative {
   % First alternative: following note is tied normally
   { <c e>2. r4 }
@@ -475,7 +504,7 @@ be entered as follows:
 @funindex \tieNeutral
 @funindex tieNeutral
 
-Ties may be manually placed above or below the staff; see
+Ties may be made to curve up or down manually; see
 @ref{Direction and placement}.
 
 @cindex ties, appearance
@@ -496,26 +525,26 @@ dashed.
 
 @lilypond[quote, verbatim, relative=1]
 \tieDotted
-c2 ~ c
+c2~ 2
 \tieDashed
-c2 ~ c
+c2~ 2
 \tieHalfDashed
-c2 ~ c
+c2~ 2
 \tieHalfSolid
-c2 ~ c
+c2~ 2
 \tieSolid
-c2 ~ c
+c2~ 2
 @end lilypond
 
 Custom dash patterns can be specified:
 
 @lilypond[quote, verbatim, relative=1]
 \tieDashPattern #0.3 #0.75
-c2 ~ c
+c2~ 2
 \tieDashPattern #0.7 #1.5
-c2 ~ c
+c2~ 2
 \tieSolid
-c2 ~ c
+c2~ 2
 @end lilypond
 
 Dash pattern definitions for ties have the same structure as dash
@@ -526,11 +555,11 @@ Override @var{whiteout} and @var{layer} layout properties for ties that
 collide with other objects in a staff.
 
 @lilypond[verbatim,quote,ragged-right,relative=2]
-\override Tie #'layer = #-2
-\override Staff.TimeSignature #'layer = #-1
-\override Staff.KeySignature #'layer = #-1
-\override Staff.TimeSignature #'whiteout = ##t
-\override Staff.KeySignature #'whiteout = ##t
+\override Tie.layer = #-2
+\override Staff.TimeSignature.layer = #-1
+\override Staff.KeySignature.layer = #-1
+\override Staff.TimeSignature.whiteout = ##t
+\override Staff.KeySignature.whiteout = ##t
 b2 b~
 \time 3/4
 \key a \major
@@ -623,7 +652,7 @@ commands:
 \new Staff {
   % These two lines are just to prettify this example
   \time 16/1
-  \override Staff.TimeSignature #'stencil = ##f
+  \omit Staff.TimeSignature
   % Print a maxima rest, equal to four breves
   r\maxima
   % Print a longa rest, equal to two breves
@@ -883,10 +912,10 @@ following example:}
 
 @lilypond[quote,verbatim,relative=2]
 % This fails, as the wrong object name is specified
-\override TextScript #'padding = #5
+\override TextScript.padding = #5
 R1^"wrong"
 % This is the correct object name to be specified
-\override MultiMeasureRestText #'padding = #5
+\override MultiMeasureRestText.padding = #5
 R1^"right"
 @end lilypond
 
@@ -998,7 +1027,9 @@ The time signature is set as follows:
 \time 3/4 c2.
 @end lilypond
 
-@cindex time signature, visibility of
+Mid-measure time signature changes are covered in @ref{Upbeats}.
+
+@cindex time signature visibility
 
 Time signatures are printed at the beginning of a piece
 and whenever the time signature changes.  If a change takes place
@@ -1051,11 +1082,34 @@ Mensural time signatures are covered in
 @funindex \overrideTimeSignatureSettings
 
 In addition to setting the printed time signature, the @code{\time}
-command also sets time-signature-based default values for the properties
-@code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.  The
-predefined default values for these properties can be found in
-@file{scm/time-signature-settings.scm}.  The existing default values can
-be changed, or new default values can be added:
+command also sets the values of the time-signature-based properties
+@code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
+The predefined default values for these properties can be found in
+@file{scm/time-signature-settings.scm}.
+
+The default value of @code{beatStructure} can be overridden in the
+@code{\time} command itself by supplying it as the optional first
+argument:
+
+@lilypond[quote,verbatim]
+\score {
+  \new Staff {
+    \relative c' {
+      \time #'(2 2 3) 7/8
+      \repeat unfold 7 { c8 } |
+      \time #'(3 2 2) 7/8
+      \repeat unfold 7 { c8 } |
+    }
+  }
+}
+@end lilypond
+
+Alternatively, the default values of all these time-signature-based
+variables, including @code{baseMoment} and @code{beamExceptions},
+can be set together.  The values can be set independently for several
+different time signatures.  The new values take effect when a
+subsequent @code{\time} command with the same value of the time
+signature is executed:
 
 @lilypond[quote,verbatim]
 \score {
@@ -1079,7 +1133,7 @@ be changed, or new default values can be added:
 
 @item
 @code{@var{timeSignatureFraction}}, a fraction describing the
-time signature.
+time signature to which these values apply.
 
 @item
 @code{@var{baseMomentFraction}}, a fraction containing the numerator
@@ -1095,37 +1149,6 @@ for the time signature that go beyond ending at every beat, as
 described in @ref{Setting automatic beam behavior}.
 @end enumerate
 
-The context containing @code{\overrideTimeSignatureSettings} must
-be instantiated before the @code{\overrideTimeSignatureSettings}
-call is executed.  That means it must either be explicitly
-instantiated or there must be music in the context before the
-@code{\overrideTimeSignatureSettings} call:
-
-@lilypond[quote,verbatim]
-\score {
-  \relative c' {
-    % This call will fail because the context isn't yet instantiated
-    \overrideTimeSignatureSettings
-      4/4        % timeSignatureFraction
-      1/4        % baseMomentFraction
-      #'(3 1)    % beatStructure
-      #'()       % beamExceptions
-    \time 4/4
-    c8^\markup {"Beamed (2 2)"}
-    \repeat unfold 7 { c8 } |
-    % This call will succeed
-    \overrideTimeSignatureSettings
-      4/4        % timeSignatureFraction
-      1/4        % baseMomentFraction
-      #'(3 1)    % beatStructure
-      #'()       % beamExceptions
-    \time 4/4
-    c8^\markup {"Beamed (3 1)"}
-    \repeat unfold 7 { c8 } |
-  }
-}
-@end lilypond
-
 
 @cindex time signature properties, restoring default values
 @cindex restoring default properties for time signatures
@@ -1194,6 +1217,10 @@ for different staves by moving the @code{Timing_translator} and the
 }
 @end lilypond
 
+A further method of changing these time-signature-related variables,
+which avoids reprinting the time signature at the time of the change,
+is shown in @ref{Setting automatic beam behavior}.
+
 @predefined
 @code{\numericTimeSignature},
 @code{\defaultTimeSignature}.
@@ -1210,8 +1237,12 @@ Music Glossary:
 
 Notation Reference:
 @ref{Mensural time signatures},
+@ref{Setting automatic beam behavior},
 @ref{Time administration}.
 
+Installed Files:
+@file{scm/time-signature-settings.scm}.
+
 Snippets:
 @rlsr{Rhythms}.
 
@@ -1242,7 +1273,7 @@ e4. d8 c2
 Metronome marks may also be printed as a range of two numbers:
 
 @lilypond[verbatim,quote,relative=1]
-\tempo 4 = 40 ~ 46
+\tempo 4 = 40 - 46
 c4. e8 a4 g
 b,2 d4 r
 @end lilypond
@@ -1279,6 +1310,29 @@ written by including an empty string in the input:
 d4 g e c
 @end lilypond
 
+@funindex \markLengthOn
+@funindex markLengthOn
+@funindex \markLengthOff
+@funindex markLengthOff
+
+In a part for an instrument with long periods of rests,
+tempo indications sometimes follow each other closely.
+The command @code{\markLengthOn} provides extra horizontal space
+to prevent tempo indications from overlapping, and @code{\markLengthOff}
+restores the default behavior of ignoring tempo marks
+for horizontal spacing.
+
+@lilypond[verbatim,quote,relative=0]
+\compressFullBarRests
+\markLengthOn
+\tempo "Molto vivace"
+R1*12
+\tempo "Meno mosso"
+R1*16
+\markLengthOff
+\tempo "Tranquillo"
+R1*20
+@end lilypond
 
 @snippets
 
@@ -1322,55 +1376,64 @@ Internals Reference:
 @cindex measure, partial
 @cindex measure, pickup
 @cindex pickup measure
+@cindex time signature, mid-measure
 
 @funindex measurePosition
 @funindex \partial
 @funindex partial
 
 Partial or pick-up measures, such as an @emph{anacrusis} or an
-@emph{upbeat}, are entered using the @code{\partial} command,
+@emph{upbeat}, are entered using the @code{\partial} command:
 
 @example
 \partial @var{duration}
 @end example
 
-@noindent
-where @code{@var{duration}} is the @emph{remaining} length of the
-partial measure @emph{before} the start of the next full measure.
+When @code{\partial} is used at the beginning of a score,
+@code{@var{duration}} is the length of the music preceding the
+first bar.
 
 @lilypond[quote,verbatim,relative=1]
 \time 3/4
-\partial 8
-e8 | a4 c8 b c4 |
+\partial 4.
+r4 e8 | a4 c8 b c4 |
 @end lilypond
 
-The @var{duration} can be any value less than a full measure:
+When @code{\partial} is used after the beginning of a score,
+@code{@var{duration}} is the @emph{remaining} length of the
+current measure.  It does not create a new numbered bar.
 
 @lilypond[quote,verbatim,relative=1]
-\time 3/4
+\set Score.barNumberVisibility = #all-bar-numbers-visible
+\override Score.BarNumber.break-visibility =
+          #end-of-line-invisible
+\time 9/8
+d'4.~ 4 d8 d( c) b | c4.~ 4. \bar "||"
+\time 12/8
 \partial 4.
-r4 e8 | a4 c8 b c4 |
+c8( d) e | f2.~ 4 f8 a,( c) f |
 @end lilypond
 
-The @code{\partial @var{duration}} can also be written as;
-
-@example
-\set Timing.measurePosition -@var{duration}
-@end example
-
-So @code{\partial 8} becomes:
+The @code{\partial} command is @emph{required} when the time
+signature changes in mid measure, but it may also be used alone.
 
 @lilypond[quote,verbatim,relative=1]
-\time 3/4
-\set Timing.measurePosition = #(ly:make-moment -1 8)
-e8 | a4 c8 b c4 |
+\set Score.barNumberVisibility = #all-bar-numbers-visible
+\override Score.BarNumber.break-visibility =
+          #end-of-line-invisible
+\time 6/8
+\partial 8
+e8 | a4 c8 b[ c b] |
+\partial 4
+r8 e,8 | a4 \bar "||"
+\partial 4
+r8 e8 | a4
+c8 b[ c b] |
 @end lilypond
 
-The property @code{measurePosition} contains a rational number
-indicating how much of the measure has passed at this point.  Note
-that this is set to a negative number by the @code{\partial} command:
-i.e., @code{\partial 4} is internally translated to @w{@code{-4}},
-meaning @qq{there is a quarter note left in the measure.}
+The @code{\partial} command sets the @code{Timing.measurePosition}
+property, which is a rational number that indicates how much of
+the measure has passed.
 
 @seealso
 Music Glossary:
@@ -1385,19 +1448,6 @@ Snippets:
 Internal Reference:
 @rinternals{Timing_translator}.
 
-@knownissues
-The @code{\partial} command should be used only at the beginning of a
-piece.  If you use it after the beginning, warnings or problems may
-occur, so use @code{\set Timing.measurePosition} instead.
-
-@lilypond[quote,verbatim,relative=1]
-\time 6/8
-\partial 8
-e8 | a4 c8 b[ c b] |
-\set Timing.measurePosition = #(ly:make-moment -1 4)
-r8 e,8 | a4 c8 b[ c b] |
-@end lilypond
-
 
 @node Unmetered music
 @unnumberedsubsubsec Unmetered music
@@ -1445,7 +1495,7 @@ Bar numbering is resumed at the end of the cadenza.
 
 @lilypond[verbatim,relative=2,quote]
 % Show all bar numbers
-\override Score.BarNumber #'break-visibility = #all-visible
+\override Score.BarNumber.break-visibility = #all-visible
 c4 d e d
 \cadenzaOn
 c4 c d8[ d d] f4 g4.
@@ -1454,15 +1504,20 @@ c4 c d8[ d d] f4 g4.
 d4 e d c
 @end lilypond
 
-A new bar is never started within a cadenza, even if one or more
-@code{\bar} commands are inserted within it.  Therefore, reminder
-accidentals will need to be added manually.  See @ref{Accidentals}.
+Inserting a @code{\bar} command within a cadenza does not start a new
+measure, even if a bar line is printed.  So any accidentals -- which
+are usually assumed to remain in force until the end of the measure --
+will still be valid after the bar line printed by @code{\bar}.  If
+subsequent accidentals should be printed, forced accidentals or
+reminder accidentals need to be inserted manually, see
+@ref{Accidentals}.
 
 @lilypond[verbatim,relative=2,quote]
 c4 d e d
 \cadenzaOn
 cis4 d cis d
 \bar "|"
+% First cis is printed without alteration even if it's after a \bar
 cis4 d cis! d
 \cadenzaOff
 \bar "|"
@@ -1523,20 +1578,6 @@ stretches of unmetered music to permit breaking:
 \bar ""
 @end example
 
-Explicitly create a @code{Voice} context when starting a piece with
-@code{\cadenzaOn}, else unexpected errors may occur.
-
-@example
-\new Voice @{
-  \relative c' @{
-    \cadenzaOn
-    c16[^"Solo Free Time" d e f] g2.
-    \bar "||"
-    \cadenzaOff
-  @}
-@}
-@end example
-
 
 @node Polymetric notation
 @unnumberedsubsubsec Polymetric notation
@@ -1546,16 +1587,16 @@ Explicitly create a @code{Voice} context when starting a piece with
 
 @cindex double time signatures
 @cindex signatures, polymetric
-@cindex time signatures, polymetric
-@cindex time signatures, double
+@cindex time signature, polymetric
+@cindex time signature, double
 @cindex polymetric signatures
 @cindex meter, polymetric
 
 @funindex timeSignatureFraction
 @funindex \scaleDurations
 @funindex scaleDurations
-@funindex \times
-@funindex times
+@funindex \tuplet
+@funindex tuplet
 
 Polymetric notation is supported explicitly or by manually modifying the
 visible time signature symbol and/or scaling note durations.
@@ -1596,7 +1637,7 @@ affect the autobeaming rules.
     \scaleDurations 3/5 {
       \repeat unfold 2 { c8[ c c] }
       \repeat unfold 2 { c8[ c] } |
-      c4. c \times 2/3 { c8[ c c] } c4
+      c4. c \tuplet 3/2 { c8[ c c] } c4
     }
   }
 >>
@@ -1750,6 +1791,37 @@ inserts ties for notes.  One of its uses is to debug complex scores: if
 the measures are not entirely filled, then the ties show exactly how
 much each measure is off.
 
+The property @code{completionUnit} sets a preferred duration for
+the split notes.
+
+@lilypond[quote,verbatim,relative=2]
+\new Voice \with {
+  \remove "Note_heads_engraver"
+  \consists "Completion_heads_engraver"
+} {
+  \time 9/8 g\breve. d4. \bar "||"
+  \set completionUnit = #(ly:make-moment 3 8)
+  g\breve. d4.
+}
+@end lilypond
+
+These engravers split notes with scaled duration, such as those in tuplets,
+into notes with the same scale-factor as in the input note.
+
+@lilypond[quote,verbatim,relative=2]
+\new Voice \with {
+  \remove "Note_heads_engraver"
+  \consists "Completion_heads_engraver"
+} {
+  \time 2/4 r4
+  \tuplet 3/2 {g4 a b}
+  \scaleDurations 2/3 {g a b}
+  g4*2/3 a b
+  \tuplet 3/2 {g4 a b}
+  r4
+}
+@end lilypond
+
 @seealso
 Music Glossary:
 @rglos{tie}
@@ -1769,12 +1841,12 @@ Internals Reference:
 @rinternals{Forbid_line_break_engraver}.
 
 @knownissues
-Not all durations (especially those containing tuplets) can be
-represented exactly with normal notes and dots, but the
-@code{Completion_heads_engraver} will not insert tuplets.
-
-The @code{Completion_heads_engraver} only affects notes; it does not
-split rests.
+For consistency with previous behavior, notes and rests with
+duration longer than a measure, such as @code{c1*2}, are split into
+notes without any scale factor, @code{@{ c1 c1 @}}.  The property
+@code{completionFactor} controls this behavior, and setting it to
+@code{#f} cause split notes and rest to have the scale factor
+of the input durations.
 
 
 @node Showing melody rhythms
@@ -1829,7 +1901,7 @@ be done with the @code{Pitch_squash_engraver} and
     }
   }
   \new Voice \with {
-    \consists Pitch_squash_engraver
+    \consists "Pitch_squash_engraver"
   } \relative c'' {
     \improvisationOn
     c4 c8 c c4 c8 c
@@ -1909,7 +1981,7 @@ c16 c8
 @cindex beams, with melismata
 
 @warning{If beams are used to indicate melismata in songs, then
-automatic beaming should be switched off with @code{\autoBeamOff}
+automatic beaming should be switched off with @code{@bs{}autoBeamOff}
 and the beams indicated manually.  Using @code{@bs{}partcombine} with
 @code{@bs{}autoBeamOff} can produce unintended results.  See the
 snippets for more information.}
@@ -1977,6 +2049,7 @@ new beam starts.
 @funindex autoBeaming
 @funindex baseMoment
 @funindex beamExceptions
+@funindex \beamExceptions
 @funindex beatStructure
 @funindex measureLength
 @funindex \time
@@ -1987,14 +2060,23 @@ new beam starts.
 When automatic beaming is enabled, the placement of automatic beams
 is determined by three context properties:
 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
+The default values of these variables may be overridden as described
+below, or alternatively the default values themselves may be changed
+as explained in @ref{Time signature}.
+
 If a @code{beamExceptions} rule is defined for the time signature in
-force, that rule is used to determine the beam placement.  If no
-@code{beamExceptions} rule is defined for the time signature in force,
-the beam placement is determined by the settings of @code{baseMoment}
-and @code{beatStructure}.
+force, that rule alone is used to determine the beam placement; the
+values of @code{baseMoment} and @code{beatStructure} are ignored.
+
+If no @code{beamExceptions} rule is defined for the time signature
+in force, the beam placement is determined by the values of
+@code{baseMoment} and @code{beatStructure}.
+
+
+@subsubsubheading Beaming based on @code{baseMoment} and @code{beatStructure}
 
 By default, @code{beamExceptions} rules are defined for most common
-time signatures, so the @code{beamException} rules must be disabled
+time signatures, so the @code{beamExceptions} rules must be disabled
 if automatic beaming is to be based on @code{baseMoment} and
 @code{beatStructure}.  The @code{beamExceptions} rules are disabled
 by
@@ -2003,41 +2085,35 @@ by
 \set Timing.beamExceptions = #'()
 @end example
 
-
-@subsubsubheading Beaming based on @code{baseMoment} and @code{beatStructure}
-
-In most instances, automatic beams will end at the end of a beat.
-The ending points for beats are determined by the context properties
-@code{baseMoment} and @code{beatStructure}.  @code{beatStructure}
-is a scheme list that defines the length of each beat in the measure
-in units of @code{baseMoment}.  By default, @code{baseMoment} is
-one over the denominator of the time signature.  By default,
-each unit of length @code{baseMoment} is a single beat.
+When @code{beamExceptions} is set to @code{#'()}, either due to an
+explicit setting or because no @code{beamExceptions} rules are defined
+internally for the time signature in force, the ending points for
+beams are on beats as specified by the context properties
+@code{baseMoment} and @code{beatStructure}.  @code{beatStructure} is
+a scheme list that defines the length of each beat in the measure in
+units of @code{baseMoment}.  By default, @code{baseMoment} is one
+over the denominator of the time signature.  By default, each unit of
+length @code{baseMoment} is a single beat.
 
 @lilypond[quote,relative=2,verbatim]
 \time 5/16
 c16^"default" c c c c |
+% beamExceptions are unlikely to be defined for 5/16 time,
+% but let's disable them anyway to be sure
+\set Timing.beamExceptions = #'()
 \set Timing.beatStructure = #'(2 3)
 c16^"(2+3)" c c c c |
 \set Timing.beatStructure = #'(3 2)
 c16^"(3+2)" c c c c |
 @end lilypond
 
-If a common time signature is being used, @code{beamExceptions}
-@emph{must} be disabled to enable @code{beatStructure} to work.
-The @code{\set Timing.beamExceptions = #'()} command can always
-be included if beaming is being determined by @code{beatStructure}.
-
 @lilypond[quote,relative=2,verbatim]
 \time 4/4
 a8^"default" a a a a a a a
-
-\set Timing.baseMoment = #(ly:make-moment 1 4)
-\set Timing.beatStructure = #'(1 1 1 1)
-a8^"no change" a a a a a a a
-
+% Disable beamExceptions because they are definitely
+% defined for 4/4 time
 \set Timing.beamExceptions = #'()
-\set Timing.baseMoment = #(ly:make-moment 1 4)
+\set Timing.baseMoment = #(ly:make-moment 1/4)
 \set Timing.beatStructure = #'(1 1 1 1)
 a8^"changed" a a a a a a a
 @end lilypond
@@ -2049,6 +2125,8 @@ enclosing context will apply.
 @lilypond[quote, verbatim,relative=1]
 \new Staff {
   \time 7/8
+  % No need to disable beamExceptions
+  % as they are not defined for 7/8 time
   \set Staff.beatStructure = #'(2 3 2)
   <<
     \new Voice = one {
@@ -2092,7 +2170,9 @@ compatible with the new value of @code{baseMoment}.
 
 @lilypond[quote,verbatim,relative=2]
 \time 5/8
-\set Timing.baseMoment = #(ly:make-moment 1 16)
+% No need to disable beamExceptions
+% as they are not defined for 5/8 time
+\set Timing.baseMoment = #(ly:make-moment 1/16)
 \set Timing.beatStructure = #'(7 3)
 \repeat unfold 10 { a16 }
 @end lilypond
@@ -2111,42 +2191,24 @@ the time signature. Any exceptions to this default can be found in
 Special autobeaming rules (other than ending a beam on a beat)
 are defined in the @code{beamExceptions} property.
 
+The value for @code{beamExceptions}, a somewhat complex Scheme
+data structure, is easiest generated with the
+@code{\beamExceptions} function.  This function is given one or
+more manually beamed measure-length rhythmic patterns (measures
+have to be separated by a bar check@tie{}@code{|} since the
+function has no other way to discern the measure length).  Here is
+a simple example:
+
 @lilypond[quote,relative=2,verbatim]
 \time 3/16
 \set Timing.beatStructure = #'(2 1)
 \set Timing.beamExceptions =
-  #'(                         ;start of alist
-     (end .                   ;entry for end of beams
-      (                       ;start of alist of end points
-       ((1 . 32) . (2 2 2))   ;rule for 1/32 beams -- end each 1/16
-      )))                     %close all entries
+  \beamExceptions { 32[ 32] 32[ 32] 32[ 32] }
 c16 c c |
 \repeat unfold 6 { c32 } |
 @end lilypond
 
-@code{beamExceptions} is an alist with a key of rule-type and a value
-of beaming-rules.
-
-At this time the only available value of rule-type is
-@code{'end} for beam ending.
-
-Beaming-rules is a scheme alist (or list of pairs) that indicates the
-beam type and the grouping to be applied to beams containing notes with
-a shortest duration of that beam type.
-
-@example
-#'((beam-type1 . grouping-1)
-   (beam-type2 . grouping-2)
-   (beam-type3 . grouping-3))
-@end example
-
-Beam type is a scheme pair indicating the duration of the beam,
-e.g., @code{(1 . 16)}.
-
-Grouping is a scheme list indicating the grouping to be applied to
-the beam.  The grouping is in units of the beam type.
-
-@warning{ A @code{beamExceptions} value must be @emph{complete}
+@warning{A @code{beamExceptions} value must be @emph{complete}
 exceptions list.  That is, every exception that should be applied
 must be included in the setting.  It is not possible to add, remove,
 or change only one of the exceptions. While this may seem cumbersome,
@@ -2183,7 +2245,7 @@ if @code{beamExceptions} is not reset.
 
 @lilypond[quote,verbatim,relative=2]
 \time 4/4
-\set Timing.baseMoment = #(ly:make-moment 1 8)
+\set Timing.baseMoment = #(ly:make-moment 1/8)
 \set Timing.beatStructure = #'(3 3 2)
 % This won't beam (3 3 2) because of beamExceptions
 \repeat unfold 8 {c8} |
@@ -2200,7 +2262,7 @@ reset @code{beamExceptions}.
 \time 3/4
 % by default we beam in (6) due to beamExceptions
 \repeat unfold 6 {a8} |
-% This will beam (1 1 1) due to beatLength
+% This will beam (1 1 1) due to default baseMoment and beatStructure
 \set Timing.beamExceptions = #'()
 \repeat unfold 6 {a8}
 @end lilypond
@@ -2230,7 +2292,7 @@ the appearance of beams:
 
 @itemize
 @item
-If a manual beam is specified with @code{[..]} set the beam
+If a manual beam is specified with @code{[@dots{}]} set the beam
 as specified, otherwise
 
 @item
@@ -2240,7 +2302,7 @@ beams may end, otherwise
 
 @item
 if a beam-ending rule is defined in @code{beamExceptions}
-for a longer beam-type, use it to determined the valid places
+for a longer beam-type, use it to determine the valid places
 where beams may end, otherwise
 
 @item
@@ -2283,8 +2345,11 @@ The default beaming rules can be found in
 {beam-endings-in-score-context.ly}
 
 @seealso
+Notation Reference:
+@ref{Time signature}.
+
 Installed Files:
-@file{scm/beam-settings.scm}.
+@file{scm/time-signature-settings.scm}.
 
 Snippets:
 @rlsr{Rhythms}.
@@ -2316,8 +2381,9 @@ in only one staff.
 <<
   \new Staff {
     \time 3/4
-    \set Timing.baseMoment = #(ly:make-moment 1 8)
+    \set Timing.baseMoment = #(ly:make-moment 1/8)
     \set Timing.beatStructure = #'(1 5)
+    \set Timing.beamExceptions = #'()
     \repeat unfold 6 { a8 }
   }
   \new Staff {
@@ -2395,7 +2461,7 @@ Unbeamed grace notes are not put into normal note beams.
 
 @lilypond[quote,verbatim,relative=2]
 c4 d8[
-\grace { e32[ d c d] }
+\grace { e32 d c d }
 e8] e[ e
 \grace { f16 }
 e8 e]
@@ -2486,14 +2552,14 @@ lengthening.  The first four 32nd notes gradually speed up, while
 the last four 32nd notes are at a constant tempo.
 
 @lilypond[relative=1,verbatim,quote]
-\override Beam #'grow-direction = #LEFT
-\featherDurations #(ly:make-moment 2 1)
+\override Beam.grow-direction = #LEFT
+\featherDurations #(ly:make-moment 2/1)
 { c16[ c c c c c c c] }
-\override Beam #'grow-direction = #RIGHT
-\featherDurations #(ly:make-moment 2 3)
+\override Beam.grow-direction = #RIGHT
+\featherDurations #(ly:make-moment 2/3)
 { c32[ d e f] }
 % revert to non-feathered beams
-\override Beam #'grow-direction = #'()
+\override Beam.grow-direction = #'()
 { g32[ a b c] }
 @end lilypond
 
@@ -2608,7 +2674,7 @@ f1 \bar "|"
 f1 \bar "."
 g1 \bar "||"
 a1 \bar ".|"
-b1 \bar ".|."
+b1 \bar ".."
 c1 \bar "|.|"
 d1 \bar "|."
 e1
@@ -2618,31 +2684,43 @@ e1
 together with dotted and dashed bar lines:
 
 @lilypond[quote,relative=1,verbatim]
-f1 \bar ":"
-g1 \bar "dashed"
+f1 \bar ";"
+g1 \bar "!"
 a1
 @end lilypond
 
 @noindent
-and five types of repeat bar line:
+and nine types of repeat bar lines:
 
 @lilypond[quote,relative=1,verbatim]
-f1 \bar "|:"
-g1 \bar ":|:"
+f1 \bar ".|:"
+g1 \bar ":..:"
 a1 \bar ":|.|:"
 b1 \bar ":|.:"
-c1 \bar ":|"
-e1
+c1 \bar ":.|.:"
+d1 \bar "[|:"
+e1 \bar ":|][|:"
+f1 \bar ":|]"
+g1 \bar ":|."
+a1
 @end lilypond
 
 Additionally, a bar line can be printed as a simple tick:
 @lilypond[quote,relative=1,verbatim]
-f1 \bar "'"
+f1 \bar "'" g1
 @end lilypond
 However, as such ticks are typically used in Gregorian chant, it is
 preferable to use @code{\divisioMinima} there instead, described in
 the section @ref{Divisiones} in Gregorian chant.
 
+Lilypond supports kievan notation and provides a special kievan
+bar line:
+@lilypond[quote,relative=1,verbatim]
+f1 \bar "k"
+@end lilypond
+Further details of this notation are explained in
+@ref{Typesetting Kievan square notation}.
+
 @cindex segno
 
 For in-line segno signs, there are three types of bar lines which
@@ -2654,13 +2732,13 @@ c4 c c c
 c4 c c c \break
 \bar "S"
 c4 c c c
-\bar "|S"
+\bar "S-|"
 c4 c c c \break
-\bar "|S"
+\bar "S-|"
 c4 c c c
-\bar "S|"
+\bar "S-S"
 c4 c c c \break
-\bar "S|"
+\bar "S-S"
 c1
 @end lilypond
 
@@ -2672,16 +2750,16 @@ a repeated section.  Such repeated sections are better entered
 using the various repeat commands (see @ref{Repeats}), which
 automatically print the appropriate bar lines.
 
-In addition, you can specify @code{"||:"}, which is equivalent to
-@code{"|:"} except at line breaks, where it gives a double bar
+In addition, you can specify @code{".|:-||"}, which is equivalent to
+@code{".|:"} except at line breaks, where it gives a double bar
 line at the end of the line and a start repeat at the beginning of
 the next line.
 
 @lilypond[quote,relative=2,verbatim]
 c4 c c c
-\bar "||:"
+\bar ".|:-||"
 c4 c c c \break
-\bar "||:"
+\bar ".|:-||"
 c4 c c c
 @end lilypond
 
@@ -2690,36 +2768,131 @@ variations:
 
 @lilypond[quote,relative=2,verbatim]
 c4 c c c
-\bar ":|S"
+\bar ":|.S"
 c4 c c c \break
-\bar ":|S"
+\bar ":|.S"
 c4 c c c
-\bar ":|S."
+\bar ":|.S-S"
 c4 c c c \break
-\bar ":|S."
+\bar ":|.S-S"
 c4 c c c
-\bar "S|:"
+\bar "S.|:-S"
 c4 c c c \break
-\bar "S|:"
+\bar "S.|:-S"
 c4 c c c
-\bar ".S|:"
+\bar "S.|:"
 c4 c c c \break
-\bar ".S|:"
+\bar "S.|:"
 c4 c c c
-\bar ":|S|:"
+\bar ":|.S.|:"
 c4 c c c \break
-\bar ":|S|:"
+\bar ":|.S.|:"
 c4 c c c
-\bar ":|S.|:"
+\bar ":|.S.|:-S"
 c4 c c c \break
-\bar ":|S.|:"
+\bar ":|.S.|:-S"
 c1
 @end lilypond
 
-Additionally there is an @code{\inStaffSegno} command which
-creates a segno bar, placed in cooperation
-with the @code{\repeat volta} command.
+Additionally there is an @code{\inStaffSegno} command which creates
+a segno bar line in conjunction with an appropriate repeat bar line
+when used with a @code{\repeat volta} command, see
+@ref{Normal repeats}.
+
+@funindex \defineBarLine
+@funindex defineBarLine
+@cindex bar lines, defining
+@cindex defining bar lines
+
+New bar line types can be defined with @code{\defineBarLine}:
+
+@example
+\defineBarLine @var{bartype} #'(@var{end} @var{begin} @var{span})
+@end example
+
+The @code{\defineBarline} variables can include the
+@q{empty} string @code{""}, which is equivalent to an invisible
+bar line being printed.  Or they can be set to @code{#f} which
+prints no bar line at all.
+
+After the definiton, the new bar line can be used by
+@code{\bar} @var{bartype}.
+
+There are currently ten bar line elements available:
+
+@lilypond[quote,verbatim]
+\defineBarLine ":" #'("" ":" "")
+\defineBarLine "=" #'("=" "" "")
+\defineBarLine "[" #'("" "[" "")
+\defineBarLine "]" #'("]" "" "")
+
+\new Staff {
+  s1 \bar "|"
+  s1 \bar "."
+  s1 \bar "!"
+  s1 \bar ";"
+  s1 \bar ":"
+  s1 \bar "k"
+  s1 \bar "S"
+  s1 \bar "="
+  s1 \bar "["
+  s1 \bar "]"
+  s1 \bar ""
+}
+@end lilypond
+
+The @code{"="} bar line provides the double span bar line, used
+in combination with the segno sign.  Do not use it as a standalone
+double thin bar line; here, @code{\bar} @var{"||"} is
+preferred.
+
+The @code{"-"} sign starts annotations to bar lines which
+are useful to distinguish those with identical appearance
+but different behavior at line breaks and/or different span bars.
+The part following the @code{"-"} sign is not used for building up
+the bar line.
+
+@lilypond[quote,relative=2,verbatim]
+\defineBarLine "||-dashedSpan" #'("||" "" "!!")
+
+\new StaffGroup <<
+  \new Staff {
+    c1 \bar "||"
+    c1 \bar "||-dashedSpan"
+    c1
+  }
+  \new Staff {
+    c1
+    c1
+    c1
+  }
+>>
+@end lilypond
+
+Furthermore, the space character @code{" "} serves as a placeholder
+for defining span bars correctly aligned to the main bar lines:
 
+@lilypond[quote,relative=2,verbatim]
+\defineBarLine ":|.-wrong" #'(":|." "" "|.")
+\defineBarLine ":|.-right" #'(":|." "" " |.")
+
+\new StaffGroup <<
+  \new Staff {
+    c1 \bar ":|.-wrong"
+    c1 \bar ":|.-right"
+    c1
+  }
+  \new Staff {
+    c1
+    c1
+    c1
+  }
+>>
+@end lilypond
+
+If additional elements are needed, LilyPond provides a simple
+way to define them.  For more informations on modifying or adding
+bar lines, see file @file{scm/bar-line.scm}.
 
 In scores with many staves, a @code{\bar} command in one staff is
 automatically applied to all staves.  The resulting bar lines are
@@ -2744,8 +2917,6 @@ connected between different staves of a @code{StaffGroup},
 @cindex default bar lines, changing
 @cindex bar lines, default, changing
 
-@snippets
-
 @funindex whichBar
 @funindex defaultBarType
 @funindex \bar
@@ -2766,6 +2937,9 @@ Notation Reference:
 @ref{Repeats},
 @ref{Grouping staves}.
 
+Installed Files:
+@file{scm/bar-line.scm}.
+
 Snippets:
 @rlsr{Rhythms}.
 
@@ -2814,7 +2988,7 @@ line visible}, @code{beginning of line visible}.  In the following
 example bar numbers are printed at all possible places:
 
 @lilypond[verbatim,quote,relative=1]
-\override Score.BarNumber #'break-visibility = #'#(#t #t #t)
+\override Score.BarNumber.break-visibility = ##(#t #t #t)
 \set Score.currentBarNumber = #11
 % Permit first bar number to be printed
 \bar ""
@@ -2910,18 +3084,18 @@ warning to focus on the source of the timing error.
 
 
 @funindex |
-@funindex pipeSymbol
+@funindex "|"
 
 It is also possible to redefine the action taken when a bar check
 or pipe symbol, @code{|}, is encountered in the input, so that
 it does something other than a bar check.  This is done by
-assigning a music expression to @code{pipeSymbol}.
+assigning a music expression to @code{"|"}.
 In the following example @code{|} is set to insert a double bar
 line wherever it appears in the input, rather than checking
 for end of bar.
 
 @lilypond[quote,verbatim]
-pipeSymbol = \bar "||"
+"|" = \bar "||"
 {
   c'2 c' |
   c'2 c'
@@ -3140,7 +3314,7 @@ up no additional logical time in a measure.
 
 @lilypond[quote,relative=2,verbatim]
 c4 \grace b16 a4(
-\grace { b16[ c16] } a2)
+\grace { b16 c16 } a2)
 @end lilypond
 
 There are three other types of grace notes possible; the
@@ -3155,7 +3329,7 @@ between notes that are slurred themselves, using the
 @lilypond[quote,relative=2,verbatim]
 \acciaccatura d8 c4
 \appoggiatura e8 d4
-\acciaccatura { g16[ f] } e2
+\acciaccatura { g16 f } e2
 \slashedGrace a,8 g4
 \slashedGrace b16 a4(
 \slashedGrace b8 a2)
@@ -3167,8 +3341,8 @@ eighth grace note
 
 @lilypond[quote,relative=2,verbatim]
 <<
-  \new Staff { e2 \grace { c16[ d e f] } e2 }
-  \new Staff { c2 \grace { g8[ b] } c2 }
+  \new Staff { e2 \grace { c16 d e f } e2 }
+  \new Staff { c2 \grace { g8 b } c2 }
 >>
 @end lilypond
 
@@ -3215,7 +3389,7 @@ note after a space lasting 7/8 of the main note.
 \new Voice {
   <<
     { d1^\trill_( }
-    { s2 s4. \grace { c16[ d] } }
+    { s2 s4. \grace { c16 d } }
   >>
   c1)
 }
@@ -3281,6 +3455,7 @@ Snippets:
 Internals Reference:
 @rinternals{GraceMusic},
 @rinternals{Grace_beam_engraver},
+@rinternals{Grace_auto_beam_engraver},
 @rinternals{Grace_engraver},
 @rinternals{Grace_spacing_engraver}.
 
@@ -3303,8 +3478,8 @@ staves without, for example,
 
 @lilypond[quote,relative=2,verbatim]
 <<
-  \new Staff { e4 \bar "|:" \grace c16 d2. }
-  \new Staff { c4 \bar "|:" d2. }
+  \new Staff { e4 \bar ".|:" \grace c16 d2. }
+  \new Staff { c4 \bar ".|:" d2. }
 >>
 @end lilypond
 
@@ -3314,11 +3489,17 @@ durations in the other staves.  For the above example
 
 @lilypond[quote,relative=2,verbatim]
 <<
-  \new Staff { e4 \bar "|:" \grace c16 d2. }
-  \new Staff { c4 \bar "|:" \grace s16 d2. }
+  \new Staff { e4 \bar ".|:" \grace c16 d2. }
+  \new Staff { c4 \bar ".|:" \grace s16 d2. }
 >>
 @end lilypond
 
+Please make sure that you use the @code{\grace} command for the
+spacer part, even if the visual part uses @code{\acciaccatura} or
+@code{\appoggiatura} because otherwise an ugly slur fragment will
+be printed, connecting the invisible grace note with the following
+note.
+
 The use of grace notes within voice contexts confuses the way the voice
 is typeset. This can be overcome by inserting a rest or note between the
 voice command and the grace note.
@@ -3357,19 +3538,19 @@ error will be generated.  Either make the grace notes shorter in
 duration, for example:
 
 @example
-\acciaccatura @{ c'8[ d' e' f' g'] @}
+c'8 \acciaccatura @{ c'8[ d' e' f' g'] @}
 @end example
 
 becomes:
 
 @example
-\acciaccatura @{ c'16[ d' e' f' g'] @}
+c'8 \acciaccatura @{ c'16[ d' e' f' g'] @}
 @end example
 
 Or explicitly change the musical duration:
 
 @example
-\acciaccatura @{ \scaleDurations 1/2 @{ c'8[ d' e' f' g'] @} @}
+c'8 \acciaccatura @{ \scaleDurations 1/2 @{ c'8[ d' e' f' g'] @} @}
 @end example
 
 See @ref{Scaling durations}.
@@ -3479,11 +3660,11 @@ The next bar line then falls at 9/8 rather than 5/4.
 
 @lilypond[quote,verbatim]
 \new Voice \relative c' {
-  \set Timing.measureLength = #(ly:make-moment 5 4)
+  \set Timing.measureLength = #(ly:make-moment 5/4)
   c1 c4 |
   c1 c4 |
   c4 c
-  \set Timing.measurePosition = #(ly:make-moment 5 8)
+  \set Timing.measurePosition = #(ly:make-moment 5/8)
   b4 b b8 |
   c4 c1 |
 }