<!-- Converted to DocBook/SGML by Kevin Conder -->
<chapter id="ZakTop">
  <title>Zak Patch System</title>

  <para>
    The zak opcodes are used to create a system for i-rate, k-rate or a-rate patching.  The zak system can be thought of as a global array of variables. These opcodes are useful for performing flexible patching or routing from one instrument to another. The system is similar to a patching matrix on a mixing console or to a modulation matrix on a synthesizer.  It is also useful whenever an array of variables is required.
  </para>

  <para>
    The zak system is initialized by the <link linkend="zakinit"><citetitle>zakinit</citetitle></link> opcode, which is usually placed just after the other global initializations: <emphasis>sr</emphasis>, <emphasis>kr</emphasis>, <emphasis>ksmps</emphasis>, <emphasis>nchnls</emphasis>. The <emphasis>zakinit</emphasis> opcode defines two areas of memory, one area for i- and k-rate patching, and the other area for a-rate patching. The <emphasis>zakinit</emphasis> opcode may only be called once. Once the zak space is initialized, other zak opcodes can be used to read from, and write to the zak memory space, as well as perform various other tasks.
  </para>

  <para>
    Opcodes for the zak patch system are
    <link linkend="zacl"><citetitle>zacl</citetitle></link>,
    <link linkend="zakinit"><citetitle>zakinit</citetitle></link>,
    <link linkend="zamod"><citetitle>zamod</citetitle></link>,
    <link linkend="zar"><citetitle>zar</citetitle></link>,
    <link linkend="zarg"><citetitle>zarg</citetitle></link>,
    <link linkend="zaw"><citetitle>zaw</citetitle></link>,
    <link linkend="zawm"><citetitle>zawm</citetitle></link>,
    <link linkend="zir"><citetitle>zir</citetitle></link>,
    <link linkend="ziw"><citetitle>ziw</citetitle></link>,
    <link linkend="ziwm"><citetitle>ziwm</citetitle></link>,
    <link linkend="zkcl"><citetitle>zkcl</citetitle></link>,
    <link linkend="zkmod"><citetitle>zkmod</citetitle></link>,
    <link linkend="zkr"><citetitle>zkr</citetitle></link>,
    <link linkend="zkw"><citetitle>zkw</citetitle></link>, and
    <link linkend="zkwm"><citetitle>zkwm</citetitle></link>.
  </para>
</chapter>
