summaryrefslogtreecommitdiff
path: root/macros/musixtex/doc/musixdoc/repeats.tex
blob: a0c89b5f592bc7864e165dacfffb66b5779fa360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
\chapter{Repeats}

To replace a bar line with a left, right, or left-right repeat, use one of the
commands \keyindex{leftrepeat}, \keyindex{rightrepeat} or
\keyindex{leftrightrepeat} in place of \verb|\bar|. If a \verb|\leftrepeat|
happens to come at the end of a system, it will automatically be moved to the
start of the next system. If a \verb|\leftrightrepeat| happens to come at the
end of a system, \musixtex\ will automatically post a right repeat at the end
of the system and a left repeat at the beginning of the next.

For example,

\begin{music}\nostartrule
\startextract
\NOTes\ha g\en
\leftrepeat
\NOTes\ha h\en
\leftrightrepeat
\NOTes\ha i\en
\rightrepeat
\NOTEs\wh j\en
\zendextract
\end{music}
 \noindent has been coded as:
\begin{quote}\begin{verbatim}
\NOTes\ha g\en
\leftrepeat
\NOTes\ha h\en
\leftrightrepeat
\NOTes\ha i\en
\rightrepeat
\NOTEs\wh j\en
\end{verbatim}\end{quote}

To insert a right-repeat at a forced line break or at the end of a piece, use
\verb|\setrightrepeat| \textit{before}\ \verb|\alaligne| or \verb|\endpiece|.
In fact it is possible to use \keyindex{setleftrepeat},
\keyindex{setrightrepeat} or \keyindex{setleftrightrepeat} before any
\keyindex{bar}, \keyindex{stoppiece} or \keyindex{changecontext}; but
be aware that whereas \verb|\setrightrepeat| behaves properly if the bar is at the
end of a system, \verb|\setleftrepeat| and \verb|\setleftrightrepeat| do not,
placing
the left-repeat symbol at the end of the system rather
than at the beginning of the next system; see the 
\verb|\zleftrepeat| \verb|\zzleftrepeat| \verb|\zzleftrightrepeat| 
and \verb|\zzleftrightrepeat| commands described below.


The following commands generate repeat symbols as usual, but
are assumed to be in the \emph{middle} of a bar; that is,
the bar counter is not incremented:
\begin{itemize}
\item[] \keyindex{zrightrepeat}
\item[] \keyindex{zleftrepeat}
\item[] \keyindex{zleftrightrepeat}
\end{itemize}
For example, to insert a left-repeat at a forced line break or at the
beginning of a piece, simply use \verb|\zleftrepeat| immediately \textit{after}
\verb|\startpiece| or \verb|\alaligne|. To insert a left-right repeat at a
forced line break, use \verb|\setrightrepeat\alaligne\zleftrepeat|. 

The following commands are similar but force the mid-bar break to the
end of a system:
\begin{itemize}
\item[] \keyindex{zzrightrepeat}
\item[] \keyindex{zzleftrepeat}
\item[] \keyindex{zzleftrightrepeat}
\end{itemize}
For
\verb|\zzleftrepeat| and \verb|\zzleftrightrepeat|, the left-repeats occur
at the beginning of the following system. The bar numbers are
correctly adjusted, using \keyindex{writezbarno} for the continuation
if \keyindex{systemnumbers} is in use. 

