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