next up previous
Next: Variables, Conditionals and Jumps Up: Reference Manaul Previous: Volume and Dynamics


Repeats

MMA attempts to be as comfortable to use as standard sheet music. This includes repeats and endings.

More complex structures like D.S., Coda, etc. are not directly supported. But, they are easily simulated with by using some simple variables, conditionals and gotos. See chapter 14 for details. Often as not, it may be easier to use your editor to cut, paste and duplicate.

A section of music to be repeated is indicated with a ``Repeat'' and ``Repeatend'' or ``EndRepeat''13.1. In addition, you can have ``RepeatEndings''.

Example 13.1: Repeats


\includegraphics[width=.9\textwidth]{mupex/repeat.ps}



    Repeat
1     Am
2     C
    RepeatEnding 2
3     D7
    RepeatEnding
4     D7 / Dm
    RepeatEnd
5     G7
6     A


In example 13.1 MMA produces music with bars:

1, 2, 3,
1, 2, 3,
1, 2, 4,
1, 2, 5, 6

This works just like standard sheet music. Note that RepeatEnding can take an optional argument indicating the number of times to use the ending.

MMA 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 ``Tempo'' with a ``+'' or ``-'' will be problematic as well.

Repeats can be nested to any level.

There must be one ``RepeatEnd'' or ``EndRepeat'' for every ``Repeat''. Any number of ``RepeatEnding''s can be included before the ``RepeatEnd''.


Footnotes

... ``EndRepeat''13.1
The reason for both ``EndRepeat'' and ``RepeatEnd'' is that we have both ``IfEnd'' and ``EndIf''.

next up previous
Next: Variables, Conditionals and Jumps Up: Reference Manaul Previous: Volume and Dynamics
2004-04-19