]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/offsets.ly
53489724036b8cabc7a89217f149cf98ed8d2b9f
[lilypond.git] / input / regression / offsets.ly
1 \version "2.17.28"
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   c1-\offset #'padding #1 \f
39   \bar "||"
40
41   %% BEAMS %%
42   % default
43   c'8 d e f
44   \once \offset #'positions #'(-1 . -1) Voice.Beam
45   c8 d e f
46   % same effect as an offset of '(-2 . -2)
47   \once \offset #'positions #-2 Beam
48   c8 d e f
49   \override Beam.breakable = ##t
50   c8-\offset #'positions #'((-1 . -3) (-3 . -1)) [ d e f
51   \break
52   g8 f e d] c-\offset #'beam-thickness #0.48 [ d e f]
53   \bar "||"
54
55   %% TEXT SPANNERS %%
56   c4\startTextSpan d e f\stopTextSpan
57   \once \offset #'dash-fraction #'(0.1 0.3) TextSpanner
58   \once \offset #'staff-padding #'(1.0 2.0) TextSpanner
59   c4\startTextSpan d e f
60   \break
61   c4 d e f\stopTextSpan
62   \bar "||"
63
64   %% SLURS %%
65   % this duplicates the effect of the \shape command
66   \offset #'control-points #'(
67    ((0 . 0) (0 . 1) (0 . 2) (0 . 1))
68    ((1 . 0) (0 . 4) (0 . 4) (0 . 0))
69    ) Slur
70   c4-\offset #'line-thickness #'(0 10) ( d e f
71   \break
72   c4 d e f)
73 }