summaryrefslogtreecommitdiff
path: root/opcodes/pindex.xml
blob: 276b6b56e0742797f9f8044aa29624e377343538 (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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<refentry id="pindex">
<indexterm id="IndexPindex"><primary>pindex</primary></indexterm>
  <refentryinfo><title>Instrument Control:Sensing and Control</title></refentryinfo>
  <refmeta>
    <refentrytitle>pindex</refentrytitle>
  </refmeta>


 
  <refnamediv>
    <refname>pindex</refname>
    <refpurpose>
      Returns the value of a specified pfield.
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      <emphasis>pindex</emphasis> returns the value of a specified pfield.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ivalue <command>pindex</command> ipfieldIndex</synopsis>
 </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ipfieldIndex</emphasis> - pfield number to query.
    </para>
    <para>
      <emphasis>ivalue</emphasis> - value of the pfield.
    </para>
  </refsect1>
 
<!--  <refsect1>
    <title>Performance</title>

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

      <example>
        <title>Example of the pindex 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/pindex.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>
    </para>
    <para>
      The example will produce the following output:
      <screen>
new alloc for instr 1:
WARNING: instr 1 uses 3 p-fields but is given 5
p1 = 1.000000
p2 = 0.000000
p3 = 3.000000
p4 = 40.000000
p5 = 50.000000
instr 1:  inum = 5.000
B  0.000 ..  1.000 T  1.000 TT  1.000 M:      0.0
new alloc for instr 1:
WARNING: instr 1 uses 3 p-fields but is given 5
p1 = 1.000000
p2 = 1.000000
p3 = 2.000000
p4 = 80.000000
p5 = 50.000000
instr 1:  inum = 5.000
B  1.000 ..  2.000 T  2.000 TT  2.000 M:      0.0
new alloc for instr 1:
WARNING: instr 1 uses 3 p-fields but is given 7
p1 = 1.000000
p2 = 2.000000
p3 = 1.000000
p4 = 40.000000
p5 = 50.000000
p6 = 60.000000
p7 = 70.000000
instr 1:  inum = 7.000
      </screen>
      The warnings can be ignored, because the pfields are used indirectly through pindex instead of explicitly through p4, p5, etc.
    </para>
    <para>
      Here is another example of the pindex opcode. It uses the file <ulink url="examples/pindex-2.csd"><citetitle>pindex-2.csd</citetitle></ulink>.

      <example>
        <title>Second example of the pindex opcode.</title>
          <xi:include href="examples-xml/pindex-2.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>
    </para>
    <para>
      The example will produce the following output:
      <screen>
WARNING: instr 1 uses 3 p-fields but is given 8
B  0.000 ..  2.000 T  2.000 TT  2.000 M:  0.49966  0.49966
WARNING: instr 1 uses 3 p-fields but is given 10
B  2.000 ..  4.000 T  4.000 TT  4.000 M:  0.50000  0.50000
WARNING: instr 1 uses 3 p-fields but is given 10
B  4.000 ..  6.000 T  6.000 TT  6.000 M:  0.49943  0.49943
WARNING: instr 1 uses 3 p-fields but is given 6
B  6.000 ..  8.000 T  8.000 TT  8.000 M:  0.00000  0.00000
WARNING: instr 1 uses 3 p-fields but is given 20
B  8.000 .. 18.000 T 18.000 TT 18.000 M:  0.49994  0.49994
      </screen>
    </para>
  </refsect1>
  
  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="pcount"><citetitle>pcount</citetitle></link>
    </para>
  </refsect1>
  
  <refsect1>
    <title>Credits</title>
    <para>Example by: Anthony Kozar</para>
    <para>Dec. 2006</para>
  </refsect1>
</refentry>