As an example, here is
a \emph{bourr\'ee} by G.-F.~Handel coded using \verb|\zleftrepeat| at the beginning
of the \textbf{A} section and \verb|\zzleftrightrepeat| 
between the \textbf{A} and the \textbf{B} sections:

\begin{music}
\smallmusicsize
\generalmeter{\allabreve}
\generalsignature{1}
\startbarno=0
\nobarnumbers
\nostartrule
\startpiece\addspace\afterruleskip
\systemnumbers
\zleftrepeat%
\znotes\ccn{10}{\boxit{\bf A}}\en
\NOtes\qa d\en%
\bar%1
\NOtes\qa{g}\qa{i}\qa{h}\qa{g}\en%
\bar%2
\NOTes\ha{k}\ha{i}\en%
\bar%3
\NOtes\qa{l}\qa{k}\qa{j}\qa{i}\en%
\bar%4
\NOtes\qa j\en
\NOTes\ha i\en%
\zzleftrightrepeat%
\znotes\ccn{10}{\boxit{\bf B}}\en
\NOtes\qa k\en%
\bar%5
\NOtes\qa{l}\qa{j}\qa{h}\en
\Notes\ibl3i2\qb3i\tql3j\en%
\bar%6
\NOtes\qa{k}\qa{i}\qa{g}\en
\Notes\ibu3h2\qb3h\tqu3i\en%
\bar%7
\NOtes\qa{j}\qa{i}\qa{h}\qa{g}\en%
\bar%8
\Notes\ibu3h1\qb3{h}\qb3{g}\qb3{h}\tqu3i\en
\NOtes\qa h\en
\Notes\ibl3i2\qb3i\tql3j\en%
\bar%9
\NOtes\qa k\en
\Notes\ibl3i2\qb3i\tql3j\en
\NOtes\qa k\en
\Notes\ibl3j{-2}\qb3j\tql3i\en%
\bar%10
\NOtes\qa j\en
\Notes\ibu3h2\qb3h\tqu3i\en
\NOtes\qa j\en
\Notes\ibu3i{-2}\qb3i\tqu3h\en%
\bar%11
\NOtes\qa{i}\qa{g}\en
\NOtesp\tr{11}\qa{.h}\en
\Notes\ca g\en%
\bar%12
\NOTesp\ha{.g}\en%
\setrightrepeat%
\endpiece%
\end{music}

\noindent No explicit adjustment of \verb|\barno| was necessary.  The right-repeat
at the end of the \textbf{B}~section was produced by
\verb|\setrightrepeat\endpiece|.



 \section{First and second endings (Voltas)}\index{volta}

All volta commands must be entered right before the bar line command
(or repeat, etc.) where they are to take effect. There are three
commands that suffice to set all voltas. To start one, use
\keyindex{Setvolta}\verb|{|\textit{text}\verb|}|; to terminate it
with or without a vertical line, use \keyindex{endvolta} or
\keyindex{endvoltabox} respectively. The text by default will be followed
by a period. There are also various alternate
commands (e.g., \verb|\setendvoltabox| is equivalent to \verb|\endvoltabox|).
Some such alternate forms are used in the following example, but the first three
mentioned above are all that are required:

\medskip \begin{music}
 \parindent0pt
 \nostartrule
 \startpiece
 \addspace\afterruleskip
 \NOTEs\wh a\en\bar
 \NOTEs\wh b\en\setvoltabox{1.-3}\bar
 \NOTEs\wh c\en\setvolta4\setendvolta\rightrepeat
 \NOTEs\wh d\en\doublebar
 \NOTEs\wh e\en\bar
 \NOTEs\wh f\en\leftrepeat
 \NOTEs\wh g\en\bar
 \NOTEs\wh h\en\Setvolta1\bar
 \NOTEs\wh i\en\bar
 \NOTEs\wh j\en\Setvolta2\setendvoltabox\rightrepeat
 \NOTEs\wh i\en\bar
 \NOTEs\wh h\en\setendvoltabox
 \Endpiece
 \end{music}
 \noindent This was coded as
 \begin{quote}\begin{verbatim}
 \startpiece \addspace\afterruleskip
 \NOTEs\wh a\en\bar
 \NOTEs\wh b\en\setvoltabox{1.-3}\bar
 \NOTEs\wh c\en\setvolta4\setendvolta\rightrepeat
 \NOTEs\wh d\en\doublebar
 \NOTEs\wh e\en\bar
 \NOTEs\wh f\en\leftrepeat
 \NOTEs\wh g\en\bar
 \NOTEs\wh h\en\Setvolta1\bar
 \NOTEs\wh i\en\bar
 \NOTEs\wh j\en\Setvolta2\setendvoltabox\rightrepeat
 \NOTEs\wh i\en\bar
 \NOTEs\wh h\en\setendvoltabox
 \Endpiece
\end{verbatim}\end{quote}
 \zkeyindex{leftrepeat}\zkeyindex{rightrepeat}

If the volta only spans one measure and ends without a vertical segment,
it can be specified simply by saying
\keyindex{setvolta}\verb|{|\textit{text}\verb|}| before the bar line command
that starts it, and it will automatically terminate at the
second bar line command:

\medskip \begin{music}
 \parindent0pt \nostartrule\startpiece \addspace\afterruleskip
 \NOTEs\wh a\en\bar
 \NOTEs\wh b\en\setvolta{1.-3}\bar \NOTEs\wh c\en\setvolta4\rightrepeat
 \NOTEs\wh d\en\bar
 \NOTEs\wh e\en\Endpiece
\end{music}
\noindent which was coded as:
 \begin{quote}\begin{verbatim}
 \parindent0pt \startpiece \addspace\afterruleskip
 \NOTEs\wh a\en\bar
 \NOTEs\wh b\en\setvolta{1.-3}\bar \NOTEs\wh c\en\setvolta4\rightrepeat
 \NOTEs\wh d\en\bar
 \NOTEs\wh e\en\Endpiece
\end{verbatim}\end{quote}

The height above the top staff line of the horizontal line in a volta symbol
is determined by the token \keyindex{raisevolta} which is \verb|4\internote| by
default. You can change this to any desired dimension.

The period after the text can be
removed by saying \verb|\def|\keyindex{voltadot}\verb|{}|
and restored by \verb|\def|\keyindex{voltadot}\verb|{.}|\ .

 \section{Special symbols for repeating long sections}

Four special symbols and corresponding macros are available, namely
\keyindex{coda}~$p$, \keyindex{Coda}~$p$,
and \keyindex{segno}~$p$, where $p$ specifies the pitch; and \keyindex{Segno}
with no argument. Their behavior is illustrated in this example:

\begin{music}
\startextract
\NOtes\segno n\en
\bar
\NOtes\coda n\en
\NOtes\Segno\en
\bar
\NOtes\Coda n\en
\endextract
\end{music}
\noindent which has been coded:
\begin{quote}\begin{verbatim}
\NOtes\segno m\en\bar
\NOtes\coda m\en
\NOtes\Segno\en\bar
\NOtes\Coda m\en
\end{verbatim}\end{quote}

\section{Repeating a single bar}
 The special symbol for a single-bar repeat is generated by \keyindex{duevolte}, as shown
in the following example:

\begin{music}
\generalmeter\meterC
\setclef1\bass\setstaffs1{2}
\startextract
\NOtes|\qa{cegj}\en
\def\atnextbar{\znotes\centerpause|\en}\bar
\NOtes\qa{cdef}|\en
\def\atnextbar{\znotes|\centerbar{\duevolte}\en}%
\endextract
\end{music}
\noindent whose coding is:
\begin{quote}\begin{verbatim}
\generalmeter\meterC
\setclef1\bass\setstaffs1{2}
\startextract
\NOtes|\qa{cegj}\en
\def\atnextbar{\znotes\centerpause|\en}\bar
\NOtes\qa{cdef}|\en
\def\atnextbar{\znotes|\centerbar{\duevolte}\en}%
\endextract
\end{verbatim}\end{quote}