<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="event">
  <refmeta>
    <refentrytitle>event</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>event</refname>
    <refpurpose>
      Generates a score event from an instrument.
      <indexterm id="IndexEvent"><primary>event</primary></indexterm>
    </refpurpose>
  </refnamediv>
  
  <refsect1>
    <title>Description</title>
    <para>
      Generates a score event from an instrument.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis><command>event</command> &quot;scorechar&quot;, kinsnum, kdelay, kdur, [, kp4] [, kp5] [, ...]</synopsis>
    <synopsis><command>event</command> &quot;scorechar&quot;, &quot;insname&quot;, kdelay, kdur, [, kp4] [, kp5] [, ...]</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis><quote>scorechar</quote></emphasis> -- A string (in double-quotes) representing the first p-field in a score statement. This is usually <link linkend="e"><citetitle><quote>e</quote></citetitle></link>, <link linkend="f"><citetitle><quote>f</quote></citetitle></link>, or <link linkend="i"><citetitle><quote>i</quote></citetitle></link>.
    </para>

    <para>
      <emphasis><quote>insname</quote></emphasis> -- A string (in double-quotes) representing a named instrument.
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kinsnum</emphasis> -- The instrument to use for the event. This corresponds to the first p-field, p1, in a score statement.
    </para>

    <para>
      <emphasis>kdelay</emphasis> -- When (in seconds) the event will occur from the current performance time. This corresponds to the second p-field, p2, in a score statement.
    </para>

    <para>
      <emphasis>kdur</emphasis> -- How long (in seconds) the event will happen. This corresponds to the third p-field, p3, in a score statement.
    </para>

    <para>
      <emphasis>kp4, kp5, ...</emphasis> (optional) -- Parameters representing additional p-field in a score statement. It starts with the fourth p-field, p4.
    </para>
  </refsect1>

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

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

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

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

    <para>
      Here is an example of the event opcode using a named instrument. It uses the files <ulink url="examples/event_named.orc"><citetitle>event_named.orc</citetitle></ulink> and <ulink url="examples/event_named.sco"><citetitle>event_named.sco</citetitle></ulink>.

      <example>
        <title>Example of the event opcode using a named instrument.</title>

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

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

  <refsect1>
    <title>Credits</title>
    <para>Examples written by &namekevin;.</para>
    <para>New in version 4.17</para>
    <para>Thanks goes to Matt Ingalls for helping to fix the example.</para>
    <para>Thanks goes to Matt Ingalls for helping clarify the kwhen/kdelay parameter.</para>
  </refsect1>
</refentry>
