File: cond.html

package info (click to toggle)
csound-doc 3.47b2-2
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 1,492 kB
  • ctags: 272
  • sloc: makefile: 36
file content (64 lines) | stat: -rw-r--r-- 3,232 bytes parent folder | download | duplicates (6)
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
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="GENERATOR" CONTENT="Mozilla/4.03 [en] (X11; I; IRIX 6.3 IP32) [Netscape]">
   <TITLE>CONDITIONAL_VALUES</TITLE>
</HEAD>
<BODY>

<CENTER><A NAME="CONDITIONAL_VALUES"></A>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="SYNTAX.html">Top of this section</A></B> - <A HREF="arith.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="assign.html">Next</A>&nbsp;
<HR></CENTER>

<H2>
CONDITIONAL VALUES:</H2>

<PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (a > b&nbsp;&nbsp;&nbsp; ?&nbsp; v1 : v2)&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (a &lt; b&nbsp;&nbsp;&nbsp; ?&nbsp; v1 : v2)&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (a&nbsp; > = b&nbsp;&nbsp; ?&nbsp; v1 : v2)&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (a&nbsp; &lt; = b&nbsp;&nbsp; ?&nbsp; v1 : v2)&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (a&nbsp; = = b&nbsp;&nbsp; ?&nbsp; v1 : v2)&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (a&nbsp; ! = b&nbsp;&nbsp; ?&nbsp; v1 : v2)</PRE>

<HR>
<H4>
<U>DESCRIPTION</U></H4>
where a, b, v1 and v2 may be expressions, but a, b not audio-rate.

<P>In the above conditionals, a and b are first compared. If the indicated
relation is true (a greater than b, a less than b, a greater than or equal
to b, a less than or equal to b, a equal to b, a not equal to b), then
the conditional expression has the value of v1; if the relation is false,
the expression has the value of v2. (For convenience, a sole `=` will function
as `= =`.)

<P>NB.: If v1 or v2 are expressions, these will be evaluated before the
conditional is determined.

<P>In terms of binding strength, all conditional operators (i.e. the relational
operators (>,&lt;, etc.), and ?, and : ) are weaker than the arithmetic
and logical operators (+, -, *, /, &amp;&amp; and ||).
<H4>
<U>EXAMPLE:</U></H4>

<PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (k1 &lt; p5/2 + p6 ? k1 : p7)</PRE>
binds the terms p5/2 and p6. It will return the value k1 below this threshold,
else the value p7.
</BODY>
<CENTER><P>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="SYNTAX.html">Top of this section</A></B> - <A HREF="arith.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="assign.html">Next</A>&nbsp;
<HR></CENTER>


<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>&copy;
Jean Pich&eacute; &amp; Peter J. Nix, 1994-97</FONT></FONT></I></B>&nbsp;
</CENTER>
</HTML>