]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/positioning-segno-and-coda-with-line-break.ly
c3898c3a6115b9cbbec0fc3f61414f9e5c81d3ff
[lilypond.git] / Documentation / snippets / positioning-segno-and-coda-with-line-break.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.14.2"
8
9 \header {
10   lsrtags = "breaks, workaround, repeats, symbols-and-glyphs"
11
12   texidoc = "
13 If you want to place an exiting segno sign and add text like @qq{D.S.
14 al Coda} next to it where usually the staff lines are you can use this
15 snippet. The coda will resume in a new line. There is a variation
16 documented in this snippet, where the coda will remain on the same
17 line.
18
19 "
20   doctitle = "Positioning segno and coda (with line break)"
21 } % begin verbatim
22
23
24 {
25   \clef treble
26   \key g \major
27   \time 4/4
28   \relative c'' {
29     \repeat unfold 2 {
30       | c4 c c c
31     }
32
33     % Set segno sign as rehearsal mark and adjust size if needed
34     % \once \override Score.RehearsalMark #'font-size = #3
35     \mark \markup { \musicglyph #"scripts.segno" }
36     \repeat unfold 2 {
37       | c4 c c c
38     }
39
40     % Set coda sign as rehearsal mark and adjust size if needed
41     \once \override Score.RehearsalMark #'font-size = #4
42     \mark \markup { \musicglyph #"scripts.coda" }
43     \repeat unfold 2 {
44       | c4 c c c
45     }
46
47     % Should Coda be on anew line?
48     % Coda NOT on new line: use \nobreak
49     % Coda on new line: DON'T use \nobreak
50     % \noBreak
51
52     \bar "||"
53
54     % Set segno sign as rehearsal mark and adjust size if needed
55     \once \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible
56     % \once \override Score.RehearsalMark #'font-size = #3
57     \mark \markup { \musicglyph #"scripts.segno" }
58
59     % Here begins the trickery!
60     % \cadenzaOn will suppress the bar count and \stopStaff removes the staff lines.
61     \cadenzaOn
62       \stopStaff
63         % Some examples of possible text-displays
64
65         % text line-aligned
66         % ==================
67         % Move text to the desired position
68         % \once \override TextScript #'extra-offset = #'( 2 . -3.5 )
69         % | s1*0^\markup { D.S. al Coda } }
70
71         % text center-aligned
72         % ====================
73         % Move text to the desired position
74         % \once \override TextScript #'extra-offset = #'( 6 . -5.0 )
75         % | s1*0^\markup { \center-column { D.S. "al Coda" } }
76
77         % text and symbols center-aligned
78         % ===============================
79         % Move text to the desired position and tweak spacing for optimum text alignment
80         %\once \override TextScript #'extra-offset = #'( 8 . -5.5 )
81         \once \override TextScript #'word-space = #1.5
82         \once \override TextScript #'X-offset = #8
83         \once \override TextScript #'Y-offset = #1.5
84         | s1*0^\markup { \center-column { "D.S. al Coda" \line { \musicglyph #"scripts.coda" \musicglyph #"scripts.tenuto" \musicglyph #"scripts.coda"} } }
85
86         % Increasing the unfold counter will expand the staff-free space
87         \repeat unfold 4 {
88           s4 s4 s4 s4
89           \bar ""
90         }
91         % Resume bar count and show staff lines again
92      \startStaff
93    \cadenzaOff
94
95    % Should Coda be on new line?
96    % Coda NOT on new line: DON'T use \break
97    % Coda on new line: use \break
98    \break
99
100    % Show up, you clef and key!
101    \once \override Staff.KeySignature #'break-visibility = #end-of-line-invisible
102    \once \override Staff.Clef #'break-visibility = #end-of-line-invisible
103
104    % Set coda sign as rehearsal mark and adjust size and position
105
106    % Put the coda sign ontop of the (treble-)clef dependend on coda's line-position
107
108      % Coda NOT on new line, use this:
109      % \once \override Score.RehearsalMark #'extra-offset = #'( -2 . 1.75 )
110
111      % Coda on new line, use this:
112      \once \override Score.RehearsalMark #'extra-offset = #'( -8.42 . 1.75 )
113
114    \once \override Score.RehearsalMark #'font-size = #5
115    \mark \markup { \musicglyph #"scripts.coda" }
116
117    % The coda
118    \repeat unfold 5 {
119       | c4 c c c
120     }
121     \bar"|."
122   }
123 }
124