]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/tweaking-clef-properties.ly
Doc-fr: updates texidocs
[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.17.18"
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{clefTransposition}. 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. In order to get key signatures on the correct staff lines,
24 @code{middleCClefPosition} must also be set.  The positional parameters
25 are relative to the staff center line, positive numbers displacing
26 upwards, counting one for each line and space. The
27 @code{clefTransposition} value would normally be set to 7, -7, 15 or -15,
28 but other values are valid.
29
30
31 When a clef change takes place at a line break the new clef symbol is
32 printed at both the end of the previous line and the beginning of the
33 new line by default. If the warning clef at the end of the previous
34 line is not required it can be suppressed by setting the @code{Staff}
35 property @code{explicitClefVisibility} to the value
36 @code{end-of-line-invisible}. The default behavior can be recovered
37 with  @code{\\unset Staff.explicitClefVisibility}.
38
39 The following examples show the possibilities when setting these
40 properties manually. On the first line, the manual changes preserve the
41 standard relative positioning of clefs and notes, whereas on the second
42 line, they do not.
43
44 "
45   doctitle = "Tweaking clef properties"
46 } % begin verbatim
47
48 \layout { ragged-right = ##t }
49 {
50   % The default treble clef
51   \key f \major
52   c'1
53   % The standard bass clef
54   \set Staff.clefGlyph = #"clefs.F"
55   \set Staff.clefPosition = #2
56   \set Staff.middleCPosition = #6
57   \set Staff.middleCClefPosition = #6
58   \key g \major
59   c'1
60   % The baritone clef
61   \set Staff.clefGlyph = #"clefs.C"
62   \set Staff.clefPosition = #4
63   \set Staff.middleCPosition = #4
64   \set Staff.middleCClefPosition = #4
65   \key f \major
66   c'1
67   % The standard choral tenor clef
68   \set Staff.clefGlyph = #"clefs.G"
69   \set Staff.clefPosition = #-2
70   \set Staff.clefTransposition = #-7
71   \set Staff.middleCPosition = #1
72   \set Staff.middleCClefPosition = #1
73   \key f \major
74   c'1
75   % A non-standard clef
76   \set Staff.clefPosition = #0
77   \set Staff.clefTransposition = #0
78   \set Staff.middleCPosition = #-4
79   \set Staff.middleCClefPosition = #-4
80   \key g \major
81   c'1 \break
82
83   % The following clef changes do not preserve
84   % the normal relationship between notes, key signatures
85   % and clefs:
86
87   \set Staff.clefGlyph = #"clefs.F"
88   \set Staff.clefPosition = #2
89   c'1
90   \set Staff.clefGlyph = #"clefs.G"
91   c'1
92   \set Staff.clefGlyph = #"clefs.C"
93   c'1
94   \set Staff.clefTransposition = #7
95   c'1
96   \set Staff.clefTransposition = #0
97   \set Staff.clefPosition = #0
98   c'1
99
100   % Return to the normal clef:
101
102   \set Staff.middleCPosition = #0
103   c'1
104 }