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