summaryrefslogtreecommitdiff
path: root/opcodes/assign.xml
blob: 4a29dd97de9769e939c378cf8e4ef60bfa036611 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<refentry id="assign">
<indexterm id="IndexAssign"><primary>=</primary></indexterm>
  <refentryinfo><title>Instrument Control:Initialization and Reinitialization</title></refentryinfo>
  <refmeta>
    <refentrytitle>=</refentrytitle>
  </refmeta>



  <refnamediv>
    <refname>=</refname>

    <refpurpose>
       Performs a simple assignment.
           </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Syntax</title>
    <synopsis>ares <command>=</command> xarg</synopsis>
    <synopsis>ires <command>=</command> iarg</synopsis>
    <synopsis>kres <command>=</command> karg</synopsis>
    <synopsis>ires, ... <command>=</command> iarg, ...</synopsis>
    <synopsis>kres, ... <command>=</command> karg, ...</synopsis>
    <synopsis>table [ kval] <command>=</command> karg</synopsis>
  </refsect1>

  <refsect1>
    <title>Description</title>
    <para> 
      Performs a simple assignment.
    </para> 
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para> 
      <emphasis>=</emphasis> (simple assignment) - Put the value of the expression <emphasis>iarg</emphasis> (<emphasis>karg, xarg</emphasis>) into the named result. This provides a means of saving an evaluated result for later use.
    </para> 
    <para>
      From version 5.13 onwards the i- and k-rate versions of
      assignment can take a number of outputs, and an equal or less
      number of inputs.  If there are less the last value is repeated
      as necessary.
    </para>
    <para>
      From version 5.14 values can be assigned to elements of a vector
      with the square bracket form.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the assign opcode. It uses the file <ulink url="examples/assign.csd"><citetitle>assign.csd</citetitle></ulink>.

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

        

        <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>
          <xi:include href="examples-xml/assign.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>

      Its output should include a line like this:
      <screen>
instr 1:  i1 = 1234.000</screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="divz"><citetitle>divz</citetitle></link>, 
      <link linkend="init"><citetitle>init</citetitle></link>, 
      <link linkend="passign"><citetitle>passign</citetitle></link>,
      <link linkend="tival"><citetitle>tival</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Example written by &namekevin;.</para>
    <para>
      The extension to multiple values is by
      <simplelist>
        <member>Author: &namejohn;</member>
        <member>University of Bath, and Codemist Ltd.</member>
        <member>Bath, UK</member>
        <member>February 2010</member>
      </simplelist>
    <para>New in version 5.13</para>
    </para>
  </refsect1>
</refentry>