Use Non-Frames Version Previous Page Next Page
Score Syntax: Statements

r Statement (Repeat Statement)

  r  p1  p2

Description

Starts a repeated section, which lasts until the next s, r or e statement.

P Fields

  p1    Number of times to repeat the section.
  p2    Macro(name) to advance with each repetition (optional).

Special Consdierations

In order that the sections may be more flexible than simple editing, the macro named p2 is given the value of 1 for the first time through the section, 2 for the second, and 3 for the third. This can be used to change p-field parameters, or ignored.

Warning: Because of serious problems of interaction with macro expansion, sections must start and end in the same file, and not in a macro.

Example

In the following example, the section is repeated 3 times. The macro NN is used and advanced with each repetiton.

  r3  NN       ;start of repreated section - use macro NN
      some code
      .
      .
      .
  s            ;end repeat - go back to previous r if repetitions < 3

Author

John ffitch
University of Bath/Codemist Ltd.
Bath, UK
April, 1998 (New in Csound version 3.48)


Use Non-Frames Version Previous Page Next Page
Score Syntax: Statements