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