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