| 1 |
|
| 2 |
<refentry id="schedwhen"> |
| 3 |
<indexterm id="IndexSchedwhen"><primary>schedwhen</primary></indexterm> |
| 4 |
<refentryinfo><title>Instrument Control:Invocation</title></refentryinfo> |
| 5 |
<refmeta> |
| 6 |
<refentrytitle>schedwhen</refentrytitle> |
| 7 |
</refmeta> |
| 8 |
|
| 9 |
<refnamediv> |
| 10 |
<refname>schedwhen</refname> |
| 11 |
<refpurpose> |
| 12 |
Adds a new score event. |
| 13 |
</refpurpose> |
| 14 |
</refnamediv> |
| 15 |
|
| 16 |
<refsect1> |
| 17 |
<title>Description</title> |
| 18 |
<para> |
| 19 |
Adds a new score event. |
| 20 |
</para> |
| 21 |
</refsect1> |
| 22 |
|
| 23 |
<refsect1> |
| 24 |
<title>Syntax</title> |
| 25 |
<synopsis><command>schedwhen</command> ktrigger, kinsnum, kwhen, kdur [, ip4] [, ip5] [...]</synopsis> |
| 26 |
<synopsis><command>schedwhen</command> ktrigger, "insname", kwhen, kdur [, ip4] [, ip5] [...]</synopsis> |
| 27 |
</refsect1> |
| 28 |
|
| 29 |
<refsect1> |
| 30 |
<title>Initialization</title> |
| 31 |
<para> |
| 32 |
<emphasis>ip4, ip5, ...</emphasis> -- Equivalent to p4, p5, etc., in a score <link linkend="i"><citetitle>i statement</citetitle></link>. |
| 33 |
</para> |
| 34 |
</refsect1> |
| 35 |
|
| 36 |
<refsect1> |
| 37 |
<title>Performance</title> |
| 38 |
<para> |
| 39 |
<emphasis>kinsnum</emphasis> -- instrument number. Equivalent to p1 in a score <link linkend="i"><citetitle>i statement</citetitle></link>. |
| 40 |
</para> |
| 41 |
|
| 42 |
<para> |
| 43 |
<emphasis><quote>insname</quote></emphasis> -- A string (in double-quotes) representing a named instrument. |
| 44 |
</para> |
| 45 |
|
| 46 |
<para> |
| 47 |
<emphasis>ktrigger</emphasis> -- trigger value for new event |
| 48 |
</para> |
| 49 |
|
| 50 |
<para> |
| 51 |
<emphasis>kwhen</emphasis> -- start time of the new event. Equivalent to p2 in a score <link linkend="i"><citetitle>i statement</citetitle></link>. |
| 52 |
</para> |
| 53 |
|
| 54 |
<para> |
| 55 |
<emphasis>kdur</emphasis> -- duration of event. Equivalent to p3 in a score <link linkend="i"><citetitle>i statement</citetitle></link>. |
| 56 |
</para> |
| 57 |
|
| 58 |
<para> |
| 59 |
<emphasis>schedwhen</emphasis> adds a new score event. The event is only scheduled when the k-rate value <emphasis>ktrigger</emphasis> is first non-zero. The arguments, including options, are the same as in a score. The <emphasis>kwhen</emphasis> time (p2) is measured from the time of this event. |
| 60 |
</para> |
| 61 |
|
| 62 |
<para> |
| 63 |
If the duration is zero or negative the new event is of MIDI type, and inherits the release sub-event from the scheduling instruction. |
| 64 |
</para> |
| 65 |
|
| 66 |
<note> |
| 67 |
<para> Note that the <emphasis>schedwhen</emphasis> opcode can't 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> |
| 68 |
</note> |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
</refsect1> |
| 74 |
|
| 75 |
<refsect1> |
| 76 |
<title>Examples</title> |
| 77 |
<para> |
| 78 |
Here is an example of the schedwhen opcode. It uses the file <ulink url="examples/schedwhen.csd"><citetitle>schedwhen.csd</citetitle></ulink>. |
| 79 |
<example> |
| 80 |
<title>Example of the schedwhen opcode.</title> |
| 81 |
<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> |
| 82 |
<xi:include href="examples-xml/schedwhen.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 83 |
</example> |
| 84 |
</para> |
| 85 |
</refsect1> |
| 86 |
|
| 87 |
<refsect1> |
| 88 |
<title>See also</title> |
| 89 |
<para><link linkend="ControlInvocat"><citetitle>Instrument Invocation</citetitle></link></para> |
| 90 |
</refsect1> |
| 91 |
|
| 92 |
<refsect1> |
| 93 |
<title>Credits</title> |
| 94 |
<para> |
| 95 |
<simplelist> |
| 96 |
<member>Author: &namejohn;</member> |
| 97 |
<member>University of Bath/Codemist Ltd.</member> |
| 98 |
<member>Bath, UK</member> |
| 99 |
<member>November 1998</member> |
| 100 |
</simplelist> |
| 101 |
</para> |
| 102 |
<para>New in Csound version 3.491</para> |
| 103 |
<para>Based on work by &namegabriel;</para> |
| 104 |
</refsect1> |
| 105 |
</refentry> |