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