Debian Codegraph @

opcodes/init.xml

raw symbols SCIP
1
2 <refentry id="init">
3 <indexterm id="IndexInit"><primary>init</primary></indexterm>
4 <refentryinfo><title>Instrument Control:Initialization and Reinitialization</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>init</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>init</refname>
11 <refpurpose>
12 Puts the value of the i-time expression into a k-, a-rate or t- variable.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Syntax</title>
18 <synopsis>ares <command>init</command> iarg</synopsis>
19 <synopsis>ires <command>init</command> iarg</synopsis>
20 <synopsis>kres <command>init</command> iarg</synopsis>
21 <synopsis>ares, ... <command>init</command> iarg, ...</synopsis>
22 <synopsis>ires, ... <command>init</command> iarg, ...</synopsis>
23 <synopsis>kres, ... <command>init</command> iarg, ...</synopsis>
24 <synopsis>tab <command>init</command> isize[, ival]</synopsis>
25 </refsect1>
26
27 <refsect1>
28 <title>Description</title>
29 <para>
30 Put the value of the i-time expression into a k- or a-rate variable.
31 </para>
32 </refsect1>
33
34 <refsect1>
35 <title>Initialization</title>
36 <para>
37 Puts the value of the i-time expression
38 <emphasis>iarg</emphasis> into a k-, a-rate or t- variable, i.e.,
39 initialize the result. Note that <emphasis
40 role="strong">init</emphasis> provides the only case of an
41 init-time statement being permitted to write into a perf-time
42 (k- or a-rate) result cell; the statement has no effect at
43 perf-time.
44 </para>
45 <para>
46 Since version 5.13 it is possible to initialise upto 24
47 variables of the same class in one statement. If there are more
48 output variables than input expressions then the last one is
49 repeated. It is an error to have more inputs than outputs.
50 </para>
51 <para>
52 The t-variable form was introduced in 5.14 and allocated space
53 for a vector or the given size, initialised to the given value
54 (default value is zero).
55 </para>
56 </refsect1>
57
58 <refsect1>
59 <title>Examples</title>
60 <para>
61 Here is an example of the init opcode. It uses the file <ulink url="examples/init.csd"><citetitle>init.csd</citetitle></ulink>.
62 <example>
63 <title>Example of the init opcode.</title>
64 <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>
65 <xi:include href="examples-xml/init.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
66 </example>
67 Its output should include lines like these:
68 <screen>
69 i 1 time 0.00073: 1.00000
70 i 1 time 0.10014: 138.00000
71 i 1 time 0.20027: 276.00000
72 i 1 time 0.30041: 414.00000
73 i 1 time 0.40054: 552.00000
74 i 1 time 0.50068: 690.00000
75 i 1 time 0.60009: 827.00000
76 i 1 time 0.70023: 965.00000
77 i 1 time 0.80036: 1103.00000
78 i 1 time 0.90050: 1241.00000
79
80 i 2 time 2.00054: 1.00000
81 i 2 time 2.09995: 1.00000
82 i 2 time 2.20009: 1.00000
83 i 2 time 2.30023: 1.00000
84 i 2 time 2.40036: 1.00000
85 i 2 time 2.50050: 1.00000
86 i 2 time 2.59991: 1.00000
87 i 2 time 2.70005: 1.00000
88 i 2 time 2.80018: 1.00000
89 i 2 time 2.90032: 1.00000
90 </screen>
91 </para>
92 </refsect1>
93
94 <refsect1>
95 <title>See also</title>
96 <para><link linkend="ControlReinitn"><citetitle>Initialization and Reinitialization</citetitle></link></para>
97 <para><link linkend="arrayOpcodes"><citetitle>Array opcodes</citetitle></link></para>
98 </refsect1>
99
100 <refsect1>
101 <title>Credits</title>
102 <para>
103 Init first appeared in the original Csound, but the extension to
104 multiple values is by
105 <simplelist>
106 <member>Author: &namejohn;</member>
107 <member>University of Bath, and Codemist Ltd.</member>
108 <member>Bath, UK</member>
109 <member>February 2010</member>
110 </simplelist>
111 </para>
112 <para>Multiple form new in version 5.13; t-variable form new in 5.14.</para>
113 </refsect1>
114 </refentry>