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