<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="shaker">
  <refmeta>
    <refentrytitle>shaker</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>shaker</refname>
    <refpurpose>
      Sounds like the shaking of a maraca or similar gourd instrument.
      <indexterm id="IndexShaker"><primary>shaker</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Audio output is a tone related to the shaking of a maraca or similar gourd instrument. The method is a physically inspired model developed from &nameperry;, but re-coded for Csound.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ar <command>shaker</command> kamp, kfreq, kbeans, kdamp, ktimes [, idecay]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>idecay</emphasis> -- If present indicates for how long at the end of the note the shaker is to be damped. The default value is zero.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      A note is played on a maraca-like instrument, with the arguments as below.
    </para>

    <para>
      <emphasis>kamp</emphasis> -- Amplitude of note.
    </para>

    <para>
      <emphasis>kfreq</emphasis> -- Frequency of note played.
    </para>

    <para>
      <emphasis>kbeans</emphasis> -- The number of beans in the gourd. A value of 8 seems suitable,
    </para>

    <para>
      <emphasis>kdamp</emphasis> -- The damping value of the shaker. Values of 0.98 to 1 seems suitable, with 0.99 a reasonable default.
    </para>

    <para>
      <emphasis>ktimes</emphasis> -- Number of times shaken.
    </para>
 
    <note>
      <title>Note</title>
      <para>
        The argument <emphasis>knum</emphasis> was redundant, so it was removed in version 3.49.
      </para>
    </note>
  </refsect1>

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

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

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

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/shaker.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namejohn; (after &nameperry;)</member>
        <member>University of Bath, Codemist Ltd.</member>
        <member>Bath, UK</member>
      </simplelist>
    </para>

    <para>New in Csound version 3.47</para>
    <para>Fixed the example thanks to a message from &nameistvan;.</para>
  </refsect1>
</refentry>
