]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/positioning-multi-measure-rests.ly
Run scripts/auxiliar/update-with-convert-ly.sh
[lilypond.git] / Documentation / snippets / new / positioning-multi-measure-rests.ly
1 \version "2.16.0"
2
3 \header {
4   lsrtags = "rhythms, tweaks-and-overrides"
5
6   texidoc = "
7 Unlike ordinary rests, there is no predefined command to change the
8 staff position of a multi-measure rest symbol of either form by
9 attaching it to a note.  However, in polyphonic music multi-measure
10 rests in odd-numbered and even-numbered voices are vertically
11 separated. The positioning of multi-measure rests can be controlled as
12 follows:
13
14 "
15   doctitle = "Positioning multi-measure rests"
16 }
17
18 \relative c'' {
19   % Multi-measure rests by default are set under the fourth line
20   R1
21   % They can be moved using an override
22   \override MultiMeasureRest #'staff-position = #-2
23   R1
24   \override MultiMeasureRest #'staff-position = #0
25   R1
26   \override MultiMeasureRest #'staff-position = #2
27   R1
28   \override MultiMeasureRest #'staff-position = #3
29   R1
30   \override MultiMeasureRest #'staff-position = #6
31   R1
32   \revert MultiMeasureRest #'staff-position
33   \break
34
35   % In two Voices, odd-numbered voices are under the top line
36   << { R1 } \\ { a1 } >>
37   % Even-numbered voices are under the bottom line
38   << { a1 } \\ { R1 } >>
39   % Multi-measure rests in both voices remain separate
40   << { R1 } \\ { R1 } >>
41
42   % Separating multi-measure rests in more than two voices
43   % requires an override
44   << { R1 } \\ { R1 } \\
45      \once \override MultiMeasureRest #'staff-position = #0
46      { R1 }
47   >>
48
49   % Using compressed bars in multiple voices requires another override
50   % in all voices to avoid multiple instances being printed
51   \compressFullBarRests
52   <<
53    \revert MultiMeasureRest #'staff-position
54     { R1*3 }
55     \\
56    \revert MultiMeasureRest #'staff-position
57     { R1*3 }
58   >>
59 }