1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
7 <meta name=
"Generator" content=
"Cocoa HTML Writer">
8 <meta name=
"CocoaVersion" content=
"824.42">
9 <style type=
"text/css">
10 p
.p1
{margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica
}
11 p
.p2
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; min-height: 14.0px}
12 p
.p3
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Helvetica
; min-height: 11.0px}
17 <p class=
"p1"><b>Operators
</b></p>
18 <p class=
"p2"><br></p>
19 <p class=
"p3">SuperCollider supports operator overloading. Operators can thus be applied to a variety of different objects; Numbers, Ugens, Collections, and so on. When operators are applied to ugens they result in BinaryOpUGens or UnaryOpUGens. See the
<b>BinaryOpUGen
</b>overview
<b> </b>helpfile for details.
</p>
20 <p class=
"p2"><br></p>
21 <p class=
"p3"><b>Unary Operators
</b></p>
22 <p class=
"p4"><br></p>
23 <p class=
"p3">neg .. inversion
</p>
24 <p class=
"p3">reciprocal .. reciprocal
</p>
25 <p class=
"p3">abs .. absolute value
</p>
26 <p class=
"p3">floor .. next lower integer
</p>
27 <p class=
"p3">ceil .. next higher integer
</p>
28 <p class=
"p3">frac .. fractional part
</p>
29 <p class=
"p3">sign .. -
1 when a
< 0, +
1 when a
> 0,
0 when a is
0</p>
30 <p class=
"p3">squared .. a*a
</p>
31 <p class=
"p3">cubed .. a*a*a
</p>
32 <p class=
"p3">sqrt .. square root
</p>
33 <p class=
"p3">exp .. exponential
</p>
34 <p class=
"p3">midicps .. MIDI note number to cycles per second
</p>
35 <p class=
"p3">cpsmidi .. cycles per second to MIDI note number
</p>
36 <p class=
"p3">midiratio .. convert an interval in MIDI notes into a frequency ratio
</p>
37 <p class=
"p3">ratiomidi .. convert a frequency ratio to an interval in MIDI notes
</p>
38 <p class=
"p3">dbamp .. decibels to linear amplitude
</p>
39 <p class=
"p3">ampdb .. linear amplitude to decibels
</p>
40 <p class=
"p3">octcps .. decimal octaves to cycles per second
</p>
41 <p class=
"p3">cpsoct .. cycles per second to decimal octaves
</p>
42 <p class=
"p3">log .. natural logarithm
</p>
43 <p class=
"p3">log2 .. base
2 logarithm
</p>
44 <p class=
"p3">log10 .. base
10 logarithm
</p>
45 <p class=
"p3">sin .. sine
</p>
46 <p class=
"p3">cos .. cosine
</p>
47 <p class=
"p3">tan .. tangent
</p>
48 <p class=
"p3">asin .. arcsine
</p>
49 <p class=
"p3">acos .. arccosine
</p>
50 <p class=
"p3">atan .. arctangent
</p>
51 <p class=
"p3">sinh .. hyperbolic sine
</p>
52 <p class=
"p3">cosh .. hyperbolic cosine
</p>
53 <p class=
"p3">tanh .. hyperbolic tangent
</p>
54 <p class=
"p3">distort .. distortion
</p>
55 <p class=
"p3">softclip .. distortion
</p>
56 <p class=
"p3">isPositive ..
1 when a
>=
0, else
0</p>
57 <p class=
"p3">isNegative ..
1 when a
< 0, else
0</p>
58 <p class=
"p3">isStrictlyPositive ..
1 when a
> 0, else
0</p>
59 <p class=
"p3">(
36)
</p>
60 <p class=
"p4"><br></p>
61 <p class=
"p3"><b>Binary Operators
</b></p>
62 <p class=
"p4"><br></p>
63 <p class=
"p3">+ .. addition
</p>
64 <p class=
"p3">- .. subtraction
</p>
65 <p class=
"p3">* .. multiplication
</p>
66 <p class=
"p3">/ .. division
</p>
67 <p class=
"p3">% .. float modulo
</p>
68 <p class=
"p3">** .. exponentiation
</p>
69 <p class=
"p3"><<span class=
"Apple-converted-space"> </span>.. less than
</p>
70 <p class=
"p3"><= .. less than or equal
</p>
71 <p class=
"p3">><span class=
"Apple-converted-space"> </span>.. greater than
</p>
72 <p class=
"p3">>= .. greater than or equal
</p>
73 <p class=
"p3">== .. equal
</p>
74 <p class=
"p3">!= .. not equal
</p>
75 <p class=
"p3"><! .. return first argument
</p>
76 <p class=
"p3">min .. minimum of two
</p>
77 <p class=
"p3">max .. maximum of two
</p>
78 <p class=
"p3">round .. quantization by rounding
</p>
79 <p class=
"p3">trunc .. quantization by truncation
</p>
80 <p class=
"p3">atan2 .. arctangent
</p>
81 <p class=
"p3">hypot .. hypotenuse
<span class=
"Apple-converted-space"> </span>sqrt(a*a + b*b)
</p>
82 <p class=
"p3">hypotApx .. hypotenuse approximation
</p>
83 <p class=
"p3">ring1 .. a*b + a
<span class=
"Apple-converted-space"> </span>or equivalently:
<span class=
"Apple-converted-space"> </span>a*(b +
1)
</p>
84 <p class=
"p3">ring2 .. a*b + a + b
</p>
85 <p class=
"p3">ring3 .. a*a*b
</p>
86 <p class=
"p3">ring4 .. a*a*b - a*b*b
</p>
87 <p class=
"p3">sumsqr .. a*a + b*b
</p>
88 <p class=
"p3">difsqr .. a*a - b*b
</p>
89 <p class=
"p3">sqrsum .. (a + b)**
2</p>
90 <p class=
"p3">sqrdif .. (a - b)**
2</p>
91 <p class=
"p3">absdif .. fabs(a - b)
</p>
92 <p class=
"p3">thresh .. threshholding
<span class=
"Apple-converted-space"> </span>{
0 when a
< b, a when a
>= b }
</p>
93 <p class=
"p3">amclip .. two quadrant multiply
<span class=
"Apple-converted-space"> </span>{
0 when b
<=
0, a*b when b
> 0 }
</p>
94 <p class=
"p3">scaleneg .. nonlinear amplification
<span class=
"Apple-converted-space"> </span>{ a when a
>=
0, a*b when a
< 0 }
</p>
95 <p class=
"p3">clip2
<span class=
"Apple-converted-space"> </span>.. bilateral clipping { b when a
> b, -b when a
< -b, else a }
</p>
96 <p class=
"p3">wrap2
<span class=
"Apple-converted-space"> </span>.. bilateral wrapping
</p>
97 <p class=
"p3">fold2
<span class=
"Apple-converted-space"> </span>.. bilateral folding
</p>
98 <p class=
"p3">excess .. residual of clipping
<span class=
"Apple-converted-space"> </span>a - clip2(a,b)
</p>
99 <p class=
"p3">(
36)
</p>
100 <p class=
"p2"><br></p>
101 <p class=
"p2"><br></p>
102 <p class=
"p2"><br></p>