]> git.donarmstrong.com Git - lilypond.git/blob - input/new/positioning-multi--measure-rests.ly
56aeda5885598176d6d5a785a868ee2284bda5df
[lilypond.git] / input / new / positioning-multi--measure-rests.ly
1 \version "2.11.42"
2 \layout { ragged-right= ##t }
3 \header {
4   doctitle = "Positioning multi-measure rests"
5   lsrtags = "rhythms,tweaks-and-overrides"
6   texidoc = "
7 Unlike ordinary rests, there is no predefined command
8 to change the vertical position on the staff of a multi-measure
9 rest symbol of either form by attaching it to a note.  However,
10 in polyphonic music multi-measure rests in odd-numbered and
11 even-numbered voices are vertically separated.  The positioning
12 of multi-measure rests can be controlled as follows:
13  "}
14
15 \relative c'' {
16 % Multi-measure rests by default are set under the 2nd line
17 R1
18 % They can be moved with an override
19 \override MultiMeasureRest #'staff-position = #-2
20 R1
21 % A value of 0 is the default position;
22 % the following trick moves the rest to the center line
23 \override MultiMeasureRest #'staff-position = #-0.01
24 R1
25 % Multimeasure rests in odd-numbered voices are under the top line
26 << {R1} \\ {a1} >>
27 % Multi-measure rests in even-numbered voices are under the bottom line
28 << {c1} \\ {R1} >>
29 % They remain separated even in empty bars
30 << {R1} \\ {R1} >>
31 % This brings them together even though there are two voices
32 \compressFullBarRests
33 <<
34   \revert MultiMeasureRest #'staff-position
35   {R1*3}
36 \\
37   \revert MultiMeasureRest #'staff-position
38   {R1*3}
39 >>
40 }
41