VocalEasel/mma/docs/html/ref/node17.html

285 lines
7.4 KiB
HTML
Raw Normal View History

2006-11-10 08:07:56 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 2002-2-1 (1.71)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
2007-04-29 06:47:40 +00:00
<TITLE>Repeats</TITLE>
<META NAME="description" CONTENT="Repeats">
2006-11-10 08:07:56 +00:00
<META NAME="keywords" CONTENT="mma">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="mma.css">
<LINK REL="next" HREF="node18.html">
<LINK REL="previous" HREF="node16.html">
<LINK REL="up" HREF="mma.html">
<LINK REL="next" HREF="node18.html">
</HEAD>
<BODY bgcolor="#ffffff">
<!--Navigation Panel-->
2007-04-29 06:47:40 +00:00
<A NAME="tex2html575"
2006-11-10 08:07:56 +00:00
HREF="node18.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
2007-04-29 06:47:40 +00:00
<A NAME="tex2html573"
2006-11-10 08:07:56 +00:00
HREF="mma.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
2007-04-29 06:47:40 +00:00
<A NAME="tex2html567"
2006-11-10 08:07:56 +00:00
HREF="node16.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<BR>
2007-04-29 06:47:40 +00:00
<B> Next:</B> <A NAME="tex2html576"
HREF="node18.html">Variables, Conditionals and Jumps</A>
<B> Up:</B> <A NAME="tex2html574"
2006-11-10 08:07:56 +00:00
HREF="mma.html">Reference Manual</A>
2007-04-29 06:47:40 +00:00
<B> Previous:</B> <A NAME="tex2html568"
HREF="node16.html">Volume and Dynamics</A>
2006-11-10 08:07:56 +00:00
<BR>
<BR>
<!--End of Navigation Panel-->
2007-04-29 06:47:40 +00:00
<H1><A NAME="SECTION001700000000000000000"></A> <A NAME="sec-repeat"></A>
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
Repeats
2006-11-10 08:07:56 +00:00
</H1>
<P>
2007-04-29 06:47:40 +00:00
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> attempts to be as comfortable to use as standard sheet music.
This includes <I>repeats</I> and <I>endings</I>.
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
More complex structures like <I>D.S.</I>, <I>Coda</I>, etc. are
<I>not</I> directly supported. But, they are easily simulated with by
using some simple variables, conditionals and G<SMALL>OTO</SMALL>s. See
<A HREF="node18.html#sec-variables">Variables</A> for details.
Often as not, it may be easier to use your editor to cut, paste and
duplicate. Another, alternate, method of handling complicated repeats
is to set sections of code in M<SMALL>SET</SMALL> (<A HREF="node18.html#sec-mset">more
here</A>) variables and simply expand those.
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
A section of music to be repeated is indicated with a R<SMALL>EPEAT</SMALL>
and R<SMALL>EPEATEND</SMALL> or E<SMALL>ND</SMALL>R<SMALL>EPEAT</SMALL><A NAME="tex2html57"
HREF="#foot7017"><SUP>17.1</SUP></A> In addition, you can have R<SMALL>EPEAT</SMALL>E<SMALL>NDINGS</SMALL>.
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="#efefef" Border=3>
<tr><td Align="CENTER" BGColor="White">
<B><FONT SIZE="+2">Repeats</FONT></B> <A NAME="eg-repeat"></A>
</tr> </td>
<tr> <td >
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
<IMG WIDTH="95%" SRC="mupex/repeat.png" ALT="Lost Image">
<BR>
2006-11-10 08:07:56 +00:00
<BR>
<BR>
<BR>
<P>
2007-04-29 06:47:40 +00:00
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>Repeat
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
1 Am
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
2 C
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
RepeatEnding 2
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
3 D7
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
RepeatEnding
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
4 D7 / Dm
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
RepeatEnd
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
5 G7
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
6 A </B>
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
</td> </tr>
</Table>
2006-11-10 08:07:56 +00:00
<P>
<P>
2007-04-29 06:47:40 +00:00
In <A HREF="#eg-repeat">this example</A>
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> produces
music with bars:
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
<BLOCKQUOTE>
1, 2, 3,
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
1, 2, 3,
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
1, 2, 4,
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
1, 2, 5, 6
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</BLOCKQUOTE>
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
This works just like standard sheet music. Note that both
R<SMALL>EPEAT</SMALL>E<SMALL>NDING</SMALL> and R<SMALL>EPEAT</SMALL>E<SMALL>ND</SMALL> can take an optional argument
indicating the number of times to use the ending or to repeat the
block. The effect of an optional count for R<SMALL>EPEAT</SMALL>E<SMALL>NDING</SMALL> is
illustrated in the example, above. The following simple example:
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>Repeat
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
1&nbsp; Am
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
2&nbsp; Cm
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
RepeatEnd 3 </B>
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
Will expand to:
<BLOCKQUOTE>
1, 2,
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
1, 2,
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
1, 2
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</BLOCKQUOTE>
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
Note that the optional argument ``3'' produces a total of three
copies. The default argument for R<SMALL>EPEAT</SMALL> is ``2''. Using ``1''
cancels the R<SMALL>EPEAT</SMALL> and ``0'' deletes the entire section. Using
``1'' and ``0'' are useful in setting up Coda sections where you want
a different count the second time the section is played. Note that the
count argument can be a macro. Have a look at the sample file
<TT><B>repeats.mma</B></TT> for lots of examples.
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
Combining optional counts with both R<SMALL>EPEAT</SMALL>E<SMALL>NDING</SMALL> and
R<SMALL>EPEAT</SMALL>E<SMALL>ND</SMALL> is permitted. Another example:
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>Repeat
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
1 Am
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
2 C
<BR>
RepeatEnding 2
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
3 D7
<BR>
RepeatEnd 2 </B>
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
Produces:
<BLOCKQUOTE>
1, 2, 3,
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
1, 2, 3,
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
1, 2,
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
1, 2
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</BLOCKQUOTE>
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> processes repeats by reading the input file and creating
duplicates of the repeated material. This means that a directive in
the repeated material would be processed multiple times. Unless you
know what you are doing, directives should not be inserted in repeat
sections. Be especially careful if you define a pattern inside a
repeat. Using T<SMALL>EMPO</SMALL> with a ``+'' or ``-'' will be problematic
as well.
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
Repeats can be nested to any level.
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
Some count values for R<SMALL>EPEAT</SMALL>E<SMALL>ND</SMALL> or E<SMALL>ND</SMALL>R<SMALL>EPEAT</SMALL> and
R<SMALL>EPEAT</SMALL>E<SMALL>NDING</SMALL> will generate a warning message. Using the
optional text <I>NoWarn</I> as the first argument will supress the
message:
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>Repeat
<BR>...
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
RepeatEnd Nowarn 1 </B>
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
There must be one R<SMALL>EPEAT</SMALL>E<SMALL>ND</SMALL> or E<SMALL>ND</SMALL>R<SMALL>EPEAT</SMALL> for every
R<SMALL>EPEAT</SMALL>. Any number of R<SMALL>EPEAT</SMALL>E<SMALL>NDING</SMALL>s can be included
before the R<SMALL>EPEAT</SMALL>E<SMALL>ND</SMALL>.
2006-11-10 08:07:56 +00:00
<BR><HR><H4>Footnotes</H4>
<DL>
2007-04-29 06:47:40 +00:00
<DT><A NAME="foot7017">...E<SMALL>ND</SMALL>R<SMALL>EPEAT</SMALL></A><A
HREF="node17.html#tex2html57"><SUP>17.1</SUP></A></DT>
<DD>The reason for both
E<SMALL>ND</SMALL>R<SMALL>EPEAT</SMALL> and R<SMALL>EPEAT</SMALL>E<SMALL>ND</SMALL> is to match I<SMALL>F</SMALL>E<SMALL>ND</SMALL> and
E<SMALL>ND</SMALL>I<SMALL>F</SMALL>.
2006-11-10 08:07:56 +00:00
</DD>
</DL><HR>
<!--Navigation Panel-->
2007-04-29 06:47:40 +00:00
<A NAME="tex2html575"
2006-11-10 08:07:56 +00:00
HREF="node18.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
2007-04-29 06:47:40 +00:00
<A NAME="tex2html573"
2006-11-10 08:07:56 +00:00
HREF="mma.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
2007-04-29 06:47:40 +00:00
<A NAME="tex2html567"
2006-11-10 08:07:56 +00:00
HREF="node16.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<BR>
2007-04-29 06:47:40 +00:00
<B> Next:</B> <A NAME="tex2html576"
HREF="node18.html">Variables, Conditionals and Jumps</A>
<B> Up:</B> <A NAME="tex2html574"
2006-11-10 08:07:56 +00:00
HREF="mma.html">Reference Manual</A>
2007-04-29 06:47:40 +00:00
<B> Previous:</B> <A NAME="tex2html568"
HREF="node16.html">Volume and Dynamics</A>
2006-11-10 08:07:56 +00:00
<!--End of Navigation Panel-->
<ADDRESS>
2007-04-29 06:47:40 +00:00
bob
2007-03-07
2006-11-10 08:07:56 +00:00
</ADDRESS>
</BODY>
</HTML>