<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="printk2">
  <refmeta>
    <refentrytitle>printk2</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>printk2</refname>
    <refpurpose>
      Prints a new value every time a control variable changes.
      <indexterm id="IndexPrintk2"><primary>printk2</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Prints a new value every time a control variable changes.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>printk2</command> kvar [, inumspaces]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>inumspaces</emphasis> (optional, default=0) -- number of space characters printed before the value of <emphasis>kvar</emphasis>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kvar</emphasis> -- signal to be printed
    </para>

    <para>
      Derived from Robin Whittle's <emphasis>printk</emphasis>, prints a new value of <emphasis>kvar</emphasis> each time <emphasis>kvar</emphasis> changes. Useful for monitoring MIDI control changes when using sliders.
    </para>

    <warning>
      <para>
        <emphasis>WARNING!</emphasis> Don't use this opcode with normal, continuously variant k-signals, because it can hang the computer, as the rate of printing is too fast.
      </para>
    </warning>
  </refsect1>

  <refsect1>
    <title>Examples</title>

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

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

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

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

      Its output should include a line like this:
      <screen>
 i1     1.00000
 i1     2.00000
      </screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="printk"><citetitle>printk</citetitle></link> and
      <link linkend="printks"><citetitle>printks</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namegabriel;</member>
        <member>Italy</member>
        <member>1998</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>

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