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: 13.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 Monaco
; min-height: 12.0px}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #cd1612}
15 p
.p6
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #000000}
16 p
.p7
{margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 12.0px Helvetica
}
17 p
.p8
{margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 12.0px Helvetica
; min-height: 14.0px}
18 p
.p9
{margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco
; min-height: 12.0px}
19 p
.p10
{margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco
; color: #000000}
20 p
.p11
{margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco
}
21 p
.p12
{margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco
; color: #cd1612}
22 span
.s1
{font: 18.0px Helvetica
}
23 span
.s2
{color: #1135f9}
24 span
.s3
{font: 12.0px Helvetica
; color: #000000}
25 span
.s4
{color: #00831b}
26 span
.s5
{color: #cd1612}
27 span
.s6
{font: 12.0px Helvetica
}
28 span
.s7
{color: #000000}
29 span
.Apple-tab-span
{white-space:pre
}
33 <p class=
"p1"><span class=
"s1"><b>Warp
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b></span><b>specification of a shape for a mapping of numerical input
<span class=
"Apple-converted-space"> </span></b></p>
34 <p class=
"p2"><br></p>
35 <p class=
"p3"><b>Inherits from:
</b><a href=
"../Core/Object.html"><span class=
"s2"><b>Object
</b></span></a><b><span class=
"Apple-converted-space"> </span></b></p>
36 <p class=
"p4"><br></p>
37 <p class=
"p3">The subclasses of Warp specify translations from input (a number) to an output (another number).
<span class=
"Apple-converted-space"> </span><b> </b>This is an abstract class – already available shapes are
<i>linear
</i>,
<i>exponential
</i>,
<i>sine
</i>,
<i>cosine
</i>,
<i>decibel
</i>,
<i>curve
</i> (this is similar to the curves in envelopes, see also
<a href=
"Env.html"><span class=
"s2">Env
</span></a>).
<span class=
"Apple-converted-space"> </span></p>
38 <p class=
"p2"><br></p>
39 <p class=
"p3">Warps are internally created by
<a href=
"ControlSpec.html"><span class=
"s2">ControlSpec
</span></a>. Usually they are created by the message
<b>asWarp
</b>, understood by symbols and numbers. A warp has a
<a href=
"Spec.html"><span class=
"s2">Spec
</span></a> to specify a certain range of input and output values.
</p>
40 <p class=
"p2"><br></p>
41 <p class=
"p5"><span class=
"s3"><span class=
"Apple-tab-span"> </span></span>// create a new warp:
</p>
42 <p class=
"p6"><span class=
"Apple-tab-span"> </span>a =
<span class=
"s4">\exp
</span>.asWarp;
</p>
43 <p class=
"p6"><span class=
"Apple-tab-span"> </span>a = -
4.asWarp;
<span class=
"s5">// a curve warp;
</span></p>
44 <p class=
"p2"><br></p>
45 <p class=
"p7"><b><span class=
"Apple-tab-span"> </span>map (value)
</b></p>
46 <p class=
"p8"><b><span class=
"Apple-tab-span"> </span></b></p>
47 <p class=
"p7"><b><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b>Maps and constrains a
<b>value
</b> between
0 and
1 to the output domain.
</p>
48 <p class=
"p8"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
49 <p class=
"p9"><br></p>
50 <p class=
"p7"><b><span class=
"Apple-tab-span"> </span>unmap (value)
</b></p>
51 <p class=
"p7"><b><span class=
"Apple-tab-span"> </span></b>in the output domain to a value in the range between
0 and
1.
</p>
52 <p class=
"p8"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
53 <p class=
"p10"><span class=
"s6"><span class=
"Apple-tab-span"> </span></span>g = -
3.asWarp;
</p>
54 <p class=
"p11"><span class=
"Apple-tab-span"> </span>g.map(
0.5);
</p>
55 <p class=
"p11"><span class=
"Apple-tab-span"> </span>g.unmap(
0.9);
<span class=
"s5"><span class=
"Apple-tab-span"> </span></span></p>
56 <p class=
"p9"><span class=
"Apple-tab-span"> </span></p>
57 <p class=
"p12"><span class=
"s7"><span class=
"Apple-tab-span"> </span></span>// fore and back translation should be identical:
</p>
58 <p class=
"p11"><span class=
"Apple-tab-span"> </span>g.unmap(g.map(
0.5));
</p>
59 <p class=
"p8"><b><span class=
"Apple-tab-span"> </span></b></p>
60 <p class=
"p2"><br></p>
61 <p class=
"p4"><span class=
"Apple-tab-span"> </span></p>