]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly
188484760bd0b869b7fb50602835a140df98be4a
[lilypond.git] / Documentation / snippets / time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.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.16.0"
8
9 \header {
10   lsrtags = "rhythms, tweaks-and-overrides"
11
12   texidoc = "
13 Sometimes, a time signature should not print the whole fraction (e.g.
14 7/4), but only the numerator (7 in this case). This can be easily done
15 by using @code{\\override Staff.TimeSignature #'style = #'single-digit}
16 to change the style permanently. By using @code{\\revert
17 Staff.TimeSignature #'style}, this setting can be reversed. To apply
18 the single-digit style to only one time signature, use the
19 @code{\\override} command and prefix it with a @code{\\once}.
20
21 "
22   doctitle = "Time signature printing only the numerator as a number (instead of the fraction)"
23 } % begin verbatim
24
25
26 \relative c'' {
27   \time 3/4
28   c4 c c
29   % Change the style permanently
30   \override Staff.TimeSignature #'style = #'single-digit
31   \time 2/4
32   c4 c
33   \time 3/4
34   c4 c c
35   % Revert to default style:
36   \revert Staff.TimeSignature #'style
37   \time 2/4
38   c4 c
39   % single-digit style only for the next time signature
40   \once \override Staff.TimeSignature #'style = #'single-digit
41   \time 5/4
42   c4 c c c c
43   \time 2/4
44   c4 c
45 }