]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/notation/changing-defaults.itely
Issue 4422/7: Documentation fixes and Changelog
[lilypond.git] / Documentation / notation / changing-defaults.itely
index dd6e72cadc62fefed5fb9886e2119eb63545c60d..6b9c7410f5d3d23fc51cde33c77ceb56cb076844 100644 (file)
@@ -8,7 +8,7 @@
     Guide, node Updating translation committishes..
 @end ignore
 
-@c \version "2.19.2"
+@c \version "2.19.22"
 
 @node Changing defaults
 @chapter Changing defaults
@@ -428,13 +428,13 @@ from the musical content.  Either of these two forms is valid:
 
     % musical content
     \context Voice = "one" {
-      \relative c'' {
-        c4 c c c
+      \relative {
+        c''4 c c c
       }
     }
     \context Voice = "two" {
-      \relative c'' {
-        g8 g g4 g g
+      \relative {
+        g'8 g g4 g g
       }
     }
   >>
@@ -456,13 +456,13 @@ from the musical content.  Either of these two forms is valid:
 
     % musical content
     \context Voice = "one" {
-      \relative c'' {
-        c4 c c c
+      \relative {
+        c''4 c c c
       }
     }
     \context Voice = "two" {
-      \relative c'' {
-        g8 g g4 g g
+      \relative {
+        g'8 g g4 g g
       }
     }
   >>
@@ -483,8 +483,8 @@ is used to set the context in which a Scheme procedure specified with
 @code{\applyContext} is executed:
 
 @example
-\new Staff \relative c' @{
-  c1
+\new Staff \relative @{
+  c'1
   \context Timing
   \applyContext #(lambda (ctx)
                    (newline)
@@ -562,8 +562,8 @@ In the following example, both voice A and voice B are kept alive
 in this way for the duration of the piece:
 
 @lilypond[quote,verbatim]
-musicA = \relative c'' { d4 d d d }
-musicB = \relative c'' { g4 g g g }
+musicA = \relative { d''4 d d d }
+musicB = \relative { g'4 g g g }
 keepVoicesAlive = {
   <<
     \new Voice = "A" { s1*5 }  % Keep Voice "A" alive for 5 bars
@@ -601,8 +601,8 @@ melody and accompaniment would consist of several different
 sections, of course.
 
 @lilypond[quote,verbatim]
-melody = \relative c'' { a4 a a a }
-accompaniment = \relative c' { d4 d d d }
+melody = \relative { a'4 a a a }
+accompaniment = \relative { d'4 d d d }
 words = \lyricmode { These words fol -- low the mel -- o -- dy }
 \score {
   <<
@@ -640,14 +640,14 @@ to keep the melody line alive by simply including spacer notes to
 line it up correctly with the accompaniment:
 
 @lilypond[quote,verbatim]
-melody = \relative c'' {
+melody = \relative {
   s1  % skip a bar
-  a4 a a a
+  a'4 a a a
   s1  % skip a bar
   a4 a a a
 }
-accompaniment = \relative c' {
-  d4 d d d
+accompaniment = \relative {
+  d'4 d d d
   d4 d d d
   d4 d d d
   d4 d d d
@@ -756,7 +756,7 @@ within the measure, etc.  By moving these engraver from @code{Score} to
 time signature.
 
 @cindex polymetric scores
-@cindex Time signatures, multiple
+@cindex time signature, multiple
 
 @lilypond[quote,verbatim]
 \score {
@@ -765,17 +765,17 @@ time signature.
       \consists "Timing_translator"
       \consists "Default_bar_line_engraver"
     }
-    \relative c'' {
+    \relative {
         \time 3/4
-        c4 c c c c c
+        c''4 c c c c c
     }
   \new Staff \with {
     \consists "Timing_translator"
     \consists "Default_bar_line_engraver"
   }
-  \relative c'' {
+  \relative {
       \time 2/4
-      c4 c c c c c
+      c''4 c c c c c
   }
 >>
 \layout {
@@ -882,8 +882,8 @@ An @code{\override} command, but with the context name omitted
 
 @lilypond[quote,verbatim]
 \score {
-  \relative c'' {
-    a4^"Thicker stems" a a a
+  \relative {
+    a'4^"Thicker stems" a a a
     a4 a a\ff a
   }
   \layout {
@@ -900,8 +900,8 @@ Directly setting a context property
 
 @lilypond[quote,verbatim]
 \score {
-  \relative c'' {
-    a4^"Smaller font" a a a
+  \relative {
+    a'4^"Smaller font" a a a
     a4 a a\ff a
   }
   \layout {
@@ -919,8 +919,8 @@ expression like @code{\accidentalStyle dodecaphonic}
 
 @lilypond[quote,verbatim]
 \score {
-  \relative c'' {
-    a4^"Dynamics above" a a a
+  \relative {
+    a'4^"Dynamics above" a a a
     a4 a a\ff a
   }
   \layout {
@@ -948,8 +948,8 @@ StaffDefaults = \with {
 
 \score {
   \new Staff {
-    \relative c'' {
-      a4^"Smaller font" a a a
+    \relative {
+      a'4^"Smaller font" a a a
       a4 a a a
     }
   }
@@ -976,8 +976,8 @@ the same command written in the music stream.
 @lilypond[quote,verbatim]
 \score {
   \new Staff {
-    \relative c'' {
-      a4^"Smaller font" a a a
+    \relative {
+      a'4^"Smaller font" a a a
       a4 a a a
     }
   }
@@ -1025,8 +1025,8 @@ An @code{\override} command, but with the context name omitted
   \new Staff {
     \new Voice \with { \override Stem.thickness = #4.0 }
     {
-      \relative c'' {
-        a4^"Thick stems" a a a
+      \relative {
+        a'4^"Thick stems" a a a
         a4 a a a
       }
     }
@@ -1041,15 +1041,15 @@ Directly setting a context property
 \score {
   <<
     \new Staff {
-      \relative c'' {
-        a4^"Default font" a a a
+      \relative {
+        a'4^"Default font" a a a
         a4 a a a
       }
     }
     \new Staff \with { fontSize = #-4 }
     {
-      \relative c'' {
-        a4^"Smaller font" a a a
+      \relative {
+        a'4^"Smaller font" a a a
         a4 a a a
       }
     }
@@ -1065,8 +1065,8 @@ A predefined command such as @code{\dynamicUp}
   <<
     \new Staff {
       \new Voice {
-        \relative c'' {
-          a4^"Dynamics below" a a a
+        \relative {
+          a'4^"Dynamics below" a a a
           a4 a a\ff a
         }
       }
@@ -1075,8 +1075,8 @@ A predefined command such as @code{\dynamicUp}
     {
       \new Voice \with { \dynamicUp }
       {
-        \relative c'' {
-          a4^"Dynamics above" a a a
+        \relative {
+          a'4^"Dynamics above" a a a
           a4 a a\ff a
         }
       }
@@ -1168,8 +1168,8 @@ to indicate improvisation in jazz pieces,
   \accepts "ImproVoice"
 }}
 
-\relative c'' {
-  a4 d8 bes8 \new ImproVoice { c4^"ad lib" c
+\relative {
+  a'4 d8 bes8 \new ImproVoice { c4^"ad lib" c
    c4 c^"undress" c_"while playing :)" c }
   a1
 }
@@ -1300,8 +1300,8 @@ Putting both into a @code{\layout} block, like
 Then the output at the start of this subsection can be entered as
 
 @example
-\relative c'' @{
-  a4 d8 bes8
+\relative @{
+  a'4 d8 bes8
   \new ImproVoice @{
     c4^"ad lib" c
     c4 c^"undress"
@@ -1318,7 +1318,6 @@ depends on the same context relations.
 @seealso
 
 Internals Reference:
-@rinternals{Engraver_group},
 @rinternals{Note_heads_engraver},
 @rinternals{Text_engraver},
 @rinternals{Rhythmic_column_engraver},
@@ -1472,8 +1471,6 @@ below:
 
 @lilypond[quote,relative=2,verbatim]
 c-2
-\stemUp
-f
 @end lilypond
 
 If you visit the documentation on fingering instructions (in
@@ -1690,8 +1687,6 @@ Recall that we wanted to change the position of the @b{2} in
 
 @lilypond[quote,relative=2,verbatim]
 c-2
-\stemUp
-f
 @end lilypond
 
 Since the @b{2} is vertically positioned next to its note, we have to
@@ -1734,8 +1729,6 @@ i.e., before @code{c2}, yields the following result:
 @lilypond[quote,relative=2,verbatim]
 \once \override Voice.Fingering.padding = #3
 c-2
-\stemUp
-f
 @end lilypond
 
 
@@ -1939,7 +1932,7 @@ the @code{#}@tie{}character.
 
 Contexts properties are usually named in
 @code{studlyCaps}.  They mostly control the translation from
-music to notation, e.g. @code{localKeySignature} (for determining
+music to notation, e.g. @code{localAlterations} (for determining
 whether to print accidentals), or @code{measurePosition} (for
 determining when to print a bar line).  Context properties can
 change value over time while interpreting a piece of music;
@@ -2573,7 +2566,7 @@ values.  Unless this is the intended result, it is safer to update
 key-values individually with a nested declaration.
 
 @warning{Nested declarations will not work for context property
-alists (such as @code{beamExceptions}, @code{keySignature},
+alists (such as @code{beamExceptions}, @code{keyAlterations},
 @code{timeSignatureSettings}, etc.).  These properties can only be
 modified by completely re-defining them as alists.}
 
@@ -2586,6 +2579,7 @@ modified by completely re-defining them as alists.}
 * Input modes::
 * Direction and placement::
 * Distances and measurements::
+* Dimensions::
 * Staff symbol properties::
 * Spanners::
 * Visibility of objects::
@@ -2599,7 +2593,7 @@ modified by completely re-defining them as alists.}
 The way in which the notation contained within an input file is
 interpreted is determined by the current input mode.
 
-@strong{Chord mode}
+@subsubsubheading Chord mode
 
 This is activated with the @code{\chordmode} command, and causes
 input to be interpreted with the syntax of chord notation, see
@@ -2611,7 +2605,7 @@ causes the following input to be interpreted with the syntax of
 chord notation and rendered as chord names in the @code{ChordNames}
 context, see @ref{Printing chord names}.
 
-@strong{Drum mode}
+@subsubsubheading Drum mode
 
 This is activated with the @code{\drummode} command, and causes
 input to be interpreted with the syntax of drum notation, see
@@ -2620,10 +2614,10 @@ input to be interpreted with the syntax of drum notation, see
 Drum mode is also activated with the @code{\drums} command.
 This also creates a new @code{DrumStaff} context and causes the
 following input to be interpreted with the syntax of drum notation
-and rendered as drum symbols on a drum staff, see @ref{Basic
-percussion notation}.
+and rendered as drum symbols on a drum staff, see
+@ref{Basic percussion notation}.
 
-@strong{Figure mode}
+@subsubsubheading Figure mode
 
 This is activated with the @code{\figuremode} command, and causes
 input to be interpreted with the syntax of figured bass, see
@@ -2635,7 +2629,7 @@ following input to be interpreted with the figured bass syntax
 and rendered as figured bass symbols in the @code{FiguredBass}
 context, see @ref{Introduction to figured bass}.
 
-@strong{Fret and tab modes}
+@subsubsubheading Fret and tab modes
 
 There are no special input modes for entering fret and tab symbols.
 
@@ -2649,7 +2643,7 @@ You can either use the @code{FretBoards} context (see
 above the notes using the @code{\fret-diagram} command (see
 @ref{Fret diagram markups}).
 
-@strong{Lyrics mode}
+@subsubsubheading Lyrics mode
 
 This is activated with the @code{\lyricmode} command, and causes
 input to be interpreted as lyric syllables with optional durations
@@ -2660,15 +2654,13 @@ This also creates a new @code{Lyrics} context and an implicit
 @code{\lyricsto} command which associates the following lyrics
 with the preceding music.
 
-@strong{Markup mode}
+@subsubsubheading Markup mode
 
 This is activated with the @code{\markup} command, and causes
 input to be interpreted with the syntax of markup, see
 @ref{Text markup commands}.
 
-@c silly work-around for texinfo broken-ness
-@c (@strong{Note...} causes a spurious cross-reference in Info)
-@b{Note mode}
+@subsubsubheading Note mode
 
 This is the default mode or it may be activated with the
 @code{\notemode} command.  Input is interpreted as pitches,
@@ -2679,23 +2671,6 @@ it may be useful to do so in certain situations, for example if you
 are in lyric mode, chord mode or any other mode and want to insert
 something that only can be done with note mode syntax.
 
-For example, to indicate dynamic markings for the verses of a
-choral pieces it is necessary to enter note mode to interpret
-the markings:
-
-@lilypond[verbatim,relative=2,quote]
-{ c4 c4 c4 c4 }
-\addlyrics {
-  \notemode{\set stanza = \markup{ \dynamic f 1. } }
-  To be sung loudly
-}
-\addlyrics {
-  \notemode{\set stanza = \markup{ \dynamic p 2. } }
-  To be sung quietly
-}
-@end lilypond
-
-
 
 @node Direction and placement
 @subsection Direction and placement
@@ -2864,6 +2839,35 @@ Notation Reference:
 @ref{Setting the staff size}.
 
 
+@node Dimensions
+@subsection Dimensions
+
+@cindex dimensions
+@cindex bounding box
+
+The dimensions of a graphical object specify the positions of the left
+and right edges and the bottom and top edges of the objects' bounding
+box as distances from the objects' reference point in units of
+staff-spaces.  These positions are usually coded as two Scheme pairs.
+For example, the text markup command @code{\with-dimensions} takes
+three arguments, the first two of which are a Scheme pair giving the
+left and right edge positions and a Scheme pair giving the bottom and
+top edge positions:
+
+@example
+\with-dimensions #'(-5 . 10) #'(-3 . 15) @var{arg}
+@end example
+
+This specifies a bounding box for @var{arg} with its left edge at -5,
+its right edge at 10, its bottom edge at -3 and its top edge at 15,
+all measured from the objects' reference point in units of
+staff-spaces.
+
+@seealso
+Notation Reference:
+@ref{Distances and measurements}.
+
+
 @node Staff symbol properties
 @subsection Staff symbol properties
 
 
 @lilypond[verbatim,quote,relative=2]
 a1
-\compressFullBarRests
-R1*23
-% increase the length of the rest bar
-\once \override MultiMeasureRest.minimum-length = #20
-R1*23
-a1
+\compressMMRests {
+  R1*23
+  % increase the length of the rest bar
+  \once \override MultiMeasureRest.minimum-length = #20
+  R1*23
+  a1
+}
 @end lilypond
 
 @lilypond[verbatim,quote,relative=2]
@@ -3066,7 +3071,7 @@ Objects which support the @code{line-spanner-interface} include
 @end itemize
 
 The routine responsible for drawing the stencils for these spanners is
-@code{ly:line-interface::print}.  This routine determines the
+@code{ly:line-spanner::print}.  This routine determines the
 exact location of the two end points and draws a line
 between them, in the style requested.  The locations of the two
 end points of the spanner are computed on-the-fly, but it is
@@ -3369,18 +3374,18 @@ by pre-defined functions, defined in @file{scm/output-lib.scm},
 where the last three columns indicate whether the layout objects
 will be visible in the positions shown at the head of the columns:
 
-@multitable {@code{begin-of-line-invisible}} {@code{'#(#t #t #t)}} {Before} {At no} {After}
-@headitem Function                   @tab Vector                  @tab Before @tab At no    @tab After
-@headitem form                       @tab form                    @tab break  @tab break    @tab break
-
-@item @code{all-visible}             @tab @code{'#(#t #t #t)}     @tab yes    @tab yes      @tab yes
-@item @code{begin-of-line-visible}   @tab @code{'#(#f #f #t)}     @tab no     @tab no       @tab yes
-@item @code{center-visible}          @tab @code{'#(#f #t #f)}     @tab no     @tab yes      @tab no
-@item @code{end-of-line-visible}     @tab @code{'#(#t #f #f)}     @tab yes    @tab no       @tab no
-@item @code{begin-of-line-invisible} @tab @code{'#(#t #t #f)}     @tab yes    @tab yes      @tab no
-@item @code{center-invisible}        @tab @code{'#(#t #f #t)}     @tab yes    @tab no       @tab yes
-@item @code{end-of-line-invisible}   @tab @code{'#(#f #t #t)}     @tab no     @tab yes      @tab yes
-@item @code{all-invisible}           @tab @code{'#(#f #f #f)}     @tab no     @tab no       @tab no
+@multitable {@code{begin-of-line-invisible}} {@code{#(#t #t #t)}} {Before} {At no} {After}
+@headitem Function                   @tab Vector                 @tab Before @tab At no    @tab After
+@headitem form                       @tab form                   @tab break  @tab break    @tab break
+
+@item @code{all-visible}             @tab @code{#(#t #t #t)}     @tab yes    @tab yes      @tab yes
+@item @code{begin-of-line-visible}   @tab @code{#(#f #f #t)}     @tab no     @tab no       @tab yes
+@item @code{center-visible}          @tab @code{#(#f #t #f)}     @tab no     @tab yes      @tab no
+@item @code{end-of-line-visible}     @tab @code{#(#t #f #f)}     @tab yes    @tab no       @tab no
+@item @code{begin-of-line-invisible} @tab @code{#(#t #t #f)}     @tab yes    @tab yes      @tab no
+@item @code{center-invisible}        @tab @code{#(#t #f #t)}     @tab yes    @tab no       @tab yes
+@item @code{end-of-line-invisible}   @tab @code{#(#f #t #t)}     @tab no     @tab yes      @tab yes
+@item @code{all-invisible}           @tab @code{#(#f #f #f)}     @tab no     @tab no       @tab no
 @end multitable
 
 The default settings of @code{break-visibility} depend on the
@@ -3600,7 +3605,7 @@ These all use the same routines as the glissando for drawing the
 texts and the lines, and tuning their behavior is therefore also
 done in the same way.  It is done with a spanner, and the routine
 responsible for drawing the spanners is
-@code{ly:line-interface::print}.  This routine determines the
+@code{ly:line-spanner::print}.  This routine determines the
 exact location of the two @i{span points} and draws a line
 between them, in the style requested.
 
@@ -4120,8 +4125,8 @@ XinO = {
       \musicglyph #"noteheads.s2cross"
   }
 }
-\relative c'' {
-  a a \XinO a a
+\relative {
+  a' a \XinO a a
 }
 @end lilypond
 
@@ -4568,9 +4573,12 @@ the accidentals.  In the second measure, with unpure-pure containers,
 the spacing engine knows the width of the note heads and avoids the
 collision by lengthening the line accordingly.
 
-Usually for simple calculations nearly-identical functions for both the
-@q{unpure} and @q{pure} parts can be used, by only changing the number
-of arguments passed to, and the scope of, the function.
+Usually for simple calculations nearly-identical functions for
+both the @q{unpure} and @q{pure} parts can be used, by only
+changing the number of arguments passed to, and the scope of, the
+function.  This use case is frequent enough that
+@code{ly:make-unpure-pure-container} constructs such a second
+function by default when called with only one function argument.
 
 @warning{If a function is labeled as @q{pure} and it turns out not to
 be, the results can be unexpected.}
@@ -4602,7 +4610,7 @@ code is easy.  The general form of these functions is
 @example
 function =
 #(define-music-function
-     (parser location @var{arg1} @var{arg2} @dots{})
+     (@var{arg1} @var{arg2} @dots{})
      (@var{type1?} @var{type2?} @dots{})
    #@{
      @var{@dots{}music@dots{}}
@@ -4628,13 +4636,8 @@ reference arguments
 (eg. @samp{#arg1}).
 @end multitable
 
-The @code{parser} and @code{location} arguments are mandatory, and
-are used in some advanced situations as described in the
-@q{Extending} manual (see @rextend{Music functions}).  For
-substitution functions, just be sure to include them.
-
-The list of type predicates is also required.  Some of the most
-common type predicates used in music functions are:
+The list of type predicates is required.  Some of the most common
+type predicates used in music functions are:
 
 @example
 boolean?
@@ -4680,14 +4683,14 @@ setting the padding of a TextScript:
 @lilypond[quote,verbatim,ragged-right]
 padText =
 #(define-music-function
-     (parser location padding)
+     (padding)
      (number?)
    #{
      \once \override TextScript.padding = #padding
    #})
 
-\relative c'' {
-  c4^"piu mosso" b a b
+\relative {
+  c''4^"piu mosso" b a b
   \padText #1.8
   c4^"piu mosso" b a b
   \padText #2.6
@@ -4701,7 +4704,7 @@ as notes for arguments to music functions:
 @lilypond[quote,verbatim,ragged-right]
 custosNote =
 #(define-music-function
-     (parser location note)
+     (note)
      (ly:music?)
    #{
      \tweak NoteHead.stencil #ly:text-interface::print
@@ -4711,7 +4714,7 @@ custosNote =
      #note
    #})
 
-\relative c' { c4 d e f \custosNote g }
+\relative { c'4 d e f \custosNote g }
 @end lilypond
 
 Substitution functions with multiple arguments can be defined:
@@ -4719,16 +4722,16 @@ Substitution functions with multiple arguments can be defined:
 @lilypond[quote,verbatim,ragged-right]
 tempoPadded =
 #(define-music-function
-     (parser location padding tempotext)
+     (padding tempotext)
      (number? markup?)
    #{
      \once \override Score.MetronomeMark.padding = #padding
      \tempo \markup { \bold #tempotext }
    #})
 
-\relative c'' {
+\relative {
   \tempo \markup { "Low tempo" }
-  c4 d e f g1
+  c''4 d e f g1
   \tempoPadded #4.0 "High tempo"
   g4 f e d c1
 }