]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/tweaking-clef-properties.ly
645530ea2bec1f24bd044a876d69edc2afd59854
[lilypond.git] / Documentation / snippets / tweaking-clef-properties.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.di.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.18.0"
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. 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{clefOctavation} 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 {
49   indent = 0
50   ragged-right = ##t
51 }
52 {
53   % The default treble clef
54   \key f \major
55   c'1
56   % The standard bass clef
57   \set Staff.clefGlyph = #"clefs.F"
58   \set Staff.clefPosition = #2
59   \set Staff.middleCPosition = #6
60   \set Staff.middleCClefPosition = #6
61   \key g \major
62   c'1
63   % The baritone clef
64   \set Staff.clefGlyph = #"clefs.C"
65   \set Staff.clefPosition = #4
66   \set Staff.middleCPosition = #4
67   \set Staff.middleCClefPosition = #4
68   \key f \major
69   c'1
70   % The standard choral tenor clef
71   \set Staff.clefGlyph = #"clefs.G"
72   \set Staff.clefPosition = #-2
73   \set Staff.clefTransposition = #-7
74   \set Staff.middleCPosition = #1
75   \set Staff.middleCClefPosition = #1
76   \key f \major
77   c'1
78   % A non-standard clef
79   \set Staff.clefPosition = #0
80   \set Staff.clefTransposition = #0
81   \set Staff.middleCPosition = #-4
82   \set Staff.middleCClefPosition = #-4
83   \key g \major
84   c'1 \break
85
86   % The following clef changes do not preserve
87   % the normal relationship between notes, key signatures
88   % and clefs:
89
90   \set Staff.clefGlyph = #"clefs.F"
91   \set Staff.clefPosition = #2
92   c'1
93   \set Staff.clefGlyph = #"clefs.G"
94   c'1
95   \set Staff.clefGlyph = #"clefs.C"
96   c'1
97   \set Staff.clefTransposition = #7
98   c'1
99   \set Staff.clefTransposition = #0
100   \set Staff.clefPosition = #0
101   c'1
102
103   % Return to the normal clef:
104
105   \set Staff.middleCPosition = #0
106   c'1
107 }