Guide, node Updating translation committishes..
@end ignore
-@c \version "2.15.39"
+@c \version "2.17.6"
@node Changing defaults
@chapter Changing defaults
@knownissues
-Usually the order in which the engravers are specified
-does not matter, but in a few special cases the order
-is important, for example where one engraver writes
-a property and another reads it, or where one engraver
-creates a grob and another must process it. The order in
-which the engravers are specified is the order in which
-they are called to carry out their processing.
+The order in which the engravers are specified is the order in
+which they are called to carry out their processing. Usually the
+order in which the engravers are specified does not matter, but in
+a few special cases the order is important, for example where one
+engraver writes a property and another reads it, or where one
+engraver creates a grob and another must process it.
+
+The following orderings are important:
+
+@itemize
+@item
+the @code{Bar_engraver} must normally be first,
+
+@item
+the @code{New_fingering_engraver} must come before the
+@code{Script_column_engraver},
+
+@item
+the @code{Timing_translator} must come before the
+@code{Bar_number_engraver}.
+
+@end itemize
+
+@seealso
+Installed Files:
+@file{ly/engraver-init.ly}.
-The following orderings are important: the
-@code{Bar_engraver} must normally be first, and
-the @code{New_fingering_engraver} must come before
-the @code{Script_column_engraver}. There may be others
-with ordering dependencies.
@node Changing context default settings
@subsection Changing context default settings
\layout {
\context {
\Staff
- \override Stem #'thickness = #4.0
+ \override Stem.thickness = #4.0
}
}
}
@item
A predefined command such as @code{\dynamicUp} or a music
-expression like @code{\accidentalStyle "dodecaphonic"}
+expression like @code{\accidentalStyle dodecaphonic}
@lilypond[quote,verbatim]
\score {
}
\context {
\Staff
- \accidentalStyle "dodecaphonic"
+ \accidentalStyle dodecaphonic
}
}
}
}
}
\layout {
- \accidentalStyle "dodecaphonic"
+ \accidentalStyle dodecaphonic
\set fontSize = #-4
- \override Voice.Stem #'thickness = #4.0
+ \override Voice.Stem.thickness = #4.0
}
}
@end lilypond
\new Staff {
\new Voice
\with {
- \override Stem #'thickness = #4.0
+ \override Stem.thickness = #4.0
}
{
\relative c'' {
}
}
\new Staff
- \with { \accidentalStyle "dodecaphonic" }
+ \with { \accidentalStyle dodecaphonic }
{
\new Voice
\with { \dynamicUp }
\consists "Note_heads_engraver"
\consists "Rhythmic_column_engraver"
\consists "Text_engraver"
- \consists Pitch_squash_engraver
+ \consists "Pitch_squash_engraver"
squashedPosition = #0
- \override NoteHead #'style = #'slash
- \override Stem #'transparent = ##t
- \override Flag #'transparent = ##t
+ \override NoteHead.style = #'slash
+ \override Stem.transparent = ##t
+ \override Flag.transparent = ##t
\alias Voice
}
\context { \Staff
the engravers which provide this functionality,
@example
-\consists Note_heads_engraver
-\consists Text_engraver
+\consists "Note_heads_engraver"
+\consists "Text_engraver"
@end example
but we only need this on the center line,
@example
-\consists Pitch_squash_engraver
+\consists "Pitch_squash_engraver"
squashedPosition = #0
@end example
The notes look like a slash, and have no stem,
@example
-\override NoteHead #'style = #'slash
-\override Stem #'transparent = ##t
-\override Flag #'transparent = ##t
+\override NoteHead.style = #'slash
+\override Stem.transparent = ##t
+\override Flag.transparent = ##t
@end example
All these plug-ins have to cooperate, and this is achieved with a
\type "Engraver_group"
\consists "Note_heads_engraver"
\consists "Text_engraver"
- \consists Pitch_squash_engraver
+ \consists "Pitch_squash_engraver"
squashedPosition = #0
- \override NoteHead #'style = #'slash
- \override Stem #'transparent = ##t
- \override Flag #'transparent = ##t
+ \override NoteHead.style = #'slash
+ \override Stem.transparent = ##t
+ \override Flag.transparent = ##t
\alias Voice
@}
@end example
3 staff spaces of white
between the note and the fingering:
@example
-\once \override Voice.Fingering #'padding = #3
+\once \override Voice.Fingering.padding = #3
@end example
Inserting this command before the Fingering object is created,
i.e., before @code{c2}, yields the following result:
@lilypond[quote,relative=2,verbatim]
-\once \override Voice.Fingering #'padding = #3
+\once \override Voice.Fingering.padding = #3
c-2
\stemUp
f
The command
@verbatim
-\override Staff.Stem #'thickness = #4.0
+\override Staff.Stem.thickness = #4.0
@end verbatim
@noindent
@lilypond[quote,verbatim,relative=2]
c4
-\override Staff.Stem #'thickness = #4.0
+\override Staff.Stem.thickness = #4.0
c4
c4
c4
@lilypond[quote,verbatim,relative=2]
c4
-\once \override Stem #'thickness = #4.0
+\once \override Stem.thickness = #4.0
c4
c4
@end lilypond
when the object is created. In this example,
@lilypond[quote,verbatim,relative=2]
-\override Slur #'thickness = #3.0
+\override Slur.thickness = #3.0
c8[( c
-\override Beam #'beam-thickness = #0.6
+\override Beam.beam-thickness = #0.6
c8 c])
@end lilypond
@code{\revert} in the next example does not do anything.
@example
-\override Voice.Stem #'thickness = #4.0
-\revert Staff.Stem #'thickness
+\override Voice.Stem.thickness = #4.0
+\revert Staff.Stem.thickness
@end example
Some tweakable options are called @q{subproperties} and reside inside
such as
@example
-\override Stem #'(details beamed-lengths) = #'(4 4 3)
+\override Stem.details.beamed-lengths = #'(4 4 3)
@end example
@end ignore
to see the settings for each grob description. Grob descriptions
are modified with @code{\override}.
-@code{\override} is actually a shorthand;
+The syntax for the @code{\override} command is
@example
-\override @var{context}.@var{GrobName} #'@var{property} = #@var{value}
+\override [@var{context}.]@var{GrobName}.@var{property} = #@var{value}
@end example
-@noindent
-is more or less equivalent to
-
-@c leave this long line -gp
-@example
-\set @var{context}.@var{GrobName} =
- #(cons (cons '@var{property} @var{value})
- <previous value of @var{context}.@var{GrobName}>)
-@end example
-
-The value of @code{context}.@code{GrobName} (the alist) is used to initialize
-the properties of individual grobs. Grobs have
-properties, named in Scheme style, with
-@code{dashed-words}. The values of grob properties change
-during the formatting process: formatting basically amounts
-to computing properties using callback functions.
-
For example, we can increase the thickness of a note stem by
overriding the @code{thickness} property of the @code{Stem}
object:
@lilypond[quote,verbatim,relative=2]
c4 c
-\override Voice.Stem #'thickness = #3.0
+\override Voice.Stem.thickness = #3.0
c4 c
@end lilypond
context is used:
@lilypond[quote,verbatim,relative=2]
-{ \override Staff.Stem #'thickness = #3.0
+{ \override Staff.Stem.thickness = #3.0
<<
{
e4 e
- \override Stem #'thickness = #0.5
+ \override Stem.thickness = #0.5
e4 e
} \\ {
c4 c c c
}
@end lilypond
+Some tweakable options are called @q{subproperties} and reside inside
+properties. To tweak those, use commands in the form
+
+@example
+\override Stem.details.beamed-lengths = #'(4 4 3)
+@end example
+
+or to modify the ends of spanners, use a form like these
+
+@example
+\override TextSpanner.bound-details.left.text = #"left text"
+\override TextSpanner.bound-details.right.text = #"right text"
+@end example
+
@funindex \revert
@cindex reverting overrides
@cindex overrides, reverting
-The effects of @code{\override} can be undone by @code{\revert}:
+The effects of @code{\override} can be undone by @code{\revert}.
+
+The syntax for the @code{\revert} command is
+
+@example
+\revert [@var{context}.]@var{GrobName}.@var{property}
+@end example
+
+For example,
@lilypond[quote,verbatim,relative=2]
c4
-\override Voice.Stem #'thickness = #3.0
+\override Voice.Stem.thickness = #3.0
c4 c
-\revert Voice.Stem #'thickness
+\revert Voice.Stem.thickness
c4
@end lilypond
<<
{
e4
- \override Staff.Stem #'thickness = #3.0
+ \override Staff.Stem.thickness = #3.0
e4 e e
} \\ {
c4 c c
- \revert Staff.Stem #'thickness
+ \revert Staff.Stem.thickness
c4
}
>>
{
<<
{
- \override Stem #'thickness = #3.0
+ \override Stem.thickness = #3.0
e4 e e e
} \\ {
c4
- \once \override Stem #'thickness = #3.0
+ \once \override Stem.thickness = #3.0
c4 c c
}
>>
Commands which change output generally look like
@example
-\override Voice.Stem #'thickness = #3.0
+\override Voice.Stem.thickness = #3.0
@end example
@noindent
@item a sensible value: here @code{3.0}.
@end itemize
-Some tweakable options are called @q{subproperties} and reside inside
-properties. To tweak those, use commands in the form
-
-@example
-\override Stem #'(details beamed-lengths) = #'(4 4 3)
-@end example
-
@cindex internal documentation
@cindex finding graphical objects
@cindex graphical object descriptions
syntax:
@example
-\tweak @var{layout-object} #'@var{grob-property} @var{value}
+\tweak [@var{layout-object}.]@var{grob-property} @var{value}
@end example
Specifying @var{layout-object} is optional.
@lilypond[relative=2,verbatim,quote]
< c
- \tweak #'color #red
+ \tweak color #red
d
g
- \tweak #'duration-log #1
+ \tweak duration-log #1
a
> 4
--\tweak #'padding #8
+-\tweak padding #8
-^
@end lilypond
-But the main use of the @code{\tweak} command is to modify just
+The main use of the @code{\tweak} command is to modify just
one of a number of notation elements which start at the same musical
moment, like the notes of a chord, or tuplet brackets which start
at the same time.
So, this works:
@lilypond[relative=2,verbatim,quote]
-<\tweak #'color #red c>4
+<\tweak color #red c>4
@end lilypond
@noindent
but this does not:
@lilypond[relative=2,verbatim,quote]
-\tweak #'color #red c4
+\tweak color #red c4
@end lilypond
@end ignore
@lilypond[relative=2,verbatim,quote]
< c
- \tweak #'color #red
+ \tweak color #red
d
g
- \tweak #'duration-log #1
+ \tweak duration-log #1
a
> 4
@end lilypond
@code{\tweak} can be used to modify slurs:
@lilypond[verbatim,quote,relative=1]
-c-\tweak #'thickness #5 ( d e f)
+c-\tweak thickness #5 ( d e f)
@end lilypond
inside of the @code{EventChord}:
@lilypond[relative=2,verbatim,quote]
-\tweak #'color #red c4
-\tweak #'color #red <c e>4
-<\tweak #'color #red c e>4
+\tweak color #red c4
+\tweak color #red <c e>4
+<\tweak color #red c e>4
@end lilypond
The simple @code{\tweak} command cannot be used to modify any object
@code{NoteHead} layout objects rather than by music elements in the
input stream.
-Such indirectly created layout objects can be tweaked using the explicit
-form of the @code{\tweak} command:
+Such indirectly created layout objects can be tweaked using the form
+of the @code{\tweak} command in which the grob name is specified
+explicitly:
@lilypond[relative=2,verbatim,quote]
-\tweak Stem #'color #red
-\tweak Beam #'color #green c8 e
-<c e \tweak Accidental #'font-size #-3 ges>4
+\tweak Stem.color #red
+\tweak Beam.color #green c8 e
+<c e \tweak Accidental.font-size #-3 ges>4
@end lilypond
@code{\tweak} cannot be used to modify clefs or time
@lilypond[verbatim,quote,relative=1]
c
--\tweak #'style #'dashed-line
--\tweak #'dash-fraction #0.2
--\tweak #'thickness #3
--\tweak #'color #red
+-\tweak style #'dashed-line
+-\tweak dash-fraction #0.2
+-\tweak thickness #3
+-\tweak color #red
\glissando
f'
@end lilypond
% reduced space between staves
\new PianoStaff \with {
% this is the nested declaration
- \override StaffGrouper #'staff-staff-spacing #'basic-distance = #7
+ \override StaffGrouper.staff-staff-spacing.basic-distance = #7
} <<
\new Staff { \clef treble c''1 }
\new Staff { \clef bass c1 }
@lilypond[quote,verbatim]
\new PianoStaff \with {
- \override StaffGrouper #'staff-staff-spacing =
+ \override StaffGrouper.staff-staff-spacing =
#'((basic-distance . 0)
(minimum-distance . 0)
(padding . 0)
declarations are equivalent:
@example
-\override StaffGrouper #'staff-staff-spacing =
+\override StaffGrouper.staff-staff-spacing =
#'((basic-distance . 7))
-\override StaffGrouper #'staff-staff-spacing =
+\override StaffGrouper.staff-staff-spacing =
#'((basic-distance . 7)
(minimum-distance . 0)
(padding . 0)
@lilypond[verbatim,quote,relative=1]
\new Staff \with {
- \override StaffSymbol #'line-positions = #'(7 3 0 -4 -6 -7)
+ \override StaffSymbol.line-positions = #'(7 3 0 -4 -6 -7)
}
{ a4 e' f b | d1 }
@end lilypond
@lilypond[verbatim,quote,relative=1]
\new Staff \with {
- \override StaffSymbol #'width = #23
+ \override StaffSymbol.width = #23
}
{ a4 e' f b | d1 }
@end lilypond
a~a
a
% increase the length of the tie
--\tweak #'minimum-length #5
+-\tweak minimum-length #5
~a
@end lilypond
\compressFullBarRests
R1*23
% increase the length of the rest bar
-\once \override MultiMeasureRest #'minimum-length = #20
+\once \override MultiMeasureRest.minimum-length = #20
R1*23
a1
@end lilypond
@lilypond[verbatim,quote,relative=2]
a \< a a a \!
% increase the length of the hairpin
-\override Hairpin #'minimum-length = #20
+\override Hairpin.minimum-length = #20
a \< a a a \!
@end lilypond
@lilypond[verbatim,quote,relative=2]
a( a)
a
--\tweak #'minimum-length #5
+-\tweak minimum-length #5
( a)
a\( a\)
a
--\tweak #'minimum-length #5
+-\tweak minimum-length #5
\( a\)
@end lilypond
e \glissando c'
% not effective alone
-\once \override Glissando #'minimum-length = #20
+\once \override Glissando.minimum-length = #20
e, \glissando c'
% effective only when both overrides are present
-\once \override Glissando #'minimum-length = #20
-\once \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods
+\once \override Glissando.minimum-length = #20
+\once \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
e, \glissando c'
@end lilypond
@lilypond[verbatim,quote,relative=1]
% not effective alone
-\once \override Beam #'minimum-length = #20
+\once \override Beam.minimum-length = #20
e8 e e e
% effective only when both overrides are present
-\once \override Beam #'minimum-length = #20
-\once \override Beam #'springs-and-rods = #ly:spanner::set-spacing-rods
+\once \override Beam.minimum-length = #20
+\once \override Beam.springs-and-rods = #ly:spanner::set-spacing-rods
e8 e e e
@end lilypond
@lilypond[verbatim,quote,relative=2]
a \< a a a a \! a a a \break
-\override Hairpin #'to-barline = ##f
+\override Hairpin.to-barline = ##f
a \< a a a a \! a a a
@end lilypond
@lilypond[relative=2,quote,verbatim]
e2 \glissando b
-\once \override Glissando #'(bound-details left Y) = #3
-\once \override Glissando #'(bound-details right Y) = #-2
+\once \override Glissando.bound-details.left.Y = #3
+\once \override Glissando.bound-details.right.Y = #-2
e2 \glissando b
@end lilypond
sub-lists of @code{bound-details}. For example:
@lilypond[relative=2,ragged-right,verbatim,quote]
-\override Glissando #'breakable = ##t
-\override Glissando #'(bound-details right-broken Y) = #-3
+\override Glissando.breakable = ##t
+\override Glissando.bound-details.right-broken.Y = #-3
c1 \glissando \break
f1
@end lilypond
to put @i{cresc.}, @i{tr} and other text on horizontal spanners.
@lilypond[quote,ragged-right,relative=2,verbatim]
-\override TextSpanner #'(bound-details left text)
+\override TextSpanner.bound-details.left.text
= \markup { \small \bold Slower }
c2\startTextSpan b c a\stopTextSpan
@end lilypond
relative to the end point of the line:
@lilypond[relative=1,quote,verbatim]
-\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"
+\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"
c4^\startTextSpan c c c \stopTextSpan
@end lilypond
@lilypond[quote,verbatim,relative=1]
a1 a
-\override Score.BarLine #'stencil = ##f
+\override Score.BarLine.stencil = ##f
a a
-\revert Score.BarLine #'stencil
+\revert Score.BarLine.stencil
a a a
@end lilypond
@lilypond[quote,verbatim,relative=2]
a4 a
-\once \override NoteHead #'transparent = ##t
+\once \override NoteHead.transparent = ##t
a a
@end lilypond
here:
@lilypond[quote,verbatim,relative=2]
-\override Staff.Clef #'color = #white
+\override Staff.Clef.color = #white
a1
@end lilypond
@code{layer}, say @w{@code{-1}}, so that it is drawn earlier:
@lilypond[quote,verbatim,relative=2]
-\override Staff.Clef #'color = #white
-\override Staff.Clef #'layer = #-1
+\override Staff.Clef.color = #white
+\override Staff.Clef.layer = #-1
a1
@end lilypond
f4 g a b
f4 g a b
% Remove bar line at the end of the current line
-\once \override Score.BarLine #'break-visibility = #'#(#f #t #t)
+\once \override Score.BarLine.break-visibility = #'#(#f #t #t)
\break
f4 g a b
f4 g a b
\key g \major
f4 g a b
% Try to remove all key signatures
-\override Staff.KeySignature #'break-visibility = #all-invisible
+\override Staff.KeySignature.break-visibility = #all-invisible
\key bes \major
f4 g a b
\break
\key g \major
f4 g a b
\set Staff.explicitKeySignatureVisibility = #all-invisible
-\override Staff.KeySignature #'break-visibility = #all-invisible
+\override Staff.KeySignature.break-visibility = #all-invisible
\key bes \major
f4 g a b \break
f4 g a b
f4 g a b
\set Staff.explicitKeySignatureVisibility = #all-invisible
\set Staff.printKeyCancellation = ##f
-\override Staff.KeySignature #'break-visibility = #all-invisible
+\override Staff.KeySignature.break-visibility = #all-invisible
\key bes \major
f4 g a b \break
f4 g a b
@lilypond[relative=2,ragged-right,verbatim,quote]
d2 \glissando d'2
-\once \override Glissando #'style = #'dashed-line
+\once \override Glissando.style = #'dashed-line
d,2 \glissando d'2
-\override Glissando #'style = #'dotted-line
+\override Glissando.style = #'dotted-line
d,2 \glissando d'2
-\override Glissando #'style = #'zigzag
+\override Glissando.style = #'zigzag
d,2 \glissando d'2
-\override Glissando #'style = #'trill
+\override Glissando.style = #'trill
d,2 \glissando d'2
@end lilypond
@c TODO Complete
@lilypond[relative=2,ragged-right,verbatim,quote]
e2 \glissando f
-\once \override Glissando #'(bound-details right Y) = #-2
+\once \override Glissando.bound-details.right.Y = #-2
e2 \glissando f
@end lilypond
@lilypond[quote,verbatim,relative=1]
g4\< e' d' f\!
-\override Hairpin #'rotation = #'(20 -1 0)
+\override Hairpin.rotation = #'(20 -1 0)
g,,4\< e' d' f\!
@end lilypond
of the text too high.
@lilypond[quote,verbatim,relative=1]
-\override TextScript #'outside-staff-priority = ##f
+\override TextScript.outside-staff-priority = ##f
g4^\markup { \rotate #30 "a G" }
b^\markup { \rotate #30 "a B" }
des^\markup { \rotate #30 "a D-Flat" }
@lilypond[verbatim,quote,relative=2]
a-3
a
--\tweak #'X-offset #0
--\tweak #'Y-offset #0
+-\tweak X-offset #0
+-\tweak Y-offset #0
-3
a
--\tweak #'X-offset #-1
--\tweak #'Y-offset #1
+-\tweak X-offset #-1
+-\tweak Y-offset #1
-3
@end lilypond
@lilypond[quote,verbatim,relative=1]
a'
--\tweak #'self-alignment-X #-1
+-\tweak self-alignment-X #-1
^"left-aligned"
--\tweak #'self-alignment-X #0
+-\tweak self-alignment-X #0
^"center-aligned"
--\tweak #'self-alignment-X #RIGHT
+-\tweak self-alignment-X #RIGHT
^"right-aligned"
--\tweak #'self-alignment-X #-2.5
+-\tweak self-alignment-X #-2.5
^"aligned further to the right"
@end lilypond
@lilypond[quote,verbatim,relative=2]
a
--\tweak #'self-alignment-X #0.5 % move horizontally left
--\tweak #'Y-offset #ly:self-alignment-interface::y-aligned-on-self
--\tweak #'self-alignment-Y #-1 % move vertically up
+-\tweak self-alignment-X #0.5 % move horizontally left
+-\tweak Y-offset #ly:self-alignment-interface::y-aligned-on-self
+-\tweak self-alignment-Y #-1 % move vertically up
-3 % third finger
@end lilypond
@lilypond[verbatim,quote,relative=1]
% The rehearsal mark will be centered above the Clef
-\override Score.RehearsalMark #'break-align-symbols = #'(clef)
+\override Score.RehearsalMark.break-align-symbols = #'(clef)
\key a \major
\clef treble
\mark "↓"
e1
% The rehearsal mark will be centered above the Time Signature
-\override Score.RehearsalMark #'break-align-symbols = #'(time-signature)
+\override Score.RehearsalMark.break-align-symbols = #'(time-signature)
\key a \major
\clef treble
\time 3/4
\mark "↓"
e2.
% The rehearsal mark will be centered above the Breath Mark
-\override Score.RehearsalMark #'break-align-symbols = #'(breathing-sign)
+\override Score.RehearsalMark.break-align-symbols = #'(breathing-sign)
\key a \major
\clef treble
\time 4/4
@lilypond[verbatim,quote,relative=1]
% The rehearsal mark will be centered above the Key Signature
-\override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef)
+\override Score.RehearsalMark.break-align-symbols = #'(key-signature clef)
\key a \major
\clef treble
\mark "↓"
e1
% The rehearsal mark will be centered above the Clef
\set Staff.explicitKeySignatureVisibility = #all-invisible
-\override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef)
+\override Score.RehearsalMark.break-align-symbols = #'(key-signature clef)
\key a \major
\clef bass
\mark "↓"
% The rehearsal mark will be centered above the Bar Line
\set Staff.explicitKeySignatureVisibility = #all-invisible
\set Staff.explicitClefVisibility = #all-invisible
-\override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef)
+\override Score.RehearsalMark.break-align-symbols = #'(key-signature clef)
\key a \major
\clef treble
\mark "↓"
@lilypond[verbatim,quote,relative=1]
% The RehearsalMark will be centered above the Key Signature
-\override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
+\override Score.RehearsalMark.break-align-symbols = #'(key-signature)
\key a \major
\clef treble
\time 4/4
\mark "↓"
e1
% The RehearsalMark will be aligned with the left edge of the Key Signature
-\once \override Score.KeySignature #'break-align-anchor-alignment = #LEFT
+\once \override Score.KeySignature.break-align-anchor-alignment = #LEFT
\mark "↓"
\key a \major
e1
% The RehearsalMark will be aligned with the right edge of the Key Signature
-\once \override Score.KeySignature #'break-align-anchor-alignment = #RIGHT
+\once \override Score.KeySignature.break-align-anchor-alignment = #RIGHT
\key a \major
\mark "↓"
e1
@lilypond[verbatim,quote,relative=1]
% The RehearsalMark will be aligned with the left edge of the Key Signature
% and then shifted right by 3.5 staff-spaces
-\override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
-\once \override Score.KeySignature #'break-align-anchor = #3.5
+\override Score.RehearsalMark.break-align-symbols = #'(key-signature)
+\once \override Score.KeySignature.break-align-anchor = #3.5
\key a \major
\mark "↓"
e1
% The RehearsalMark will be aligned with the left edge of the Key Signature
% and then shifted left by 2 staff-spaces
-\once \override Score.KeySignature #'break-align-anchor = #-2
+\once \override Score.KeySignature.break-align-anchor = #-2
\key a \major
\mark "↓"
e1
@lilypond[verbatim,quote]
XinO = {
- \once \override NoteHead #'stencil = #ly:text-interface::print
- \once \override NoteHead #'text = \markup {
+ \once \override NoteHead.stencil = #ly:text-interface::print
+ \once \override NoteHead.text = \markup {
\combine
\halign #-0.7 \draw-circle #0.85 #0.2 ##f
\musicglyph #"noteheads.s2cross"
@cindex Bézier curves, control points
@cindex control points, Bézier curves
-Ties, slurs and phrasing slurs are drawn as third-order Bézier
-curves. If the shape of the tie or slur which is calculated
-automatically is not optimum, the shape may be modified manually by
-explicitly specifying the four control points required to define
-a third-order Bézier curve.
+@code{Tie}s, @code{Slur}s, @code{PhrasingSlur}s,
+@code{LaissezVibrerTie}s and @code{RepeatTie}s are all drawn as
+third-order Bézier curves. If the shape of the tie or slur which
+is calculated automatically is not optimum, the shape may be
+modified manually in two ways:
+
+@enumerate a
+@item
+by specifying the displacements to be made to the control points
+of the automatically calculated Bézier curve, or
+
+@item
+by explicitly specifying the positions of the four control points
+required to define the wanted curve.
+@end enumerate
+
+Both methods are explained below. The first method is more suitable
+if only slight adjustments to the curve are required; the second may
+be better for creating curves which are related to just a single
+note.
+
+@subsubsubheading Cubic Bézier curves
Third-order or cubic Bézier curves are defined by four control
points. The first and fourth control points are precisely the
head towards the third and continuing to bend over to head towards
the fourth, arriving there travelling directly from the third
control point. The curve is entirely contained in the
-quadrilateral defined by the four control points.
+quadrilateral defined by the four control points. Translations,
+rotations and scaling of the control points all result in exactly
+the same operations on the curve.
+
+@subsubsubheading Specifying displacements from current control points
+
+@cindex shaping slurs and ties
+@funindex \shape
-Here is an example of a case where the tie is not optimum, and
-where @code{\tieDown} would not help.
+In this example the automatic placement of the tie is not optimum,
+and @code{\tieDown} would not help.
@lilypond[verbatim,quote,relative=1]
<<
>>
@end lilypond
-One way of improving this tie is to manually modify its control
-points, as follows.
+Adjusting the control points of the tie with @code{\shape} allows
+the collisions to be avoided.
-The coordinates of the Bézier control points are specified in units
-of staff-spaces. The X@tie{}coordinate is relative to the reference
-point of the note to which the tie or slur is attached, and the
-Y@tie{}coordinate is relative to the staff center line. The
-coordinates are entered as a list of four pairs of decimal numbers
-(reals). One approach is to estimate the coordinates of the two
-end points, and then guess the two intermediate points. The optimum
-values are then found by trial and error.
+The syntax of @code{\shape} is
-It is useful to remember that a symmetric curve requires symmetric
-control points, and that Bézier curves have the useful property that
-transformations of the curve such as translation, rotation and
-scaling can be achieved by applying the same transformation to the
-curve's control points.
+@example
+[-]@code{\shape} @var{displacements} @var{item}
+@end example
-For the example above the following override gives a satisfactory
-tie. Note the placement -- it has to be immediately before the note
-to which the start of the tie (or slur) is attached.
+This will reposition the control-points of @var{item} by the amounts
+given by @var{displacements}. The @var{displacements} argument is a
+list of number pairs or a list of such lists. Each element of a pair
+represents the displacement of one of the coordinates of a
+control-point. If @var{item} is a string, the result is
+@code{\once\override} for the specified grob type. If @var{item} is
+a music expression, the result is the same music expression with an
+appropriate tweak applied.
+
+In other words, the @code{\shape} function can act as either a
+@code{\once\override} command or a @code{\tweak} command depending
+on whether the @var{item} argument is a grob name, like @qq{Slur},
+or a music expression, like @qq{(}. The @var{displacements} argument
+specifies the displacements of the four control points as a list of
+four pairs of (dx . dy) values in units of staff-spaces (or a list
+of such lists if the curve has more than one segment).
+
+The leading hyphen is required if and only if the @code{\tweak} form
+is being used.
+
+So, using the same example as above and the @code{\once\override}
+form of @code{\shape}, this will raise the tie by half a staff-space:
@lilypond[verbatim,quote,relative=1]
<<
{
- \once \override Tie
- #'control-points = #'((1 . -1) (3 . 0.6) (12.5 . 0.6) (14.5 . -1))
- e1 ~ e
+ \shape #'((0 . 0.5) (0 . 0.5) (0 . 0.5) (0 . 0.5)) Tie
+ e1~ e
}
\\
{ r4 <g c,> <g c,> <g c,> }
>>
@end lilypond
+This positioning of the tie is better, but maybe it should be raised
+more in the center. The following example does this, this time using
+the alternative @code{\tweak} form:
+
+@lilypond[verbatim,quote,relative=1]
+<<
+ {
+ e1-\shape #'((0 . 0.5) (0 . 1) (0 . 1) (0 . 0.5)) ~ e
+ }
+\\
+ { r4 <g c,> <g c,> <g c,> }
+>>
+@end lilypond
+
+Changes to the horizontal positions of the control points may be made
+in the same way, and two different curves starting at the same
+musical moment may also be shaped:
+
+@lilypond[verbatim,quote,ragged-right,relative=2]
+c8(\( a) a'4 e c\)
+\shape #'((0.7 . -0.4) (0.5 . -0.4) (0.3 . -0.3) (0 . -0.2)) Slur
+\shape #'((0 . 0) (0 . 0.5) (0 . 0.5) (0 . 0)) PhrasingSlur
+c8(\( a) a'4 e c\)
+@end lilypond
+
+The @code{\shape} function can also displace the control points of
+curves which stretch across line breaks. Each piece of the broken
+curve can be given its own list of offsets. If changes to a
+particular segment are not needed, the empty list can serve as a
+placeholder. In this example the line break makes the single slur
+look like two:
+
+@lilypond[verbatim,quote,ragged-right,relative=1]
+c4( f g c
+\break
+d,4 c' f, c)
+@end lilypond
+
+Changing the shapes of the two halves of the slur makes it clearer
+that the slur continues over the line break:
+
+@lilypond[verbatim,quote,ragged-right,relative=1]
+% () may be used as a shorthand for ((0 . 0) (0 . 0) (0 . 0) (0 . 0))
+% if any of the segments does not need to be changed
+\shape #'(
+ (( 0 . 0) (0 . 0) (0 . 0) (0 . 1))
+ ((0.5 . 1.5) (1 . 0) (0 . 0) (0 . -1.5))
+ ) Slur
+c4( f g c
+\break
+d,4 c' f, c)
+@end lilypond
+
+If an S-shaped curve is required the control points must always be
+adjusted manually --- LilyPond will never select such shapes
+automatically.
+
+@lilypond[verbatim,quote,relative=2]
+c8( e b-> f d' a e-> g)
+\shape #'((0 . -1) (5.5 . -0.5) (-5.5 . -10.5) (0 . -5.5)) PhrasingSlur
+c8\( e b-> f d' a e-> g\)
+@end lilypond
+
+@subsubsubheading Specifying control points explicitly
+
+The coordinates of the Bézier control points are specified in units
+of staff-spaces. The X@tie{}coordinate is relative to the reference
+point of the note to which the tie or slur is attached, and the
+Y@tie{}coordinate is relative to the staff center line. The
+coordinates are specified as a list of four pairs of decimal numbers
+(reals). One approach is to estimate the coordinates of the two
+end points, and then guess the two intermediate points. The optimum
+values are then found by trial and error. Be aware that these values
+may need to be manually adjusted if any further changes are made to
+the music or the layout.
+
+One situation where specifying the control points explicitly is
+preferable to specifying displacements is when they need to be
+specified relative to a single note. Here is an example of this.
+It shows one way of indicating a slur extending into alternative
+sections of a volta repeat.
+
+@lilypond[verbatim,quote,relative=2]
+c1
+\repeat volta 3 { c4 d( e f }
+\alternative {
+ { g2) d }
+ {
+ g2
+ % create a slur and move it to a new position
+ % the <> is just an empty chord to carry the slur termination
+ -\tweak control-points #'((-2 . 3.8) (-1 . 3.9) (0 . 4) (1 . 3.4)) ( <> )
+ f,
+ }
+ {
+ e'2
+ % create a slur and move it to a new position
+ -\tweak control-points #'((-2 . 3) (-1 . 3.1) (0 . 3.2) (1 . 2.4)) ( <> )
+ f,
+ }
+}
+@end lilypond
+
@knownissues
It is not possible to modify shapes of ties or slurs by changing
the @code{control-points} property if there are multiple ties or slurs
'(-0.5 . 0.5)))))
squareLineCircleSpace = {
- \override NoteHead #'stencil = #square-line-circle-space
+ \override NoteHead.stencil = #square-line-circle-space
}
smartSquareLineCircleSpace = {
\squareLineCircleSpace
- \override NoteHead #'Y-extent =
+ \override NoteHead.Y-extent =
#(ly:make-unpure-pure-container
ly:grob::stencil-height
(lambda (grob start end) (ly:grob::stencil-height grob)))
\new Voice \with { \remove "Stem_engraver" }
\relative c'' {
\squareLineCircleSpace
- cis4 ces cisis c
+ cis4 ces disis d
\smartSquareLineCircleSpace
- cis4 ces cisis c
+ cis4 ces disis d
}
@end lilypond
(parser location padding)
(number?)
#{
- \once \override TextScript #'padding = #padding
+ \once \override TextScript.padding = #padding
#})
\relative c''' {
(parser location note)
(ly:music?)
#{
- \tweak NoteHead #'stencil #ly:text-interface::print
- \tweak NoteHead #'text
+ \tweak NoteHead.stencil #ly:text-interface::print
+ \tweak NoteHead.text
\markup \musicglyph #"custodes.mensural.u0"
- \tweak Stem #'stencil ##f
+ \tweak Stem.stencil ##f
#note
#})
(parser location padding tempotext)
(number? markup?)
#{
- \once \override Score.MetronomeMark #'padding = #padding
+ \once \override Score.MetronomeMark.padding = #padding
\tempo \markup { \bold #tempotext }
#})