<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="maxalloc">
  <refmeta>
    <refentrytitle>maxalloc</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>maxalloc</refname>

    <refpurpose>
      Limits the number of allocations of an instrument.
      <indexterm id="IndexMaxalloc"><primary>maxalloc</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Limits the number of allocations of an instrument.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis><command>maxalloc</command> insnum, icount</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>insnum</emphasis> -- instrument number
    </para>

    <para>
      <emphasis>icount</emphasis> -- number of instrument allocations
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      All instances of <emphasis>maxalloc</emphasis> must be defined in the header section, not in the instrument body.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the maxalloc opcode. It uses the files <ulink url="examples/maxalloc.orc"><citetitle>maxalloc.orc</citetitle></ulink> and <ulink url="examples/maxalloc.sco"><citetitle>maxalloc.sco</citetitle></ulink>.

      <example>
        <title>Example of the maxalloc opcode.</title>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/maxalloc.orc" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/maxalloc.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>

      Its output should contain a message like this:
      <screen>
WARNING: cannot allocate last note because it exceeds instr maxalloc
      </screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="cpuprc"><citetitle>cpuprc</citetitle></link>, <link linkend="prealloc"><citetitle>prealloc</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namegabriel;</member>
        <member>Italy</member>
        <member>July 1999</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>

    <para>New in Csound version 3.57</para>
  </refsect1>
</refentry>
