Debian Codegraph @

opcodes/vadd_i.xml

raw symbols SCIP
1
2 <refentry id="vadd_i">
3 <indexterm id="IndexVadd_i"><primary>vadd_i</primary></indexterm>
4 <refentryinfo><title>Vectorial:Scalar operations</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>vadd_i</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>vadd_i</refname>
11 <refpurpose>
12 Adds a scalar value to a vector in a table.
13
14 </refpurpose>
15 </refnamediv>
16
17 <refsect1>
18 <title>Description</title>
19 <para>
20 Adds a scalar value to a vector in a table.
21 </para>
22 </refsect1>
23 <refsect1>
24 <title>Syntax</title>
25 <synopsis><command>vadd_i</command> ifn, ival, ielements [, idstoffset]</synopsis>
26 </refsect1>
27
28 <refsect1>
29 <title>Initialization</title>
30 <para>
31 <emphasis>ifn</emphasis> - number of the table hosting the vectorial signal to be processed
32 </para>
33 <para>
34 <emphasis>ielements</emphasis> - number of elements of the vector
35 </para>
36 <para>
37 <emphasis>ival</emphasis> - scalar value to be added
38 </para>
39 <para>
40 <emphasis>idstoffset</emphasis> - index offset for the destination table
41 </para>
42 </refsect1>
43
44 <refsect1>
45 <title>Performance</title>
46
47 <para>
48 <emphasis>vadd_i</emphasis> adds the value of <emphasis>ival</emphasis> to each element of the vector contained in the table <emphasis>ifn</emphasis>, starting from table index <emphasis>idstoffset</emphasis>. This enables you to process a specific section of a table by specifying the offset and the number of elements to be processed. Offset is counted starting from 0, so if no offset is specified (or set to 0), the table will be modified from the beginning.
49 </para>
50 <para>
51 This opcode runs only on initialization, there is a k-rate version of this opcode called <link linkend="vadd"><citetitle>vadd</citetitle></link>.
52 </para>
53 <para>
54 Negative values for <emphasis>idstoffset</emphasis> are valid. Elements from the vector that are outside the table, will be discarded, and they will not wrap around the table.
55 </para>
56 <para>
57 In all these opcodes, the resulting vectors are stored in <emphasis>ifn</emphasis>, overriding the intial vectors. If you want to keep initial vector, use <link linkend="vcopy"><citetitle>vcopy</citetitle></link> or <link linkend="vcopy_i"><citetitle>vcopy_i</citetitle></link> to copy it in another table. All these operators are designed to be used together with other opcodes that operate with vectorial signals such as <link linkend="vcella"><citetitle>vcella</citetitle></link>, <link linkend="adsynt"><citetitle>adsynt</citetitle></link>, <link linkend="adsynt2"><citetitle>adsynt2</citetitle></link>, etc. They can also be useful in conjunction with the spectral opcodes <link linkend="pvsftw"><citetitle>pvsftw</citetitle></link> and <link linkend="pvsftr"><citetitle>pvsftr</citetitle></link>.
58 </para>
59 </refsect1>
60 <refsect1>
61 <title>Examples</title>
62 <para>
63 Here is an example of the vadd_i opcode. It uses the file <ulink url="examples/vadd_i.csd"><citetitle>vadd_i.csd</citetitle></ulink>.
64
65 <example>
66 <title>Example of the vadd_i opcode.</title>
67 <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>
68 <xi:include href="examples-xml/vadd_i.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
69 </example>
70 </para>
71 </refsect1>
72
73 <refsect1>
74 <title>See also</title>
75 <para><link linkend="vectorialscalar"><citetitle>Operations Vectorial/Scalar Signal</citetitle></link></para>
76 </refsect1>
77
78 <refsect1>
79 <title>Credits</title>
80 <para>Written by Gabriel Maldonado. Optional arguments added by Andres Cabrera and Istvan Varga.</para>
81 <para>New in Csound 5 (Previously available only on CsoundAV)</para>
82 </refsect1>
83 </refentry>