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=
"949.46">
9 <style type=
"text/css">
10 p
.p1
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.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: 9.0px Monaco
}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; color: #0000bf}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; min-height: 12.0px}
15 p
.p6
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #bf0000}
16 span
.s1
{font: 18.0px Helvetica
}
17 span
.s2
{color: #0000bf}
18 span
.s3
{color: #0000bf}
19 span
.s4
{color: #0000bf}
20 span
.s5
{color: #000000}
21 span
.s6
{text-decoration: underline
}
22 span
.s7
{color: #0000bf}
23 span
.s8
{color: #bf0000}
24 span
.Apple-tab-span
{white-space:pre
}
28 <p class=
"p1"><span class=
"s1"><b>UnaryOpUGen
</b></span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><b>apply a unary operation to the values of an input ugen
</b></p>
29 <p class=
"p2"><br></p>
30 <p class=
"p1">UnaryOpUGens are created as the result of a unary operator applied to a
<a href=
"../UGen.html"><span class=
"s2">UGen
</span></a>.
<span class=
"Apple-converted-space"> </span></p>
31 <p class=
"p2"><br></p>
32 <p class=
"p3"><span class=
"Apple-tab-span"> </span>(
<span class=
"s3">SinOsc
</span>.ar(
200).abs).dump;
</p>
33 <p class=
"p3"><span class=
"Apple-tab-span"> </span>(
<span class=
"s3">LFSaw
</span>.ar(
200).sin).dump;
</p>
34 <p class=
"p2"><span class=
"Apple-tab-span"> </span></p>
35 <p class=
"p1">As in the examples given here, you don't usually need to instantiate UnaryOpUGen youself.
<span class=
"Apple-converted-space"> </span></p>
36 <p class=
"p1">Examples for unary operations on UGens are to be found in UGen's superclass
<a href=
"../../Core/Kernel/AbstractFunction.html"><span class=
"s4">AbstractFunction
</span></a>. They include:
<a href=
"../../UnaryOps/neg.html"><span class=
"s2"><b>neg
</b></span></a><b>,
</b><a href=
"../../UnaryOps/abs.html"><span class=
"s2"><b>abs
</b></span></a><b>,
</b><a href=
"../../UnaryOps/ceil.html"><span class=
"s2"><b>ceil
</b></span></a><b>,
</b><a href=
"../../UnaryOps/floor.html"><span class=
"s2"><b>floor
</b></span></a><b>,
</b><a href=
"../../UnaryOps/frac.html"><span class=
"s2"><b>frac
</b></span></a><b>,
</b><a href=
"../../UnaryOps/squared.html"><span class=
"s2"><b>squared
</b></span></a><b>,
</b><a href=
"../../UnaryOps/cubed.html"><span class=
"s2"><b>cubed
</b></span></a><b>,
</b><a href=
"../../UnaryOps/sqrt.html"><span class=
"s2"><b>sqrt
</b></span></a><b>,
</b><a href=
"../../UnaryOps/exp.html"><span class=
"s2"><b>exp
</b></span></a><b>,
</b><a href=
"../../UnaryOps/log.html"><span class=
"s2"><b>log
</b></span></a><b>,
</b><a href=
"../../UnaryOps/log2.html"><span class=
"s2"><b>log2
</b></span></a><b>,
</b><a href=
"../../UnaryOps/log10.html"><span class=
"s2"><b>log10
</b></span></a><b>,
</b><a href=
"../../UnaryOps/sin.html"><span class=
"s2"><b>sin
</b></span></a><b>,
</b><a href=
"../../UnaryOps/cos.html"><span class=
"s2"><b>cos
</b></span></a><b>, scurve,
</b><a href=
"../../UnaryOps/distort.html"><span class=
"s2"><b>distort
</b></span></a></p>
37 <p class=
"p2"><br></p>
38 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>*new(selector, a)
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b>return a new instance that applies the operator (
<b>selector
</b>) to the ugen (
<b>a
</b>)
</p>
39 <p class=
"p2"><br></p>
40 <p class=
"p4"><span class=
"s5"><b>See also:
</b> <a href=
"BinaryOpUGen.html"><span class=
"s6">BinaryOpUGen
</span></a></span></p>
41 <p class=
"p1"><b>Structurally related:
</b> <a href=
"../../Core/UnaryOpFunction.html"><span class=
"s4">UnaryOpFunction
</span></a>,
<a href=
"../../Streams-Patterns-Events/Patterns/Punop.html"><span class=
"s4">Punop
</span></a></p>
42 <p class=
"p2"><br></p>
43 <p class=
"p1"><b>Examples
</b><span class=
"Apple-tab-span"> </span></p>
44 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
45 <p class=
"p6"><span class=
"s5"><span class=
"Apple-tab-span"> </span>a =
</span><span class=
"s7">WhiteNoise
</span><span class=
"s5">.ar;
</span>// a WhiteNoise
</p>
46 <p class=
"p6"><span class=
"s5"><span class=
"Apple-tab-span"> </span>b = a.squared;
</span>// a UnaryOpUGen.
</p>
47 <p class=
"p3"><span class=
"Apple-tab-span"> </span>b.operator;
<span class=
"s8">// squared
</span></p>
48 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
49 <p class=
"p6"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// sound example
</p>
50 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
51 <p class=
"p3"><span class=
"Apple-tab-span"> </span>{
<span class=
"s7">var
</span> a =
<span class=
"s7">LFSaw
</span>.ar(
300).range(
0,
2pi); a.sin *
0.1 }.play;
</p>
52 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
53 <p class=
"p6"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// Plotting the
"abs" unary operator (via the server):
</p>
54 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
55 <p class=
"p3"><span class=
"Apple-tab-span"> </span>{
<span class=
"s7">SinOsc
</span>.ar(
300).abs }.plot
</p>
56 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>