| 1 | |
| 2 | <refentry id="vmult_i"> |
| 3 | <indexterm id="IndexVmult_i"><primary>vmult_i</primary></indexterm> |
| 4 | <refentryinfo><title>Vectorial:Scalar operations</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>vmult_i</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>vmult_i</refname> |
| 11 | <refpurpose> |
| 12 | Multiplies a vector in a table by a scalar value. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Multiplies a vector in a table by a scalar value. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | <refsect1> |
| 23 | <title>Syntax</title> |
| 24 | <synopsis><command>vmult_i</command> ifn, ival, ielements [, idstoffset]</synopsis> |
| 25 | </refsect1> |
| 26 | |
| 27 | <refsect1> |
| 28 | <title>Initialization</title> |
| 29 | <para> |
| 30 | <emphasis>ifn</emphasis> - number of the table hosting the vectorial signal to be processed |
| 31 | </para> |
| 32 | <para> |
| 33 | <emphasis>ival</emphasis> - scalar value to be multiplied |
| 34 | </para> |
| 35 | <para> |
| 36 | <emphasis>ielements</emphasis> - number of elements of the vector |
| 37 | </para> |
| 38 | <para> |
| 39 | <emphasis>idstoffset</emphasis> - index offset for the destination table |
| 40 | </para> |
| 41 | </refsect1> |
| 42 | |
| 43 | <refsect1> |
| 44 | <title>Performance</title> |
| 45 | <para> |
| 46 | <emphasis>vmult_i</emphasis> multiplies each element of the vector contained in the table <emphasis>ifn</emphasis> by <emphasis>ival</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. |
| 47 | </para> |
| 48 | <para> |
| 49 | This opcode runs only on initialization, there is a k-rate version of this opcode called <link linkend="vmult"><citetitle>vmult</citetitle></link>. |
| 50 | </para> |
| 51 | <para> |
| 52 | 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. |
| 53 | </para> |
| 54 | <para> |
| 55 | 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>. |
| 56 | </para> |
| 57 | </refsect1> |
| 58 | |
| 59 | <refsect1> |
| 60 | <title>Examples</title> |
| 61 | <para> |
| 62 | Here is an example of the vmult_i opcode. It uses the file <ulink url="examples/vmult_i.csd"><citetitle>vmult_i.csd</citetitle></ulink>. |
| 63 | <example> |
| 64 | <title>Example of the vmult_i opcode.</title> |
| 65 | <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> |
| 66 | <xi:include href="examples-xml/vmult_i.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 67 | </example> |
| 68 | </para> |
| 69 | </refsect1> |
| 70 | |
| 71 | <refsect1> |
| 72 | <title>See also</title> |
| 73 | <para><link linkend="vectorialscalar"><citetitle>Operations Vectorial/Scalar Signal</citetitle></link></para> |
| 74 | </refsect1> |
| 75 | |
| 76 | <refsect1> |
| 77 | <title>Credits</title> |
| 78 | <para>Written by Gabriel Maldonado. Optional arguments added by Andres Cabrera and Istvan Varga.</para> |
| 79 | <para>Example by Andres Cabrera.</para> |
| 80 | <para>New in Csound 5 (Previously available only on CsoundAV)</para> |
| 81 | </refsect1> |
| 82 | </refentry> |