<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="dumpk4">
  <refmeta>
    <refentrytitle>dumpk4</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>dumpk4</refname>
    <refpurpose>
      Periodically writes four orchestra control-signal values to an external file.
      <indexterm id="IndexDumpk4"><primary>dumpk4</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Periodically writes four orchestra control-signal values to a named external file in a specific format.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>dumpk4</command> ksig1, ksig2, ksig3, ksig4, ifilname, iformat, iprd</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ifilname</emphasis> -- character string (in double quotes, spaces permitted) denoting the external file name. May either be a full path name with target directory specified or a simple filename to be created within the current directory
    </para>

    <para>
      <emphasis>iformat</emphasis> -- specifies the output data format:
      <itemizedlist>
        <listitem>
          <para>1 = 8-bit signed char(high order 8 bits of a 16-bit integer</para>
        </listitem>

        <listitem>
          <para>4 = 16-bit short integers</para>
        </listitem>

        <listitem>
          <para>5 = 32-bit long integers</para>
        </listitem>

        <listitem>
          <para>6 = 32-bit floats, 7=ASCII long integers</para>
        </listitem>

        <listitem>
          <para>8 = ASCII floats (2 decimal places)</para>
        </listitem>
      </itemizedlist>
    </para>

    <para>
      Note that A-law and U-law output are not available, and that all formats except the lsat two are binary. The output file contains no header information.
    </para>

    <para>
      <emphasis>iprd</emphasis> -- the period of <emphasis>ksig</emphasis> output i seconds, rounded to the nearest orchestra control period. A value of 0 implies one control period (the enforced minimum), which will create an output file sampled at the orchestra control rate.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>ksig1, ksig2, ksig3, ksig4</emphasis> -- control-rate signals
    </para>

    <para>
      This opcode allows four generated control signal values to be saved in a named external file. The file contains no self-defining header information. But it contains a regularly sampled time series, suitable for later input or analysis. There may be any number of <emphasis>dumpk4</emphasis> opcodes in an instrument or orchestra but each must write to a different file.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      <informalexample>
        <programlisting>
knum    <emphasis>=</emphasis>         knum+1                                               ; at each k-period
ktemp   <emphasis>tempest</emphasis>   krms, .02, .1, 3, 2, 800, .005, 0, 60, 4, .1, .995   ;estimate the tempo
koct    <emphasis>specptrk</emphasis>  wsig, 6, .9, 0                                       ;and the pitch
        <emphasis>dumpk3</emphasis>    knum, ktemp, cpsoct(koct), &quot;what happened when&quot;, 8 0 ;&amp; save them
        </programlisting>
      </informalexample>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="dumpk"><citetitle>dumpk</citetitle></link>,
      <link linkend="dumpk2"><citetitle>dumpk2</citetitle></link>,
      <link linkend="dumpk3"><citetitle>dumpk3</citetitle></link>,
      <link linkend="readk"><citetitle>readk</citetitle></link>,
      <link linkend="readk2"><citetitle>readk2</citetitle></link>,
      <link linkend="readk3"><citetitle>readk3</citetitle></link>,
      <link linkend="readk4"><citetitle>readk4</citetitle></link>
    </para>
  </refsect1>
</refentry>
