]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/tweaking-clef-properties.ly
d4c5d6ed3ef753c3b7223c0d96a77dbf33647db9
[lilypond.git] / Documentation / snippets / tweaking-clef-properties.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
5 %%
6 %% This file is in the public domain.
7 \version "2.14.2"
8
9 \header {
10   lsrtags = "pitches, staff-notation, tweaks-and-overrides"
11
12   texidoc = "
13 The command @code{\\clef \"treble_8\"} is equivalent to setting
14 @code{clefGlyph}, @code{clefPosition} (which controls the vertical
15 position of the clef), @code{middleCPosition} and
16 @code{clefOctavation}. A clef is printed when any of the properties
17 except @code{middleCPosition} are changed.
18
19
20 Note that changing the glyph, the position of the clef, or the
21 octavation does not in itself change the position of subsequent notes
22 on the staff: the position of middle C must also be specified to do
23 this. The positional parameters are relative to the staff center line,
24 positive numbers displacing upwards, counting one for each line and
25 space. The @code{clefOctavation} value would normally be set to 7, -7,
26 15 or -15, but other values are valid.
27
28
29 When a clef change takes place at a line break the new clef symbol is
30 printed at both the end of the previous line and the beginning of the
31 new line by default. If the warning clef at the end of the previous
32 line is not required it can be suppressed by setting the @code{Staff}
33 property @code{explicitClefVisibility} to the value
34 @code{end-of-line-invisible}. The default behavior can be recovered
35 with  @code{\\unset Staff.explicitClefVisibility}.
36
37 The following examples show the possibilities when setting these
38 properties manually. On the first line, the manual changes preserve the
39 standard relative positioning of clefs and notes, whereas on the second
40 line, they do not.
41
42 "
43   doctitle = "Tweaking clef properties"
44 } % begin verbatim
45
46
47 \layout { ragged-right = ##t }
48
49 {
50   % The default treble clef
51   c'1
52   % The standard bass clef
53   \set Staff.clefGlyph = #"clefs.F"
54   \set Staff.clefPosition = #2
55   \set Staff.middleCPosition = #6
56   c'1
57   % The baritone clef
58   \set Staff.clefGlyph = #"clefs.C"
59   \set Staff.clefPosition = #4
60   \set Staff.middleCPosition = #4
61   c'1
62   % The standard choral tenor clef
63   \set Staff.clefGlyph = #"clefs.G"
64   \set Staff.clefPosition = #-2
65   \set Staff.clefOctavation = #-7
66   \set Staff.middleCPosition = #1
67   c'1
68   % A non-standard clef
69   \set Staff.clefPosition = #0
70   \set Staff.clefOctavation = #0
71   \set Staff.middleCPosition = #-4
72   c'1 \break
73
74   % The following clef changes do not preserve
75   % the normal relationship between notes and clefs:
76
77   \set Staff.clefGlyph = #"clefs.F"
78   \set Staff.clefPosition = #2
79   c'1
80   \set Staff.clefGlyph = #"clefs.G"
81   c'1
82   \set Staff.clefGlyph = #"clefs.C"
83   c'1
84   \set Staff.clefOctavation = #7
85   c'1
86   \set Staff.clefOctavation = #0
87   \set Staff.clefPosition = #0
88   c'1
89
90   % Return to the normal clef:
91
92   \set Staff.middleCPosition = #0
93   c'1
94 }