From d8a3de81ac93647ee5bf079caf6f2fe418203250 Mon Sep 17 00:00:00 2001 From: David Nalesnik Date: Thu, 17 Oct 2013 18:16:19 -0500 Subject: [PATCH] Issue 3458: Document \alterBroken --- .../notation/changing-defaults.itely | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/Documentation/notation/changing-defaults.itely b/Documentation/notation/changing-defaults.itely index f91cb0d223..6174456582 100644 --- a/Documentation/notation/changing-defaults.itely +++ b/Documentation/notation/changing-defaults.itely @@ -3663,6 +3663,7 @@ appearance of the printed score. * Vertical grouping of grobs:: * Modifying stencils:: * Modifying shapes:: +* Modifying broken spanners:: * Unpure-pure containers:: @end menu @@ -4316,6 +4317,112 @@ Internals Reference: @rinternals{TieColumn}. +@node Modifying broken spanners +@subsection Modifying broken spanners + +@menu +* Using alterBroken:: +@end menu + +@node Using alterBroken +@unnumberedsubsubsec Using @code{\alterBroken} + +@cindex spanners, modifying +@cindex broken spanners, modifying +@funindex \alterBroken + +When a spanner crosses a line break or breaks, each piece +inherits the attributes of the original spanner. Thus, ordinary +tweaking of a broken spanner applies the same modifications to +each of its segments. In the example below, overriding +@code{thickness} affects the slur on either side of the line +break. + +@lilypond[verbatim,quote,ragged-right,relative=2] +r2 +\once\override Slur.thickness = 10 +c8( d e f +\break +g8 f e d) r2 +@end lilypond + +Independently modifying the appearance of individual pieces +of a broken spanner is possible with the @code{\alterBroken} +command. This command can produce either an @code{\override} +or a @code{\tweak} of a spanner property. + +The syntax for @code{\alterBroken} is + +@example +[-]@code{\alterBroken} @var{property} @var{values} @var{item} +@end example + +The argument @var{values} is a list of values, one for each +broken piece. If @var{item} is a grob name like @code{Slur} or +@code{Staff.PianoPedalBracket}, the result is an @code{\override} +of the specified grob type. If @var{item} is a music expression +such as @qq{(} or @qq{[} the result is the same music expression +with an appropriate tweak applied. + +The leading hyphen must be used with the @code{\tweak} form. Do +not add it when @code{\alterBroken} is used as an +@code{\override}. + +In its @code{\override} usage, @code{\alterBroken} may be +prefaced by @code{\once} or @code{\temporary} and reverted by +using @code{\revert} with @var{property}. + +The following code applies an independent @code{\override} to +each of the slur segments in the previous example: + +@lilypond[verbatim,quote,ragged-right,relative=2] +r2 +\alterBroken thickness #'(10 1) Slur +c8( d e f +\break +g8 f e d) r2 +@end lilypond + +The @code{\alterBroken} command may be used with any spanner +object, including @code{Tie}, @code{PhrasingSlur}, @code{Beam} +and @code{TextSpanner}. For example, an editor preparing a +scholarly edition may wish to indicate the absence of part of a +phrasing slur in a source by dashing only the segment which has +been added. The following example illustrates how this can be +done, in this case using the @code{\tweak} form of the command: + +@lilypond[verbatim,quote,ragged-right,relative=2] +% The empty list is conveniently used below, because it is the +% default setting of dash-definition, resulting in a solid curve. +c2-\alterBroken dash-definition #'(() ((0 1.0 0.4 0.75))) \(e +\break +g2 e\) +@end lilypond + +It is important to understand that @code{\alterBroken} will set +each piece of a broken spanner to the corresponding value in +@var{values}. When there are fewer values than pieces, any +additional piece will be assigned the empty list. This may lead +to undesired results if the layout property is not set to the +empty list by default. In such cases, each segment should be +assigned an appropriate value. + +@knownissues +Line breaks may occur in different places following changes in +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}. + +@seealso +Extending LilyPond: +@rextend{Difficult tweaks}. + + @node Unpure-pure containers @subsection Unpure-pure containers -- 2.39.2