]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/positioning-segno-and-coda-with-line-break.ly
LSR updates from tarball - July 2012
[lilypond.git] / Documentation / snippets / positioning-segno-and-coda-with-line-break.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
5 %%
6 %% This file is in the public domain.
7 \version "2.14.2"
8
9 \header {
10   lsrtags = "breaks, workaround, repeats, symbols-and-glyphs"
11
12 %% Translation of GIT committish: 28097cf54698db364afeb75658e4c8e0e0ccd716
13   texidocfr = "
14 Le code ci-dessous permet d'adjoindre à un signe @emph{segno} un texte
15 @emph{D.S. al Coda}, là où se trouverait normalement un bout de portée.
16 La @emph{coda} entamera une nouvelle ligne.  Une variante, indiquée ici
17 même, permet de laisser la @emph{coda} sur la même ligne.
18
19 "
20   doctitlefr = "Positionnement des segno et coda (avec saut de ligne)"
21
22   texidoc = "
23 If you want to place an exiting segno sign and add text like @qq{D.S.
24 al Coda} next to it where usually the staff lines are you can use this
25 snippet. The coda will resume in a new line. There is a variation
26 documented in this snippet, where the coda will remain on the same
27 line.
28
29 "
30   doctitle = "Positioning segno and coda (with line break)"
31 } % begin verbatim
32
33
34 {
35   \clef treble
36   \key g \major
37   \time 4/4
38   \relative c'' {
39     \repeat unfold 2 {
40       | c4 c c c
41     }
42
43     % Set segno sign as rehearsal mark and adjust size if needed
44     % \once \override Score.RehearsalMark #'font-size = #3
45     \mark \markup { \musicglyph #"scripts.segno" }
46     \repeat unfold 2 {
47       | c4 c c c
48     }
49
50     % Set coda sign as rehearsal mark and adjust size if needed
51     \once \override Score.RehearsalMark #'font-size = #4
52     \mark \markup { \musicglyph #"scripts.coda" }
53     \repeat unfold 2 {
54       | c4 c c c
55     }
56
57     % Should Coda be on anew line?
58     % Coda NOT on new line: use \nobreak
59     % Coda on new line: DON'T use \nobreak
60     % \noBreak
61
62     \bar "||"
63
64     % Set segno sign as rehearsal mark and adjust size if needed
65     \once \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible
66     % \once \override Score.RehearsalMark #'font-size = #3
67     \mark \markup { \musicglyph #"scripts.segno" }
68
69     % Here begins the trickery!
70     % \cadenzaOn will suppress the bar count and \stopStaff removes the staff lines.
71     \cadenzaOn
72       \stopStaff
73         % Some examples of possible text-displays
74
75         % text line-aligned
76         % ==================
77         % Move text to the desired position
78         % \once \override TextScript #'extra-offset = #'( 2 . -3.5 )
79         % | s1*0^\markup { D.S. al Coda } }
80
81         % text center-aligned
82         % ====================
83         % Move text to the desired position
84         % \once \override TextScript #'extra-offset = #'( 6 . -5.0 )
85         % | s1*0^\markup { \center-column { D.S. "al Coda" } }
86
87         % text and symbols center-aligned
88         % ===============================
89         % Move text to the desired position and tweak spacing for optimum text alignment
90         %\once \override TextScript #'extra-offset = #'( 8 . -5.5 )
91         \once \override TextScript #'word-space = #1.5
92         \once \override TextScript #'X-offset = #8
93         \once \override TextScript #'Y-offset = #1.5
94         | s1*0^\markup { \center-column { "D.S. al Coda" \line { \musicglyph #"scripts.coda" \musicglyph #"scripts.tenuto" \musicglyph #"scripts.coda"} } }
95
96         % Increasing the unfold counter will expand the staff-free space
97         \repeat unfold 4 {
98           s4 s4 s4 s4
99           \bar ""
100         }
101         % Resume bar count and show staff lines again
102      \startStaff
103    \cadenzaOff
104
105    % Should Coda be on new line?
106    % Coda NOT on new line: DON'T use \break
107    % Coda on new line: use \break
108    \break
109
110    % Show up, you clef and key!
111    \once \override Staff.KeySignature #'break-visibility = #end-of-line-invisible
112    \once \override Staff.Clef #'break-visibility = #end-of-line-invisible
113
114    % Set coda sign as rehearsal mark and adjust size and position
115
116    % Put the coda sign ontop of the (treble-)clef dependend on coda's line-position
117
118      % Coda NOT on new line, use this:
119      % \once \override Score.RehearsalMark #'extra-offset = #'( -2 . 1.75 )
120
121      % Coda on new line, use this:
122      \once \override Score.RehearsalMark #'extra-offset = #'( -8.42 . 1.75 )
123
124    \once \override Score.RehearsalMark #'font-size = #5
125    \mark \markup { \musicglyph #"scripts.coda" }
126
127    % The coda
128    \repeat unfold 5 {
129       | c4 c c c
130     }
131     \bar"|."
132   }
133 }
134