Debian Codegraph @

opcodes/schedkwhen.xml

raw symbols SCIP
1
2 <refentry id="schedkwhen">
3 <indexterm id="IndexSchedkwhen"><primary>schedkwhen</primary></indexterm>
4 <refentryinfo><title>Instrument Control:Invocation</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>schedkwhen</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>schedkwhen</refname>
11 <refpurpose>
12 Adds a new score event generated by a k-rate trigger.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 Adds a new score event generated by a k-rate trigger.
20 </para>
21 </refsect1>
22
23 <refsect1>
24 <title>Syntax</title>
25
26 <synopsis><command>schedkwhen</command> ktrigger, kmintim, kmaxnum, kinsnum, kwhen, kdur \
27 [, ip4] [, ip5] [...]</synopsis>
28 <synopsis><command>schedkwhen</command> ktrigger, kmintim, kmaxnum, &quot;insname&quot;, kwhen, kdur \
29 [, ip4] [, ip5] [...]</synopsis>
30 </refsect1>
31
32 <refsect1>
33 <title>Initialization</title>
34 <para>
35 <emphasis><quote>insname</quote></emphasis> -- A string (in double-quotes) representing a named instrument.
36 </para>
37
38 <para>
39 <emphasis>ip4, ip5, ...</emphasis> -- Equivalent to p4, p5, etc., in a score <link linkend="i"><citetitle>i statement</citetitle></link>
40 </para>
41 </refsect1>
42
43 <refsect1>
44 <title>Performance</title>
45 <para>
46 <emphasis>ktrigger</emphasis> -- triggers a new score event. If <emphasis>ktrigger</emphasis> = 0, no new event is triggered.
47 </para>
48
49 <para>
50 <emphasis>kmintim</emphasis> -- minimum time between generated events, in seconds. If <emphasis>kmintim</emphasis> &lt;= 0, no time limit exists. If the <emphasis>kinsnum</emphasis> is negative (to turn off an instrument), this test is bypassed.
51 </para>
52
53 <para>
54 <emphasis>kmaxnum</emphasis> -- maximum number of simultaneous instances of instrument <emphasis>kinsnum</emphasis> allowed. If the number of existant instances of <emphasis>kinsnum</emphasis> is &gt;= <emphasis>kmaxnum</emphasis>, no new event is generated. If <emphasis>kmaxnum</emphasis> is &lt;= 0, it is not used to limit event generation. If the <emphasis>kinsnum</emphasis> is negative (to turn off an instrument), this test is bypassed.
55 </para>
56
57 <para>
58 <emphasis>kinsnum</emphasis> -- instrument number. Equivalent to p1 in a score <link linkend="i"><citetitle>i statement</citetitle></link>.
59 </para>
60
61 <para>
62 <emphasis>kwhen</emphasis> -- start time of the new event. Equivalent to p2 in a score <link linkend="i"><citetitle>i statement</citetitle></link>. Measured from the time of the triggering event. <emphasis>kwhen</emphasis> must be &gt;= 0. If <emphasis>kwhen</emphasis> &gt; 0, the instrument will not be initialized until the actual time when it should start performing.
63 </para>
64
65 <para>
66 <emphasis>kdur</emphasis> -- duration of event. Equivalent to p3 in a score <link linkend="i"><citetitle>i statement</citetitle></link>. If <emphasis>kdur</emphasis> = 0, the instrument will only do an initialization pass, with no performance. If <emphasis>kdur</emphasis> is negative, a held note is initiated. (See <link linkend="ihold"><citetitle>ihold</citetitle></link> and <link linkend="i"><citetitle>i statement</citetitle></link>.)
67 </para>
68
69 <note>
70 <para>While waiting for events to be triggered by <emphasis>schedkwhen</emphasis>, the performance must be kept going, or Csound may quit if no score events are expected. To guarantee continued performance, an <link linkend="f"><citetitle>f0 statement</citetitle></link> may be used in the score.</para>
71 </note>
72
73 <note>
74 <para> Note that the <emphasis>schedkwhen</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>
75 </note>
76 </refsect1>
77
78 <refsect1>
79 <title>Examples</title>
80 <para>
81 Here is an example of the schedkwhen opcode. It uses the file <ulink url="examples/schedkwhen.csd"><citetitle>schedkwhen.csd</citetitle></ulink>.
82
83 <example>
84 <title>Example of the schedkwhen opcode.</title>
85 <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>
86 <xi:include href="examples-xml/schedkwhen.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
87 </example>
88 <para>
89 A musical example featuring the schedkwhen opcode: <ulink url="examples/musical/schedkwhen_Daughtrey.csd"><citetitle>schedkwhen_Daughtrey.csd</citetitle></ulink> by Scott Daughtrey.
90 </para>
91 </para>
92 </refsect1>
93
94 <refsect1>
95 <title>See also</title>
96 <para><link linkend="ControlInvocat"><citetitle>Instrument Invocation</citetitle></link></para>
97 </refsect1>
98
99 <refsect1>
100 <title>Credits</title>
101 <para>
102 <simplelist>
103 <member>Author: Rasmus Ekman</member>
104 <member>EMS, Stockholm, Sweden</member>
105 </simplelist>
106 </para>
107 <para>Example written by &namekevin;.</para>
108
109 <para>New in Csound version 3.59</para>
110 </refsect1>
111 </refentry>