]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/offsets.ly
Improvements to \offset
[lilypond.git] / input / regression / offsets.ly
1 \version "2.17.29"
2
3 \header {
4   texidoc = "The @code{\\offset} command may be used to displace various properties
5 from the default settings contained in grob descriptions.  Settings which may be
6 offset are limited to those of type @code{number}, @code{number-pair}, or
7 @code{number-pair-list}.  Most of the following examples begin with the grob in its
8 default appearance.  The command is demonstrated as a tweak and as an override."
9 }
10
11 \layout {
12   ragged-right = ##t
13   indent = 0
14 }
15
16 \relative c' {
17
18   %% ARPEGGIO %%
19   % default
20   <c e g b>1\arpeggio
21   <c e g b>1-\offset positions #'(-1 . 1) \arpeggio
22   \bar "||"
23
24   %% BREATHING SIGN %%
25   % default
26   c1 \breathe
27   c1
28   \once \offset Y-offset 1 BreathingSign
29   \breathe
30   \bar "||"
31
32   %% DYNAMICS %%
33   % default
34   c1\f
35   \once \offset X-offset #-1 DynamicText
36   c1\f
37   % DynamicLineSpanner
38   \once \offset padding 1 DynamicLineSpanner
39   c1\f
40   \bar "||"
41
42   %% BEAMS %%
43   % default
44   c'8 d e f
45   \once \offset positions #'(-1 . -1) Voice.Beam
46   c8 d e f
47   % same effect as an offset of '(-2 . -2)
48   \once \offset positions #-2 Beam
49   c8 d e f
50   \override Beam.breakable = ##t
51   c8-\offset positions #'((-1 . -3) (-3 . -1)) [ d e f
52   \break
53   g8 f e d] c-\offset beam-thickness 0.48 [ d e f]
54   \bar "||"
55
56   %% TEXT SPANNERS %%
57   c4\startTextSpan d e f\stopTextSpan
58   \once \offset dash-fraction #'(0.1 0.3) TextSpanner
59   \once \offset staff-padding #'(1.0 2.0) TextSpanner
60   c4\startTextSpan d e f
61   \break
62   c4 d e f\stopTextSpan
63   \bar "||"
64
65   %% SLURS %%
66   % this duplicates the effect of the \shape command
67   \offset control-points #'(
68    ((0 . 0) (0 . 1) (0 . 2) (0 . 1))
69    ((1 . 0) (0 . 4) (0 . 4) (0 . 0))
70    ) Slur
71   c4-\offset line-thickness #'(0 10) ( d e f
72   \break
73   c4 d e f)
74   \bar "||"
75
76   %% ACCIDENTAL, STEM %%
77   % this illustrates use of \offset as a directed tweak
78   cis2
79   \offset AccidentalPlacement.right-padding 0.5
80   \offset Stem.thickness 4.0
81   cis!2
82 }