summaryrefslogtreecommitdiff
path: root/opcodes/vexpv.xml
blob: 26cd74352c504421a24aeebc936132457400be77 (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
98
99
100
101
102
103
104
105
106
107
<refentry id="vexpv">
<indexterm id="IndexVexpv"><primary>vexpv</primary></indexterm>
  <refentryinfo><title>Vectorial:Vectorial operations</title></refentryinfo>
  <refmeta>
    <refentrytitle>vexpv</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>vexpv</refname>
    <refpurpose>
     Performs exponential operations between two vectorial control signals

    </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>
    <para>
	Performs exponential operations between two vectorial control signals
    </para>
  </refsect1>
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>vexpv</command>  ifn1, ifn2, kelements [, kdstoffset] [, ksrcoffset] [,kverbose]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ifn1</emphasis>  - number of the table hosting the first vector to be processed
    </para>
    <para>
      <emphasis>ifn2</emphasis>  - number of the table hosting the second vector to be processed
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kelements</emphasis> - number of elements of the two vectors
    </para>
    <para>
      <emphasis>kdstoffset</emphasis> - index offset for the destination (ifn1) table (Default=0)
    </para>
    <para>
      <emphasis>ksrcoffset</emphasis> - index offset for the source (ifn2) table (Default=0)
    </para>
    <para>
      <emphasis>kverbose</emphasis> - Selects whether or not warnings are printed (Default=0)
    </para>
    <para>
      <emphasis>vexpv</emphasis> elevates each element of ifn2 to the corresponding element of ifn1. Each vectorial signal is hosted by a table (ifn1 and ifn2). The number of elements contained in both vectors must be the same.
    </para>
    <para>
      The result is a new vectorial control signal that overrides old values of ifn1. If you want to keep the old ifn1 vector, use <link linkend="vcopy_i"><citetitle>vcopy_i</citetitle></link> opcode to copy it in another table. You can use <emphasis>kdstoffset</emphasis> and <emphasis>ksrcoffset</emphasis> to specify vectors in any location of the tables.
    </para>
    <para>
      Negative values for <emphasis>kdstoffset</emphasis> and <emphasis>ksrcoffset</emphasis> are acceptable. If <emphasis>kdstoffset</emphasis> is negative, the out of range section of the vector will be discarded. If <emphasis>ksrcoffset</emphasis> is negative, the out of range elements will be assumed to be 0 (i.e. the destination elements will be set to 1). If elements for the destination vector are beyond the size of the table (including guard point), these elements are discarded (i.e. elements do not wrap around the tables). If elements for the source vector are beyond the table length, these elements are taken as 0 (i.e. the destination elements will be set to 1).
    </para>
    <para>
      If the optional <emphasis>kverbose</emphasis> argument is different to 0, the opcode will print warning messages every k-pass if table lengths are exceeded.
    </para>
    <warning>
      <para>
        Using the same table as source and destination table in versions earlier than 5.04, might produce unexpected behavior, so use with care.
      </para>
    </warning>
    <para>
      This opcode works at k-rate (this means that every k-pass the vectors are processed). There's an i-rate version of this opcode called <link linkend="vexpv_i"><citetitle>vexpv_i</citetitle></link>.
    </para>
    <note>
      <para>
        Please note that the <emphasis>elements</emphasis> argument has changed in version 5.03 from i-rate to k-rate. This will change the opcode's behavior in the unusual cases where the i-rate variable <emphasis>ielements</emphasis> is changed inside the instrument, for example in:
        <programlisting>
    instr 1
ielements = 10
vadd 1, 1, ielements
ielements = 20
vadd 2, 1, ielements
turnoff
    endin</programlisting>
      </para>
    </note>
    <para>
      All these operators (<link linkend="vaddv"><citetitle>vaddv</citetitle></link>,<link linkend="vsubv"><citetitle>vsubv</citetitle></link>,<link linkend="vmultv"><citetitle>vmultv</citetitle></link>,<link linkend="vdivv"><citetitle>vdivv</citetitle></link>,<link linkend="vpowv"><citetitle>vpowv</citetitle></link>,<link linkend="vexpv"><citetitle>vexpv</citetitle></link>, <link linkend="vcopy"><citetitle>vcopy</citetitle></link> and <link linkend="vmap"><citetitle>vmap</citetitle></link>) are designed to be used together with other opcodes that operate with vectorial signals such as <emphasis>bmscan</emphasis>, <link linkend="vcella"><citetitle>vcella</citetitle></link>, <link linkend="adsynt"><citetitle>adsynt</citetitle></link>, <link linkend="adsynt2"><citetitle>adsynt2</citetitle></link> etc. 
    </para>
  </refsect1>
  
  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the vexpv opcode. It uses the file <ulink url="examples/vexpv.csd"><citetitle>vexpv.csd</citetitle></ulink>.
      
      <example>
        <title>Example of the vexpv 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/vexpv.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>
    </para>
  </refsect1>
  <refsect1>
    <title>Credits</title>
    <para>Written by Gabriel Maldonado. Optional arguments added by Andres Cabrera and Istvan Varga.</para>
    <para>New in Csound 5 (Previously available only on CsoundAV)</para>
  </refsect1>
</refentry>