Tweaking clef properties: Difference between revisions

m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
Changing the clef glyph, its position, or the ottavation does not change the position of subsequent notes on the staff. To get key signatures on their correct staff lines, <code>middleCClefPosition</code> must also be specified, with positive or negative values moving ''middle C'' up or down respectively, relative to the staff's center line.
Changing the clef glyph, its position, or the ottavation does not change the position of subsequent notes on the staff. To get key signatures on their correct staff lines, <code>middleCClefPosition</code> must also be specified, with positive or negative values moving “middle&nbsp;C” up or down respectively, relative to the staff's center line.


For example, <code>\clef &quot;treble_8&quot;</code> is equivalent to setting the <code>clefGlyph</code>, <code>clefPosition</code> (the vertical position of the clef itself on the staff), <code>middleCPosition</code>, and <code>clefTransposition</code>. Note that when any of these properties (except <code>middleCPosition</code>) are changed a new clef symbol is printed.
For example, <code>\clef &quot;treble_8&quot;</code> is equivalent to setting the context properties <code>clefGlyph</code>, <code>clefPosition</code> (the vertical position of the clef itself on the staff), <code>middleCPosition</code>, and <code>clefTransposition</code>. Note that when any of these properties (except <code>middleCPosition</code>) are changed a new clef symbol is printed.


The following examples show the possibilities when setting these properties manually. On the first line, the manual changes preserve the standard relative positioning of clefs and notes, whereas on the second line, they do not.
The following examples show the possibilities when setting these properties manually. On the first line, the manual changes preserve the standard relative positioning of clefs and notes, whereas on the second line, they do not.


<lilypond version="2.24" full>
<lilypond version="2.24">
{
{
   % The default treble clef
   % The default treble clef.
   \key f \major
   \key f \major
   c'1
   c'1
Line 17: Line 17:
   \key g \major
   \key g \major
   c'1
   c'1
   % The baritone clef
   % The baritone clef.
   \set Staff.clefGlyph = "clefs.C"
   \set Staff.clefGlyph = "clefs.C"
   \set Staff.clefPosition = 4
   \set Staff.clefPosition = 4
Line 24: Line 24:
   \key f \major
   \key f \major
   c'1
   c'1
   % The standard choral tenor clef
   % The standard choral tenor clef.
   \set Staff.clefGlyph = "clefs.G"
   \set Staff.clefGlyph = "clefs.G"
   \set Staff.clefPosition = -2
   \set Staff.clefPosition = -2
Line 32: Line 32:
   \key f \major
   \key f \major
   c'1
   c'1
   % A non-standard clef
   % A non-standard clef.
   \set Staff.clefPosition = 0
   \set Staff.clefPosition = 0
   \set Staff.clefTransposition = 0
   \set Staff.clefTransposition = 0
Line 42: Line 42:
   % The following clef changes do not preserve
   % The following clef changes do not preserve
   % the normal relationship between notes, key signatures
   % the normal relationship between notes, key signatures
   % and clefs:
   % and clefs.
 
   \set Staff.clefGlyph = "clefs.F"
   \set Staff.clefGlyph = "clefs.F"
   \set Staff.clefPosition = 2
   \set Staff.clefPosition = 2
Line 57: Line 56:
   c'1
   c'1


   % Return to the normal clef:
   % Return to the normal clef.
 
   \set Staff.middleCPosition = 0
   \set Staff.middleCPosition = 0
   c'1
   c'1
}
}
\paper { tagline = ##f }
</lilypond>
</lilypond>


[[Category:Pitches]]
[[Category:Pitches]]
[[Category:Staff notation]]
[[Category:Tweaks and overrides]]
[[Category:Tweaks and overrides]]
[[Category:Staff notation]]
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]]
[[Category:Snippet]]