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=
"1038.25">
9 <style type=
"text/css">
10 p
.p1
{margin: 0.0px 0.0px 0.0px 0.0px; font: 14.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
; color: #0000bf}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica
; min-height: 17.0px}
15 p
.p6
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
}
16 p
.p7
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; min-height: 12.0px}
17 p
.p8
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Trebuchet MS'; min-height: 14.0px}
18 p
.p9
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #bf0000}
19 p
.p10
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; color: #0000bf; min-height: 14.0px}
20 p
.p11
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #bf0000; min-height: 12.0px}
21 span
.s1
{font: 18.0px Helvetica
}
22 span
.s2
{color: #000000}
23 span
.s3
{color: #0000bf}
24 span
.s4
{text-decoration: underline
}
25 span
.s5
{color: #0000bf}
26 span
.s6
{color: #007300}
27 span
.s7
{color: #bf0000}
28 span
.s8
{text-decoration: underline
; color: #0000bf}
29 span
.s9
{color: #0000bf}
30 span
.Apple-tab-span
{white-space:pre
}
34 <p class=
"p1"><span class=
"s1"><b>UGen
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b></span><b>abstract superclass of all unit generators
</b></p>
35 <p class=
"p2"><br></p>
36 <p class=
"p3"><span class=
"s2"><b>Inherits from:
</b><a href=
"../Core/Object.html"><b>Object
</b></a></span><span class=
"s3"><b> </b></span><span class=
"s2"><b>:
</b><a href=
"../Core/Kernel/AbstractFunction.html"><b>AbstractFunction
</b></a></span></p>
37 <p class=
"p2"><br></p>
38 <p class=
"p4">UGens represent calculations with signals. They are the basic building blocks of synth definitions on the server, and are used to generate or process both audio and control signals. The many subclasses of UGen are the client-side representations of unit generators, and are used to specify their parameters when constructing synth definitions (see
<a href=
"../ServerArchitecture/SynthDef.html"><span class=
"s3">SynthDef
</span></a>).
<span class=
"Apple-converted-space"> </span></p>
39 <p class=
"p2"><br></p>
40 <p class=
"p3"><span class=
"s2"><b>See also:
</b> <a href=
"UGens.html"><span class=
"s4">UGens
</span></a>,
<a href=
"Tour_of_UGens.html"><span class=
"s4">Tour_of_UGens
</span></a>, and
<a href=
"../Tutorials/UGens-and-Synths.html"><span class=
"s4">UGens-and-Synths
</span></a>.
</span></p>
41 <p class=
"p2"><br></p>
42 <p class=
"p5"><br></p>
43 <p class=
"p5"><br></p>
44 <p class=
"p1"><b>Class Methods
</b></p>
45 <p class=
"p5"><br></p>
46 <p class=
"p4"><b>*ar(arg1, arg2, ... )
</b></p>
47 <p class=
"p4"><b>*kr(arg1, arg2, ... )
</b></p>
48 <p class=
"p4"><b>*ir(arg1, arg2, ... )
</b></p>
49 <p class=
"p2"><br></p>
50 <p class=
"p4">Return a new instance of UGen that calculates at
<b>audio/control rate
</b> or at
<b>initialization only
</b>(ir). Some UGens, like
<a href=
"Random/Rand.html"><span class=
"s3">Rand
</span></a>, use the *new method instead. These methods are implemented in subclasses, where argument names and their meaning depend on the case. If any argument is an
<b>array
</b>, they return an array of UGens (see:
<a href=
"../Other Topics/MultiChannel.html"><span class=
"s3">MultiChannelExpansion
</span></a>). If the combination of rates between arguments and ugen are not allowed, calling the methods will throw an error. This method adds the UGen to the current
<a href=
"../ServerArchitecture/SynthDef.html"><span class=
"s3">SynthDef
</span></a>, so it
<span class=
"Apple-converted-space"> </span>only fully works inside a UGen function.
</p>
51 <p class=
"p2"><br></p>
52 <p class=
"p6">{
<span class=
"s3">Blip
</span>.ar(
<span class=
"s3">Blip
</span>.kr(
4,
5,
500,
60),
59,
0.1) }.play;
</p>
53 <p class=
"p7"><br></p>
54 <p class=
"p2"><br></p>
55 <p class=
"p4"><b>*buildSynthDef
</b></p>
56 <p class=
"p2"><br></p>
57 <p class=
"p4">Return the SynthDef in which the UGen is situated.
</p>
58 <p class=
"p7"><br></p>
59 <p class=
"p6">{
<span class=
"s5">UGen.
</span>buildSynthDef.dump; Silent.ar }.play;
</p>
60 <p class=
"p7"><br></p>
61 <p class=
"p5"><br></p>
62 <p class=
"p4"><b>Note:
</b>For internally used class methods, see below.
</p>
63 <p class=
"p7"><br></p>
64 <p class=
"p7"><br></p>
65 <p class=
"p5"><br></p>
66 <p class=
"p1"><b>Documentation of mul and add arguments
</b></p>
67 <p class=
"p2"><br></p>
68 <p class=
"p4">A great number of UGens take arguments for
<b>mul
</b> and
<b>add
</b> in their
<b>*ar
</b> and
<b>*kr
</b>methods. Because these arguments are so ubiquitous, they are not general documented in the individual help files. Mul and add simply refer to a constant or signal by which to multiply the output of the UGen, and a constant or signal to add to the output of the UGen. (
<b>mul
</b> happens before
<b>add
</b>.) They thus correspond in many cases to scaling the amplitude of the UGen signal in the case of
<b>mul
</b>, and adding a constant or DC offset in the case of
<b>add
</b>. In most cases the defaults for mul and add are
1 and
0 respectively, and they are commonly implemented using a automatically generated
<a href=
"Filters/MulAdd.html"><span class=
"s3">MulAdd
</span></a> UGen for efficiency. See also the
<b>range
</b> and
<b>madd
</b> methods below.
</p>
69 <p class=
"p2"><br></p>
70 <p class=
"p2"><br></p>
71 <p class=
"p1"><b>Convenience Methods
</b></p>
72 <p class=
"p8"><br></p>
73 <p class=
"p2"><br></p>
74 <p class=
"p4"><b>scope(name, bufsize, zoom)
</b></p>
75 <p class=
"p2"><br></p>
76 <p class=
"p4">Displays the output of this UGen in an individual
<a href=
"../GUI/Main-GUI/Stethoscope.html"><span class=
"s3">Stethoscope
</span></a><b> </b>window.
<b>name
</b> is the name of the window.
</p>
77 <p class=
"p2"><br></p>
78 <p class=
"p9"><span class=
"s3">Server
</span><span class=
"s2">.default = s =
</span><span class=
"s3">Server
</span><span class=
"s2">.internal.boot;
</span>// scope works only for internal server
</p>
79 <p class=
"p7"><br></p>
80 <p class=
"p6">{
<span class=
"s3">Ringz
</span>.ar(
<span class=
"s3">PinkNoise
</span>.ar([
0.1,
0.2]).scope(
<span class=
"s6">\pink
</span>),
2000,
1,
0.25) }.play;
<span class=
"s7">// multichannel works
</span></p>
81 <p class=
"p9"><span class=
"s2">s.scope;
</span>// can still separately scope the output of the server
</p>
82 <p class=
"p7"><br></p>
83 <p class=
"p9"><span class=
"s3">Server
</span><span class=
"s2">.default = s =
</span><span class=
"s3">Server
</span><span class=
"s2">.local.boot;
</span>// switch back to local server.
</p>
84 <p class=
"p2"><br></p>
85 <p class=
"p2"><br></p>
86 <p class=
"p2"><br></p>
87 <p class=
"p4"><b>poll(trig, label, trigid)
</b></p>
88 <p class=
"p2"><br></p>
89 <p class=
"p2"><br></p>
90 <p class=
"p4">Polls the output of this UGen every
<b>interval
</b> seconds, and posts the result. The default
<b>trig
</b>is
10, which converts to
10 triggers per second (or every
0.1 seconds). See
<a href=
"Triggers/Poll.html"><span class=
"s3">Poll
</span></a> for more info on polling.
</p>
91 <p class=
"p2"><br></p>
92 <p class=
"p6">{
<span class=
"s3">SinOsc
</span>.ar(
<span class=
"s3">LFNoise0
</span>.ar(
2).range(
420,
460).poll(label:
<span class=
"s6">\LFNoise
</span>),
0,
0.2) }.play;
</p>
93 <p class=
"p7"><br></p>
94 <p class=
"p9">// multichannel polling:
</p>
96 <p class=
"p6">{
<span class=
"Apple-converted-space"> </span></p>
97 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s3">var
</span> freqs =
<span class=
"s3">SinOsc
</span>.ar([
0.2,
0.3]).range(
420,
460);
</p>
98 <p class=
"p6"><span class=
"Apple-tab-span"> </span>freqs.poll(label: [
<span class=
"s6">\freq1
</span>,
<span class=
"s6">\freq2
</span>]);
</p>
99 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s3">SinOsc
</span>.ar(freqs,
0,
0.2);
</p>
100 <p class=
"p6">}.play;
</p>
102 <p class=
"p7"><br></p>
103 <p class=
"p4"><b>dpoll(trig, label, trigid)
</b></p>
104 <p class=
"p2"><br></p>
105 <p class=
"p2"><br></p>
106 <p class=
"p4">Like poll, only that
<b>dpoll
</b> is used for Demand ugens. See
<a href=
"Triggers/Poll.html"><span class=
"s5">Poll
</span></a> for more info on polling.
</p>
107 <p class=
"p7"><br></p>
108 <p class=
"p2"><br></p>
109 <p class=
"p4"><b>range(lo, hi)
</b></p>
110 <p class=
"p2"><br></p>
111 <p class=
"p4">Scales the output of this UGen to be within the range of
<b>lo
</b> and
<b>hi
</b>. Note that 'range' expects the default output range, and thus should not be used in conjunction with
<b>mul
</b> and
<b>add
</b> arguments.
</p>
112 <p class=
"p2"><br></p>
113 <p class=
"p6">{
<span class=
"s3">SinOsc
</span>.ar(
<span class=
"s3">SinOsc
</span>.ar(
0.3).range(
440,
660),
0,
0.5) *
0.1 }.play;
</p>
114 <p class=
"p2"><br></p>
115 <p class=
"p4"><b>exprange(lo, hi)
</b></p>
116 <p class=
"p2"><br></p>
117 <p class=
"p4">Maps the output of this UGen exponentially to be within the range of
<b>lo
</b> and
<b>hi
</b> using a
<a href=
"Filters/LinExp.html"><span class=
"s3">LinExp
</span></a> UGen.
<b>lo
</b> and
<b>hi
</b> should both be non-zero and have the same sign. Note that 'exprange' expects the default output range, and thus should not be used in conjunction with
<b>mul
</b> and
<b>add
</b> arguments.
</p>
118 <p class=
"p2"><br></p>
119 <p class=
"p6">{
<span class=
"s3">SinOsc
</span>.ar(
<span class=
"s3">SinOsc
</span>.ar(
0.3).exprange(
440,
6600),
0,
0.5) *
0.1 }.play;
</p>
120 <p class=
"p2"><br></p>
121 <p class=
"p4"><b>unipolar(mul)
</b></p>
122 <p class=
"p2"><br></p>
123 <p class=
"p4">Scales the output of this UGen to be between
<b>(
0..mul)
</b> range (default
1). Note that 'unipolar' expects the default output range, and thus should not be used in conjunction with
<b>mul
</b> and
<b>add
</b> arguments.
</p>
124 <p class=
"p2"><br></p>
125 <p class=
"p6">{
<span class=
"s3">SinOsc
</span>.ar(
300,
0,
0.5) *
<span class=
"s3">SinOsc
</span>.kr(
2).unipolar *
0.1 }.play;
</p>
126 <p class=
"p2"><br></p>
127 <p class=
"p2"><br></p>
128 <p class=
"p4"><b>bipolar(mul)
</b></p>
129 <p class=
"p2"><br></p>
130 <p class=
"p4">Scales the output of this UGen to be between
<b>(-mul..mul)
</b> range (default
1). Note that 'bipolar' expects the default output range, and thus should not be used in conjunction with
<b>mul
</b> and
<b>add
</b> arguments.
</p>
131 <p class=
"p2"><br></p>
132 <p class=
"p6">{
<span class=
"s3">SinOsc
</span>.ar(
500 +
<span class=
"s3">LFPulse
</span>.ar(
4).bipolar(
40),
0,
0.5) *
0.1 }.play;
</p>
133 <p class=
"p2"><br></p>
134 <p class=
"p2"><br></p>
135 <p class=
"p4"><b>clip(lo, hi)
</b></p>
136 <p class=
"p2"><br></p>
137 <p class=
"p4">Wraps the receiver in a
<a href=
"Filters/Clip.html"><span class=
"s3">Clip
</span></a><b> </b>UGen, clipping its output at
<b>lo
</b> and
<b>hi
</b>.
</p>
138 <p class=
"p2"><br></p>
139 <p class=
"p4"><b>fold(lo, hi)
</b></p>
140 <p class=
"p2"><br></p>
141 <p class=
"p4">Wraps the receiver in a
<a href=
"Filters/Fold.html"><span class=
"s3">Fold
</span></a><b> </b>UGen, folding its output at
<b>lo
</b> and
<b>hi
</b>.
</p>
142 <p class=
"p2"><br></p>
143 <p class=
"p4"><b>wrap(lo, hi)
</b></p>
144 <p class=
"p2"><br></p>
145 <p class=
"p4">Wraps the receiver in a
<a href=
"Filters/Wrap.html"><span class=
"s3">Wrap
</span></a><b> </b>UGen, wrapping its output at
<b>lo
</b> and
<b>hi
</b>.
</p>
146 <p class=
"p2"><br></p>
147 <p class=
"p4"><b>lag(lagTime, t2)
</b></p>
148 <p class=
"p2"><br></p>
149 <p class=
"p4">Wraps the receiver in a
<a href=
"Filters/Lag.html"><span class=
"s3">Lag
</span></a><b> </b>UGen, smoothing its output by lagTime. If a second argument is given, it wraps it in a
<a href=
"Filters/LagUD.html"><span class=
"s3">LagUD
</span></a><span class=
"s3"> </span>UGen. Default lag time:
0.1.
</p>
150 <p class=
"p10"><br></p>
151 <p class=
"p4"><b>lag2(lagTime, t2)
</b></p>
152 <p class=
"p10"><br></p>
153 <p class=
"p4">Wraps the receiver in a
<span class=
"Apple-converted-space"> </span><a href=
"Filters/LagUD.html"><span class=
"s8"> </span></a><a href=
"Filters/Lag2.html"><span class=
"s3">Lag2
</span></a><b> </b>UGen, smoothing its output by lagTime. If a second argument is given, it wraps it in a
<a href=
"Filters/Lag2UD.html"><span class=
"s3">Lag2UD
</span></a><span class=
"s3"> </span>UGen. Default lag time:
0.1.
</p>
154 <p class=
"p10"><br></p>
155 <p class=
"p4"><b>lag3(lagTime, t2)
</b></p>
156 <p class=
"p10"><br></p>
157 <p class=
"p4">Wraps the receiver in a
<a href=
"Filters/Lag3.html"><span class=
"s3">Lag3
</span></a><b> </b>UGen, smoothing its output by lagTime. If a second argument is given, it wraps it in a
<a href=
"Filters/Lag3UD.html"><span class=
"s3">Lag3UD
</span></a><span class=
"s3"> </span>UGen. Default lag time:
0.1.
</p>
158 <p class=
"p10"><br></p>
159 <p class=
"p4"><b>lagud(lagTimeU, lagTimeD)
</b></p>
160 <p class=
"p10"><br></p>
161 <p class=
"p4">Wraps the receiver in a
<span class=
"Apple-converted-space"> </span><a href=
"Filters/Lag3UD.html"><span class=
"s8"> </span></a><a href=
"Filters/LagUD.html"><span class=
"s3">LagUD
</span></a><b> </b>UGen, smoothing its output by lagtimeU and lagtimeD. Default lag time:
0.1.
</p>
162 <p class=
"p2"><br></p>
163 <p class=
"p4"><b>lag2ud(lagtimeU,lagtimeD)
</b></p>
164 <p class=
"p2"><br></p>
165 <p class=
"p4">Wraps the receiver in a
<a href=
"Filters/Lag2UD.html"><span class=
"s3">Lag2UD
</span></a><b> </b>UGen, smoothing its output by lagtimeU and lagtimeD. Default lag time:
0.1.
</p>
166 <p class=
"p2"><br></p>
167 <p class=
"p4"><b>lag3ud(lagtimeU, lagtimeD)
</b></p>
168 <p class=
"p2"><br></p>
169 <p class=
"p4">Wraps the receiver in a
<a href=
"Filters/Lag3UD.html"><span class=
"s3">Lag3UD
</span></a><b> </b>UGen, smoothing its output by lagtimeU and lagtimeD. Default lag time:
0.1.
</p>
170 <p class=
"p2"><br></p>
171 <p class=
"p4"><b>degreeToKey(scale, stepsPerOctave)
</b></p>
172 <p class=
"p2"><br></p>
173 <p class=
"p4">Wraps the receiver in a
<a href=
"Synth control/DegreeToKey.html"><span class=
"s3">DegreeToKey
</span></a><b> </b>UGen. The default
<b>stepsPerOctave
</b> is
12.
</p>
174 <p class=
"p2"><br></p>
175 <p class=
"p4"><b>minNyquist
</b></p>
176 <p class=
"p2"><br></p>
177 <p class=
"p4">Wraps the receiver in a
<a href=
"../BinaryOps/min.html"><span class=
"s3">min
</span></a><b> </b>UGen, such that the lesser of the receiver's output and the Nyquist frequency is output. This can be useful to prevent aliasing.
</p>
178 <p class=
"p2"><br></p>
179 <p class=
"p4"><b>linlin(inMin, inMax, outMin, outMax, clip)
</b></p>
180 <p class=
"p2"><br></p>
181 <p class=
"p4">Wraps the receiver so that a linear inputrange is mapped to a linear output range.
<span class=
"Apple-converted-space"> </span></p>
182 <p class=
"p4">The
<b>clip
</b> argument can be one of the four:
<span class=
"Apple-converted-space"> </span></p>
183 <p class=
"p4"><b>nil
</b> (do not clip at outMin or outMax),
<span class=
"Apple-converted-space"> </span></p>
184 <p class=
"p4"><b>\minmax
</b> (clip at outMin or outMax),
<span class=
"Apple-converted-space"> </span></p>
185 <p class=
"p4"><b>\min
</b> (clip at outMin),
</p>
186 <p class=
"p4"><b>\max
</b>(clip at outMax)
</p>
187 <p class=
"p2"><br></p>
188 <p class=
"p6">{
<span class=
"s3">Line
</span>.ar(-
1,
5,
0.1).linlin(
0,
3, -
1,
1) }.plot(
0.1);
</p>
189 <p class=
"p11"><br></p>
190 <p class=
"p9">// modulate some values
</p>
192 <p class=
"p6">{
<span class=
"s3">Line
</span>.ar(-
1,
5,
0.1).lincurve(
<span class=
"s3">SinOsc
</span>.ar(
100),
<span class=
"s3">SinOsc
</span>.ar(
130) +
3, -
1,
1, clip: nil) }
</p>
193 <p class=
"p6"><span class=
"Apple-tab-span"> </span>.plot(
0.1, minval: -
15, maxval:
5)
</p>
195 <p class=
"p2"><br></p>
196 <p class=
"p4"><b>linexp(inMin, inMax, outMin, outMax, clip)
</b></p>
197 <p class=
"p2"><br></p>
198 <p class=
"p4">Wraps the receiver so that a linear inputrange is mapped to an exponential output range.
</p>
199 <p class=
"p4">outMin and outMax must be nonzero and of the same sign. For
<b>clip
</b>argument, see
<b>linlin
</b>.
</p>
200 <p class=
"p2"><br></p>
201 <p class=
"p6">{
<span class=
"s3">Line
</span>.ar(-
1,
5,
0.1).linexp(
0,
3,
0.01,
1) }.plot(
0.1);
</p>
202 <p class=
"p2"><br></p>
203 <p class=
"p4"><b>explin(inMin, inMax, outMin, outMax, clip)
</b></p>
204 <p class=
"p2"><br></p>
205 <p class=
"p4">Wraps the receiver so that an exponential inputrange is mapped to a linear output range.
</p>
206 <p class=
"p4">inMin and inMax must be nonzero and of the same sign. For
<b>clip
</b>argument, see
<b>linlin
</b>.
</p>
207 <p class=
"p2"><br></p>
208 <p class=
"p6">{
<span class=
"s3">Line
</span>.ar(
1,
5,
0.1).explin(
1,
3, -
1,
1) }.plot(
0.1);
</p>
209 <p class=
"p2"><br></p>
210 <p class=
"p4"><b>expexp(inMin, inMax, outMin, outMax, clip)
</b></p>
211 <p class=
"p2"><br></p>
212 <p class=
"p4">Wraps the receiver so that an exponential inputrange is mapped to an exponential output range.
</p>
213 <p class=
"p4">outMin, outMax, inMin and inMax must be nonzero and of the same sign. For
<b>clip
</b>argument, see
<b>linlin
</b>.
</p>
214 <p class=
"p2"><br></p>
215 <p class=
"p6">{
<span class=
"s3">Line
</span>.ar(
1,
5,
0.1).expexp(
1,
3,
0.01,
1) }.plot(
0.1);
</p>
216 <p class=
"p2"><br></p>
217 <p class=
"p2"><br></p>
218 <p class=
"p4"><b>lincurve(inMin, inMax, outMin, outMax, curve, clip)
</b></p>
219 <p class=
"p2"><br></p>
220 <p class=
"p4">Wraps the receiver so that a linear inputrange is mapped to a curve-like exponential output range.
</p>
221 <p class=
"p4">outMin and outMax may be zero and of the different sign. For
<b>clip
</b>argument, see
<b>linlin
</b>.
</p>
222 <p class=
"p2"><br></p>
223 <p class=
"p2"><br></p>
224 <p class=
"p6">{
<span class=
"s3">Line
</span>.ar(-
1,
5,
0.1).lincurve(
0,
3, -
1,
1, curve: -
4) }.plot(
0.1);
</p>
225 <p class=
"p7"><br></p>
226 <p class=
"p9">// modulate the curve. Unlike with numbers and CurveSpec, the curve absolute value
<span class=
"Apple-converted-space"> </span></p>
227 <p class=
"p9">// should not be much smaller than
0.5.
</p>
228 <p class=
"p6">{
<span class=
"s3">SinOsc
</span>.ar(
100).lincurve(-
1,
1, -
1,
1,
<span class=
"s3">XLine
</span>.kr(-
3, -
100,
0.1)) *
0.1 }.plot(
0.1);
</p>
229 <p class=
"p2"><br></p>
230 <p class=
"p2"><br></p>
231 <p class=
"p4"><b>curvelin(inMin, inMax, outMin, outMax, curve, clip)
</b></p>
232 <p class=
"p2"><br></p>
233 <p class=
"p4">Wraps the receiver so that a
<span class=
"Apple-converted-space"> </span>curve-like exponential inputrange is mapped to a linear output range.
</p>
234 <p class=
"p4">inMin and inMax
<span class=
"Apple-converted-space"> </span>may be zero and of the different sign.
<span class=
"Apple-converted-space"> </span>For
<b>clip
</b>argument, see
<b>linlin
</b>.
</p>
235 <p class=
"p2"><br></p>
236 <p class=
"p6">{
<span class=
"s3">Line
</span>.ar(-
1,
5,
0.1).curvelin(
0,
3, -
1,
1, curve: -
4) }.plot(
0.1);
</p>
237 <p class=
"p2"><br></p>
238 <p class=
"p2"><br></p>
239 <p class=
"p4"><b>prune(min, max, clip)
</b></p>
240 <p class=
"p2"><br></p>
241 <p class=
"p4">Limits the receiver range to one of the four
<b>clip
</b> modes (see
<b>linlin
</b>)
</p>
242 <p class=
"p2"><br></p>
243 <p class=
"p4"><b>checkBadValues(id, post)
</b></p>
244 <p class=
"p2"><br></p>
245 <p class=
"p4">Wraps the receiver in a
<a href=
"Info/CheckBadValues.html"><span class=
"s3">CheckBadValues
</span></a> UGen with the corresponding id and post flag.
</p>
246 <p class=
"p2"><br></p>
247 <p class=
"p4"><b>if(trueUGen, falseUGen)
</b></p>
248 <p class=
"p2"><br></p>
249 <p class=
"p4">Outputs
<b>trueUGen
</b> when the receiver outputs
1,
<b>falseUGen
</b> when the receiver outputs
0. If the receiver outputs a value between
0 and
1, a mixture of both will be played. (This is implemented as: ^(this * (trueUGen - falseUGen)) + falseUGen) Note that both
<b>trueUGen
</b> and
<b>falseUGen
</b> will be calculated regardless of whether they are output, so this may not be the most efficient approach.
</p>
250 <p class=
"p2"><br></p>
251 <p class=
"p9">// note different syntax in these two examples
</p>
252 <p class=
"p6">{ if(
<span class=
"s3">LFNoise1
</span>.kr(
1.0,
0.5,
0.5) ,
<span class=
"s3">SinOsc
</span>.ar,
<span class=
"s3">Saw
</span>.ar ) *
0.1 }.play;
</p>
253 <p class=
"p7"><br></p>
254 <p class=
"p6">{
<span class=
"s3">Trig1
</span>.ar(
<span class=
"s3">Dust
</span>.ar(
3),
0.2).lag(
0.1).if(
<span class=
"s3">FSinOsc
</span>.ar(
440),
<span class=
"s3">FSinOsc
</span>.ar(
880)) *
0.1 }.play;
</p>
255 <p class=
"p2"><br></p>
256 <p class=
"p4"><b>@ y
</b></p>
257 <p class=
"p2"><br></p>
258 <p class=
"p4">Dynamic geometry support. Returns
<b>Point(this, y)
</b>.
</p>
259 <p class=
"p2"><br></p>
260 <p class=
"p6">{ (
<span class=
"s3">SinOsc
</span>.ar(
1001) @
<span class=
"s3">SinOsc
</span>.ar(
1207)).rho }.scope;
</p>
261 <p class=
"p2"><br></p>
262 <p class=
"p4"><b>asComplex
</b></p>
263 <p class=
"p2"><br></p>
264 <p class=
"p4">Complex math support. Returns
<b>Complex(this,
0.0)
</b>.
</p>
265 <p class=
"p2"><br></p>
266 <p class=
"p4"><b>dumpArgs
</b></p>
268 <p class=
"p4">Posts a list of the arguments for this UGen and their values.
</p>
269 <p class=
"p2"><br></p>
270 <p class=
"p2"><br></p>
271 <p class=
"p2"><br></p>
272 <p class=
"p2"><br></p>
273 <p class=
"p1"><b>Other Instance Methods
</b></p>
274 <p class=
"p2"><br></p>
275 <p class=
"p4">The following methods and instance variables are largely used in the construction of synth definitions, synth descriptions (see
<a href=
"../ServerArchitecture/SynthDesc.html"><span class=
"s3">SynthDesc
</span></a>), UGen class definitions, etc., and are usually not needed for general use. Users should not attempt to set any of these values in general code.
</p>
276 <p class=
"p2"><br></p>
277 <p class=
"p4"><b>synthDef
</b></p>
278 <p class=
"p2"><br></p>
279 <p class=
"p4">The SynthDef which contains the UGen.
</p>
280 <p class=
"p2"><br></p>
281 <p class=
"p4"><b>inputs
</b></p>
282 <p class=
"p2"><br></p>
283 <p class=
"p4">The array of inputs to the UGen.
<span class=
"Apple-converted-space"> </span></p>
284 <p class=
"p2"><br></p>
285 <p class=
"p4"><b>rate
</b></p>
286 <p class=
"p2"><br></p>
287 <p class=
"p4">The output rate of the UGen which is one of the Symbols 'audio', or 'control'.
</p>
288 <p class=
"p2"><br></p>
289 <p class=
"p2"><br></p>
290 <p class=
"p4"><b>signalRange
</b></p>
291 <p class=
"p2"><br></p>
292 <p class=
"p4">Returns a symbol indicating the signal range of the receiver. Either
<span class=
"s6">\bipolar
</span> or
<span class=
"s6">\unipolar
</span>.
</p>
293 <p class=
"p2"><br></p>
294 <p class=
"p4"><b>numChannels
</b> </p>
295 <p class=
"p2"><br></p>
296 <p class=
"p4">Returns the number of output Channels. For a UGen, this will always be
1, but
<a href=
"../Collections/Array.html"><span class=
"s3">Array
</span></a> also implements this method, so multichannel expansion is supported. See
<a href=
"../Other Topics/MultiChannel.html"><span class=
"s3">MultiChannel
</span></a>.
</p>
297 <p class=
"p2"><br></p>
298 <p class=
"p4"><b>numInputs
</b></p>
299 <p class=
"p2"><br></p>
300 <p class=
"p4">Returns the number of inputs for this UGen.
</p>
301 <p class=
"p2"><br></p>
302 <p class=
"p4"><b>numOutputs
</b></p>
303 <p class=
"p2"><br></p>
304 <p class=
"p4">Returns the number of outputs for this UGen.
</p>
305 <p class=
"p2"><br></p>
306 <p class=
"p4"><b>name
</b></p>
307 <p class=
"p2"><br></p>
308 <p class=
"p4">Returns the
<a href=
"../Core/Kernel/Class.html"><span class=
"s3">Class
</span></a> name of the receiver as a
<a href=
"../Collections/String.html"><span class=
"s3">String
</span></a>.
</p>
309 <p class=
"p2"><br></p>
310 <p class=
"p4"><b>madd(mul, add)
</b></p>
311 <p class=
"p2"><br></p>
312 <p class=
"p4">Wraps the receiver in a
<a href=
"Filters/MulAdd.html"><span class=
"s3">MulAdd
</span></a> UGen. This is for the most part only used in UGen class definitions in order to allow efficient implementation of
<b>mul
</b> and
<b>add
</b> arguments.
</p>
313 <p class=
"p2"><br></p>
314 <p class=
"p4"><b>isValidUGenInput
</b></p>
315 <p class=
"p2"><br></p>
316 <p class=
"p4">Returns true.
</p>
317 <p class=
"p2"><span class=
"Apple-tab-span"> </span></p>
318 <p class=
"p4"><b>asUGenInput
</b></p>
319 <p class=
"p2"><br></p>
320 <p class=
"p4">Returns the receiver. This method is implemented in a number of classes in order to allow objects like Nodes, Busses, and Buffers to be passed directly as UGen inputs and Synth args.
<span class=
"Apple-tab-span"> </span></p>
321 <p class=
"p2"><br></p>
322 <p class=
"p4"><b>copy
</b></p>
323 <p class=
"p2"><br></p>
324 <p class=
"p4">Returns the receiver. Thus UGen-dup effectively returns a reference to the original and is a convenient way to copy a mono signal to multiple channels.
</p>
325 <p class=
"p2"><br></p>
326 <p class=
"p6">{
<span class=
"s3">SinOsc
</span>.ar(
<span class=
"s3">Rand
</span>(
200,
4000),
0,
0.2).dup }.plot
<span class=
"s7">// this is the same UGen
</span></p>
328 <p class=
"p4">Function-dup evaluates that function multiple times, thus potentially returning distinct UGens.
</p>
329 <p class=
"p2"><br></p>
330 <p class=
"p6">{ {
<span class=
"s3">SinOsc
</span>.ar(
<span class=
"s3">Rand
</span>(
200,
4000),
0,
0.2) }.dup }.plot
<span class=
"s7">// these are different UGens
</span></p>
331 <p class=
"p7"><br></p>
332 <p class=
"p7"><br></p>
333 <p class=
"p7"><br></p>
334 <p class=
"p7"><br></p>
335 <p class=
"p1"><b>Internally used methods
</b></p>
336 <p class=
"p5"><br></p>
337 <p class=
"p5"><br></p>
338 <p class=
"p4"><b>*multiNew(rate, ...args)
</b></p>
339 <p class=
"p4"><b>*multiNewList([rate, ...args])
</b></p>
340 <p class=
"p2"><br></p>
341 <p class=
"p4">These methods are responsible for multichannel expansion. They call
<b>*new1(rate, ...args)
</b> for each parallel combination. Most *ar/*kr methods delegate to multiNewList.
</p>
342 <p class=
"p2"><br></p>
343 <p class=
"p4"><b>*new1(rate, ...args)
</b></p>
344 <p class=
"p2"><br></p>
345 <p class=
"p4">This method returns a single instance of the UGen, not multichannel expanded. It is called inside multiNewList, whenever a new single instance is needed.
</p>
346 <p class=
"p2"><br></p>
347 <p class=
"p4"><b>*methodSelectorForRate(rate)
</b></p>
348 <p class=
"p4"><b>methodSelectorForRate(rate)
</b></p>
349 <p class=
"p2"><br></p>
350 <p class=
"p4">Returns an appropriate message selector (Symbol like \ar, \kr, \ir) for a given rate like \audio, \control, \scalar.
</p>
351 <p class=
"p2"><br></p>
352 <p class=
"p4"><b>*replaceZeroesWithSilence(array)
</b></p>
353 <p class=
"p2"><br></p>
354 <p class=
"p4">Returns a new array, where every zero is replaced by a
<a href=
"Synth control/Silent.html"><span class=
"s9">Silent
</span></a> UGen. This is required internally sometimes for UGens like
<a href=
"InOut/Out.html"><span class=
"s9">Out
</span></a>.
</p>
355 <p class=
"p2"><br></p>
356 <p class=
"p4"><b>init(... theInputs)
</b></p>
357 <p class=
"p2"><br></p>
358 <p class=
"p4">By default, this method stores the inputs (e.g. the arguments to *ar and *kr) in the UGen. This may be overridden to do other initialisations, as long as the inputs are set correctly.
</p>
359 <p class=
"p7"><br></p>