| 1 | |
| 2 | <refentry id="event"> |
| 3 | <indexterm id="IndexEvent"><primary>event</primary></indexterm> |
| 4 | <refentryinfo><title>Instrument Control:Invocation</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>event</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>event</refname> |
| 11 | <refpurpose> |
| 12 | Generates a score event from an instrument. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Generates a score event from an instrument. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis><command>event</command> "scorechar", kinsnum, kdelay, kdur, [, kp4] [, kp5] [, ...]</synopsis> |
| 26 | <synopsis><command>event</command> "scorechar", "insname", kdelay, kdur, [, kp4] [, kp5] [, ...]</synopsis> |
| 27 | </refsect1> |
| 28 | |
| 29 | <refsect1> |
| 30 | <title>Initialization</title> |
| 31 | <para> |
| 32 | <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>. |
| 33 | </para> |
| 34 | |
| 35 | <para> |
| 36 | <emphasis><quote>insname</quote></emphasis> -- A string (in double-quotes) representing a named instrument. |
| 37 | </para> |
| 38 | </refsect1> |
| 39 | |
| 40 | <refsect1> |
| 41 | <title>Performance</title> |
| 42 | <para> |
| 43 | <emphasis>kinsnum</emphasis> -- The instrument to use for the event. This corresponds to the first p-field, p1, in a score statement. |
| 44 | </para> |
| 45 | |
| 46 | <para> |
| 47 | <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. |
| 48 | </para> |
| 49 | |
| 50 | <para> |
| 51 | <emphasis>kdur</emphasis> -- How long (in seconds) the event will happen. This corresponds to the third p-field, p3, in a score statement. |
| 52 | </para> |
| 53 | |
| 54 | <para> |
| 55 | <emphasis>kp4, kp5, ...</emphasis> (optional) -- Parameters representing additional p-field in a score statement. It starts with the fourth p-field, p4. |
| 56 | </para> |
| 57 | <note> |
| 58 | <para> Note that the <emphasis>event</emphasis> opcode cannot accept string p-fields. If you need to pass strings when instantiating an instrument, use the <link linkend="scoreline"><citetitle>scoreline</citetitle></link> or <link linkend="scoreline_i"><citetitle>scoreline_i</citetitle></link> opcode.</para> |
| 59 | </note> |
| 60 | </refsect1> |
| 61 | |
| 62 | <refsect1> |
| 63 | <title>Examples</title> |
| 64 | <para> |
| 65 | Here is an example of the event opcode. It uses the file <ulink url="examples/event.csd"><citetitle>event.csd</citetitle></ulink>. |
| 66 | |
| 67 | <example> |
| 68 | <title>Example of the event opcode.</title> |
| 69 | |
| 70 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 71 | <xi:include href="examples-xml/event.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 72 | </example> |
| 73 | </para> |
| 74 | |
| 75 | <para> |
| 76 | Here is an example of the event opcode using a named instrument. It uses the file <ulink url="examples/event_named.csd"><citetitle>event_named.csd</citetitle></ulink>. |
| 77 | |
| 78 | <example> |
| 79 | <title>Example of the event opcode using a named instrument.</title> |
| 80 | |
| 81 | <xi:include href="examples-xml/event_named.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 82 | </example> |
| 83 | </para> |
| 84 | </refsect1> |
| 85 | |
| 86 | <refsect1> |
| 87 | <title>See also</title> |
| 88 | <para><link linkend="ControlInvocat"><citetitle>Instrument Invocation</citetitle></link></para> |
| 89 | </refsect1> |
| 90 | |
| 91 | <refsect1> |
| 92 | <title>Credits</title> |
| 93 | <para>Examples written by &namekevin;.</para> |
| 94 | <para>New in version 4.17</para> |
| 95 | <para>Thanks goes to Matt Ingalls for helping to fix the example.</para> |
| 96 | <para>Thanks goes to Matt Ingalls for helping clarify the kwhen/kdelay parameter.</para> |
| 97 | </refsect1> |
| 98 | </refentry> |