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