Debian Codegraph @

opcodes/equals.xml

raw symbols SCIP
1
2 <refentry id="equals">
3 <indexterm id="IndexEqualsColon"><primary>:</primary></indexterm>
4
5 <indexterm id="IndexEqualsQuestion"><primary>?</primary></indexterm>
6
7 <indexterm id="IndexEqualsExpression"><primary>conditional expressions</primary></indexterm>
8
9 <indexterm id="IndexEquals"><primary>==</primary></indexterm>
10 <refentryinfo><title>Instrument Control:Conditional Values</title></refentryinfo>
11 <refmeta>
12 <refentrytitle>==</refentrytitle>
13 </refmeta>
14
15
16
17 <refnamediv>
18 <refname>==</refname>
19
20 <refpurpose>
21 Compares two values for equality.
22 </refpurpose>
23 </refnamediv>
24
25 <refsect1>
26 <title>Description</title>
27 <para>
28 Compares two values for equality.
29 </para>
30 </refsect1>
31
32 <refsect1>
33 <title>Syntax</title>
34 <synopsis>(a <command>==</command> b <command>?</command> v1 <command>:</command> v2)</synopsis>
35
36 <para>
37 where <emphasis>a</emphasis>, <emphasis>b</emphasis>, <emphasis>v1</emphasis> and <emphasis>v2</emphasis> may be expressions, but <emphasis>a</emphasis>, <emphasis>b</emphasis> not audio-rate.
38 </para>
39 </refsect1>
40
41 <refsect1>
42 <title>Performance</title>
43 <para>
44 In the above conditional, <emphasis>a</emphasis> and <emphasis>b</emphasis> are first compared. If the indicated relation is true (<emphasis>a</emphasis> is equal to <emphasis>b</emphasis>), then the conditional expression has the value of <emphasis>v1</emphasis>; if the relation is false, the expression has the value of <emphasis>v2</emphasis>. (For convenience, a sole &quot;<emphasis>=</emphasis>&quot; will function as &quot;<emphasis>= =</emphasis>&quot;.)
45 </para>
46
47 <para>
48 NB.: If <emphasis>v1</emphasis> or <emphasis>v2</emphasis> are expressions, these will be evaluated before the conditional is determined.
49 </para>
50
51 <para>
52 In terms of binding strength, all conditional operators (i.e. the relational operators (<emphasis>&lt;</emphasis>, etc.), and <emphasis>?</emphasis>, and <emphasis>:</emphasis> ) are weaker than the arithmetic and logical operators (<emphasis>+</emphasis>, <emphasis>-</emphasis>, <emphasis>*</emphasis>, <emphasis>/</emphasis>, <emphasis>&amp;&amp;</emphasis> and <emphasis>||</emphasis>).
53 </para>
54
55 <para>
56 These are <emphasis>operators</emphasis> not <emphasis>opcodes</emphasis>. Therefore, they can be used within orchestra statements, but do not form complete statements themselves.
57 </para>
58 </refsect1>
59
60 <refsect1>
61 <title>Examples</title>
62 <para>
63 Here is an example of the == operator. It uses the file <ulink url="examples/equals.csd"><citetitle>equals.csd</citetitle></ulink>.
64 <example>
65 <title>Example of the == operator.</title>
66 <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>
67 <xi:include href="examples-xml/equals.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
68 </example>
69 </para>
70 </refsect1>
71
72 <refsect1>
73 <title>See also</title>
74 <para><link linkend="ControlConditional"><citetitle>Conditional Values</citetitle></link></para>
75 </refsect1>
76
77 </refentry>