| [ << Useful concepts and properties ] | [Top][Contents][Index] | [ Markup commands >> ] |
| [ < Line styles ] | [ Up: Useful concepts and properties ] | [ Visibility of objects > ] |
36.6 Line spanners
Some performance indications, e.g., rallentando and accelerando and trills are written as text and are extended over many measures with lines, sometimes dotted or wavy.
The locations of the two end points of the spanner are computed on
the fly, but it is possible to override their Y-coordinates. The
properties that need to be specified are nested two levels down
within the property hierarchy, but the syntax of the
\override command is quite simple:
e''2 \glissando b' \once \override Glissando.bound-details.left.Y = 3 \once \override Glissando.bound-details.right.Y = -2 e''2 \glissando b'![]()
The units for the Y property are staff spaces,
with the center line of the staff being the zero point.
For the glissando, this is the value for Y at the
X-coordinate corresponding to the center point of each note head,
if the line is imagined to be extended to there.
If Y is not set, the value is computed from the vertical
position of the corresponding attachment point of the spanner.
In case of a line break, the values for the end points are
specified by the left-broken and right-broken
sublists of bound-details. For example:
\override Glissando.bound-details.right-broken.Y = -3 c''1 \glissando \break f''1![]()
A number of further properties of the left and
right sublists of the bound-details property
may be modified in the same way as Y:
YThis sets the Y-coordinate of the end point, measured in staff spaces from the staff center line. By default, it is the center of the bound object, so a glissando points to the vertical center of the note head.
For horizontal spanners, such as text spanners and trill spanners, it is hard-coded to 0.
attach-dirThis determines where the line starts and ends in the X-direction, relative to the bound object. So, a value of
-1(orLEFT) makes the line start/end at the left side of the note head it is attached to.XThis is the absolute X-coordinate of the end point. It is usually computed on the fly, and overriding it has little useful effect.
stencilLine spanners may have symbols at the beginning or end, which is contained in this subproperty. This is for internal use; it is recommended that
textbe used instead.text¶-
This is a markup that is evaluated to yield the stencil. It is used to put cresc., tr, and other text on horizontal spanners.
\override TextSpanner.bound-details.left.text = \markup { \small \bold Slower } \relative { c''2\startTextSpan b c a\stopTextSpan }
stencil-align-dir-ystencil-offsetWithout setting one of these, the stencil is simply put at the end point, centered on the line, as defined by the
XandYsubproperties. Setting eitherstencil-align-dir-yorstencil-offsetwill move the symbol at the edge vertically relative to the end point of the line:\override TextSpanner.bound-details .left.stencil-align-dir-y = -2 \override TextSpanner.bound-details .right.stencil-align-dir-y = #UP \override TextSpanner.bound-details.left.text = "ggg" \override TextSpanner.bound-details.right.text = "hhh" \relative { c'4^\startTextSpan c c c \stopTextSpan }
Note that negative values move the text up, contrary to the effect that might be expected, as a value of
-1orDOWNmeans align the bottom edge of the text with the spanner line. A value of1orUPaligns the top edge of the text with the spanner line.arrowSetting this subproperty to
#tproduces an arrowhead at the end points of the line.paddingThis subproperty controls the space between the specified end point of the line and the actual end. Without padding, a glissando would start and end in the center of each note head.
The music function \endSpanners prematurely terminates all
spanners in its argument, obeying the to-barline property if set.
\relative c'' { \endSpanners c1 \> c \endSpanners { r4 c2.\< c1\startTextSpan } c1 c }![]()
When using \endSpanners it is not necessary to close
\startTextSpan with \stopTextSpan, nor is it
necessary to close hairpins with \!.
See also
Internals Reference: TextSpanner, Glissando, VoiceFollower, TrillSpanner, line-spanner-interface.
| [Top][Contents][Index] |
![[image of music]](../7a/lily-26254e70.png)
![[image of music]](../f4/lily-4671f591.png)
![[image of music]](../e2/lily-01a17368.png)