]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/tweaking-clef-properties.ly
Doc: NR Pitches.itely - Clef - updated snippets and text
[lilypond.git] / Documentation / snippets / new / tweaking-clef-properties.ly
1 \version "2.17.18"
2
3 \header {
4   lsrtags = "pitches, staff-notation, tweaks-and-overrides"
5
6   texidoc = "
7 Changing the Clef glyph, its position, or the ottavation does not
8 change the position of subsequent notes on the staff.  To get key
9 signatures on their correct staff lines @code{middleCClefPosition}
10 must also be specified, with positive or negative values moving
11 @emph{middle C} up or down respectively, relative to the staff's
12 center line.
13
14 For example, @code{\\clef \"treble_8\"} is equivalent to setting
15 the @code{clefGlyph}, @code{clefPosition} (the vertical position
16 of the clef itself on the staff), @code{middleCPosition} and
17 @code{clefTransposition}. Note that when any of these properties
18 (except @code{middleCPosition}) are changed a new clef symbol is
19 printed.
20
21 The following examples show the possibilities when setting these
22 properties manually. On the first line, the manual changes preserve the
23 standard relative positioning of clefs and notes, whereas on the second
24 line, they do not.
25
26 "
27   doctitle = "Tweaking clef properties"
28 } % begin verbatim
29
30 \layout { ragged-right = ##t }
31 {
32   % The default treble clef
33   \key f \major
34   c'1
35   % The standard bass clef
36   \set Staff.clefGlyph = #"clefs.F"
37   \set Staff.clefPosition = #2
38   \set Staff.middleCPosition = #6
39   \set Staff.middleCClefPosition = #6
40   \key g \major
41   c'1
42   % The baritone clef
43   \set Staff.clefGlyph = #"clefs.C"
44   \set Staff.clefPosition = #4
45   \set Staff.middleCPosition = #4
46   \set Staff.middleCClefPosition = #4
47   \key f \major
48   c'1
49   % The standard choral tenor clef
50   \set Staff.clefGlyph = #"clefs.G"
51   \set Staff.clefPosition = #-2
52   \set Staff.clefTransposition = #-7
53   \set Staff.middleCPosition = #1
54   \set Staff.middleCClefPosition = #1
55   \key f \major
56   c'1
57   % A non-standard clef
58   \set Staff.clefPosition = #0
59   \set Staff.clefTransposition = #0
60   \set Staff.middleCPosition = #-4
61   \set Staff.middleCClefPosition = #-4
62   \key g \major
63   c'1 \break
64
65   % The following clef changes do not preserve
66   % the normal relationship between notes, key signatures
67   % and clefs:
68
69   \set Staff.clefGlyph = #"clefs.F"
70   \set Staff.clefPosition = #2
71   c'1
72   \set Staff.clefGlyph = #"clefs.G"
73   c'1
74   \set Staff.clefGlyph = #"clefs.C"
75   c'1
76   \set Staff.clefTransposition = #7
77   c'1
78   \set Staff.clefTransposition = #0
79   \set Staff.clefPosition = #0
80   c'1
81
82   % Return to the normal clef:
83
84   \set Staff.middleCPosition = #0
85   c'1
86 }