<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="mpulse">
  <refmeta>
    <refentrytitle>mpulse</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>mpulse</refname>
    <refpurpose>
      Generates a set of impulses.
      <indexterm id="IndexMpulse"><primary>mpulse</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Generates a set of impulses of amplitude <emphasis>kamp</emphasis> at frequency <emphasis>kfreq</emphasis>.  The first impulse is  after a delay of <emphasis>ioffset</emphasis> seconds. The value of <emphasis>kfreq</emphasis> is read only after an impulse, so it is the interval to the next impulse at the time of an impulse.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ar <command>mpulse</command> kamp, kfreq [, ioffset]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ioffset</emphasis> (optional, default=0) -- the delay before the first impulse. If it is negative, the value is taken as the number of samples, otherwise it is in seconds. Default is zero.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kamp</emphasis> -- amplitude of the impulses generated
    </para>

    <para>
      <emphasis>kfreq</emphasis> -- frequency of the impulse train
    </para>

    <para>
      After the initial delay, an impulse of <emphasis>kamp</emphasis> amplitude is generated as a single sample.  Immediately after generating the impulse, the time of the next one is calculated.  If <emphasis>kfreq</emphasis> is zero, there is an infinite wait to the next impulse.  If <emphasis>kfreq</emphasis> is negative, the frequency is counted in samples rather than seconds.

    </para>
  </refsect1>

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

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

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

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

  <refsect1>
    <title>Credits</title>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>
