<!-- Converted to DocBook/SGML by Kevin Conder -->
<chapter id="OrchTop">
  <title>Syntax of the Orchestra</title>

  <para>
    An orchestra statement in Csound has the format:

    <synopsis>
      label:   result <function>opcode</function> <parameter>argument1</parameter>, <parameter>argument2</parameter>, <parameter>...</parameter> ;comments
    </synopsis>
  </para>

  <para>
    The label is optional and identifies the basic statement that follows as the potential target of a go-to operation (see <link linkend="ControlPgmctl"><citetitle>Program Flow Control</citetitle></link>). A label has no effect on the statement per se.
  </para>

  <para>
     Comments are optional and are for the purpose of letting the user document his orchestra code. Comments always begin with a semicolon (;) and extend to the end of the line.
  </para>

  <para>
    The remainder (result, opcode, and arguments) form the basic statement. This also is optional, i.e. a line may have only a label or comment or be entirely blank. If present, the basic statement must be complete on one line, and is terminated by a carriage return and line feed. 
  </para>

  <para>
    The opcode determines the operation to be performed; it usually takes some number of input values (or arguments, with a maximum value of about 800); and it usually has a result field variable to which it sends output values at some fixed rate. There are four possible rates:
    <orderedlist numeration="arabic">
      <listitem>
        <para>once only, at orchestra setup time (effectively a permanent assignment)</para>
      </listitem>

      <listitem>
        <para>once at the beginning of each note (at initialization (init) time: i-rate)</para>
      </listitem>

      <listitem>
        <para>once every performance-time control loop (perf-time control rate, or k-rate)</para>
      </listitem>

      <listitem>
        <para>once each sound sample of every control loop (perf-time audio rate, or a-rate)</para>
      </listitem>
    </orderedlist>
  </para>

  &orchdirfiles;
  &orchnomen;
  &orchstatemnt;
  &orchkvar;
  &orchexpress;
  &orchheader;
  &orchiblock;
  &orchvarinit;

</chapter>
