summaryrefslogtreecommitdiff
path: root/opcodes/vaget.xml
blob: cf1b70cf9bfe81fb76d3231543491aea1d87cd93 (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
<refentry id="vaget">
<indexterm id="IndexAvarGet"><primary>vaget</primary></indexterm>
  <refentryinfo><title>Signal Modifiers:Sample Level Operators</title></refentryinfo>
  <refmeta>
    <refentrytitle>vaget</refentrytitle>
  </refmeta>



  <refnamediv>
    <refname>vaget</refname>
    <refpurpose>
      Access values of the current buffer of an a-rate variable by indexing.
    </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>
    <para>
      Access values of the current buffer of an a-rate variable by indexing.
      Useful for doing sample-by-sample manipulation at k-rate without using
      setksmps 1.

      <note>
        <title>Note</title>
        <para>Because this opcode does not do any bounds checking, the user
        must be careful not to try to read values past ksmps (the
        size of a buffer for an a-rate variable) by using index values greater
        than ksmps.</para>
      </note>
      <note>
        <title>Note</title>
        <para>In Csound6 this opcode does do bounds checking.</para>
      </note>
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>kval <command>vaget</command> kndx, avar</synopsis>
  </refsect1>


  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kval</emphasis> - value read from avar
    </para>
    <para>
      <emphasis>kndx</emphasis> - index of the sample to read from the current
      buffer of the given avar variable
    </para>
    <para>
      <emphasis>avar</emphasis> - a-rate variable to read from
    </para>
  </refsect1>

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

      <example>
        <title>Example of the vaget 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/vaget.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="vaset"><citetitle>vaset</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: Steven Yi</member>
      </simplelist>
    </para>

    <para>New in version 5.04</para>
    <para>September 2006.</para>
  </refsect1>
</refentry>