]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/notation/changing-defaults.itely
Doc: Issue 5032: Using \with with \chords, \drums and \figures
[lilypond.git] / Documentation / notation / changing-defaults.itely
index b79b69100dba3330e58f331d332229b52e0a16d0..8457f6dba0aaa65b2739ec73e5b2b489773c716d 100644 (file)
@@ -522,8 +522,8 @@ Notation Reference:
 
 Contexts are usually terminated at the first musical moment in
 which they have nothing to do.  So @code{Voice} contexts die as
-soon as they contain no events; @code{Staff} contexts die as soon
-as all the @code{Voice} contexts within them contain no events; etc.
+soon as they contain no events, @code{Staff} contexts die as soon
+as all the @code{Voice} contexts within them contain no events, etc.
 This can cause difficulties if earlier contexts which have died
 have to be referenced, for example, when changing staves with
 @code{\change} commands, associating lyrics with a voice with
@@ -1005,8 +1005,26 @@ command:
 @}
 @end example
 
-Since such a @q{context modification} is specified inside of
-music, it will affect @emph{all} outputs (typesetting @emph{and}
+Alternatively, if the music is being entered using the short form of the
+input mode-specifying commands, e.g. @code{\chords} rather than
+@code{\chordmode}, the @code{\with} command must be placed immediately
+after the mode-specifying command:
+
+@example
+\chords \with @{ [context settings for this (implicit) context instance only] @}
+@{
+  @dots{}
+@}
+@end example
+
+@noindent
+as it is the implicit context created by these short forms which should
+be modified.  The same consideration applies to the other input
+mode-specifying short forms (@code{\drums}, @code{\figures}), see
+@ref{Input modes}.
+
+Since context modifications specified in @code{\with} blocks are inside
+music, they will affect @emph{all} outputs (typesetting @emph{and}
 Midi) as opposed to changes within an output definition.
 
 The following types of settings may be specified:
@@ -1082,6 +1100,10 @@ A predefined command such as @code{\dynamicUp}
 
 @end itemize
 
+@seealso
+Notation Reference:
+@ref{Input modes}
+
 @node Order of precedence
 @unnumberedsubsubsec Order of precedence
 
@@ -1125,17 +1147,11 @@ Notation Reference:
 @cindex engravers, including in contexts
 
 @funindex \alias
-@funindex alias
 @funindex \name
-@funindex name
 @funindex \type
-@funindex type
 @funindex \consists
-@funindex consists
 @funindex \accepts
-@funindex accepts
 @funindex \denies
-@funindex denies
 
 Specific contexts, like @code{Staff} and @code{Voice}, are made from
 simple building blocks.  It is possible to create new types of
@@ -1440,7 +1456,7 @@ existing contexts.  To reposition it above the context called
 @qq{main}, it should be defined like this:
 
 @example
-@code{\new Staff \with @{ alignAboveContext = #"main" @} }
+\new Staff \with @{ alignAboveContext = #"main" @}
 @end example
 
 A similar situation arises when positioning a temporary lyrics
@@ -1958,7 +1974,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{localAlterations} (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;
@@ -2442,7 +2458,7 @@ a context will still show the values of their respective parent's
 context.
 
 The lifetime and value of a context property is dynamic and only
-available when music is being interpreted (i.e. @q{iterated}).  At the
+available when music is being interpreted (i.e., @q{iterated}).  At the
 time of the context's creation, properties are initialized from its
 corresponding definitions (along with any other modifications) of that
 context.  Any subsequent changes are achieved with any
@@ -2473,7 +2489,7 @@ own grob definition.
 
 Grob definitions are accessed with a different set of commands and are
 manipulated using @code{\override} and @code{\revert} and have a name
-starting with a capital letter (e.g. @samp{NoteHead}); whereas normal
+starting with a capital letter (e.g., @samp{NoteHead}); whereas normal
 context properties are manipulated using @code{\set} and @code{\unset}
 and are named starting with a lowercase letter.
 
@@ -2721,7 +2737,7 @@ be desirable to force a particular direction or placement.
 @node Articulation direction indicators
 @unnumberedsubsubsec Articulation direction indicators
 
-By default some directions are always up or always down (e.g.
+By default some directions are always up or always down (e.g.,
 dynamics or fermata), while other things can alternate between
 up or down based on the stem direction (like slurs or accents).
 
@@ -2738,9 +2754,9 @@ but a direction indicator is @strong{always} required before
 @item @code{\tweak} commands
 @item @code{\markup} commands
 @item @code{\tag} commands
-@item string markups, e.g. -"string"
-@item fingering instructions, e.g. @w{@code{-1}}
-@item articulation shortcuts, e.g. @w{@code{-.}}, @w{@code{->}}, @w{@code{--}}
+@item string markups, e.g., -"string"
+@item fingering instructions, e.g., @w{@code{-1}}
+@item articulation shortcuts, e.g., @w{@code{-.}}, @w{@code{->}}, @w{@code{--}}
 @end itemize
 
 Direction indicators affect only the next note:
@@ -2770,7 +2786,7 @@ Alternatively, in many cases predefined commands exist to specify the
 direction.  These are of the form
 
 @example
-@code{\xxxUp}, @code{\xxxDown} or @code{\xxxNeutral}
+\xxxUp, \xxxDown or \xxxNeutral
 @end example
 
 @noindent
@@ -3511,7 +3527,7 @@ to print them and @code{all-invisible} to suppress them.
 
 The @code{break-visibility} property controls the visibility of
 key signatures and changes of clef only at the start of lines,
-i.e. after a break.  It has no effect on the visibility of the
+i.e., after a break.  It has no effect on the visibility of the
 key signature or clef following an explicit key change or an
 explicit clef change within or at the end of a line.  In the
 following example the key signature following the explicit change
@@ -4152,7 +4168,7 @@ The VerticalAlignment and VerticalAxisGroup grobs work together.
 VerticalAxisGroup groups together different grobs like Staff, Lyrics,
 etc.  VerticalAlignment then vertically aligns the different grobs
 grouped together by VerticalAxisGroup.  There is usually only one
-VerticalAlignment per score but every Staff, Lyrics, etc. has its own
+VerticalAlignment per score but every Staff, Lyrics, etc., has its own
 VerticalAxisGroup.
 
 
@@ -4287,7 +4303,7 @@ the collisions to be avoided.
 The syntax of @code{\shape} is
 
 @example
-[-]@code{\shape} @var{displacements} @var{item}
+[-]\shape @var{displacements} @var{item}
 @end example
 
 This will reposition the control-points of @var{item} by the amounts
@@ -4489,7 +4505,7 @@ or a @code{\tweak} of a spanner property.
 The syntax for @code{\alterBroken} is
 
 @example
-[-]@code{\alterBroken} @var{property} @var{values} @var{item}
+[-]\alterBroken @var{property} @var{values} @var{item}
 @end example
 
 The argument @var{values} is a list of values, one for each
@@ -4552,7 +4568,7 @@ layout. Settings chosen for @code{\alterBroken} may be unsuitable
 for a spanner that is no longer broken or is split into more
 segments than before.  Explicit use of @code{\break} can guard
 against this situation.
+
 The @code{\alterBroken} command is ineffective for spanner
 properties accessed before line-breaking such as
 @code{direction}.
@@ -4573,7 +4589,7 @@ Extending LilyPond:
 
 Unpure-pure containers are useful for overriding @emph{Y-axis} spacing
 calculations - specifically @code{Y-offset} and @code{Y-extent} - with a
-Scheme function instead of a literal (i.e. a number or pair).
+Scheme function instead of a literal (i.e., a number or pair).
 
 For certain grobs, the @code{Y-extent} is based on the @code{stencil}
 property, overriding the stencil property of one of these will
@@ -4718,7 +4734,7 @@ must return @code{#t}.
 
 @item @code{@var{@dots{}music@dots{}}}
 @tab normal LilyPond input, using @code{$} (in places where only
-Lilypond constructs are allowed) or @code{#} (to use it as a Scheme
+LilyPond constructs are allowed) or @code{#} (to use it as a Scheme
 value or music function argument or music inside of music lists) to
 reference arguments
 (eg. @samp{#arg1}).
@@ -4749,7 +4765,7 @@ are also allowed.
 Notation Reference:
 @ref{Predefined type predicates}.
 
-Extending Lilypond:
+Extending LilyPond:
 @rextend{Music functions}.
 
 Installed Files: