Removing an old, cherished, yet pointless caveat "This documentation is
[supercollider.git] / Help / Core / BinaryOpFunction.html
blob1df7163f84f89d6c8df6e8ecdc3de8ecc333f9f0
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="949.43">
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: 12.0px Helvetica; color: #000000; min-height: 14.0px}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #bf0000}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000}
15 p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #9d1c12; min-height: 12.0px}
16 p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #0021e7}
17 p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #0033f1}
18 span.s1 {font: 18.0px Helvetica}
19 span.s2 {color: #000000}
20 span.s3 {font: 12.0px Helvetica; color: #0021e7}
21 span.s4 {font: 12.0px Helvetica; color: #0024f8}
22 span.s5 {font: 12.0px Helvetica; color: #0033f1}
23 span.s6 {font: 12.0px Helvetica; color: #0000ff}
24 span.s7 {color: #0000bf}
25 span.s8 {color: #007300}
26 span.Apple-tab-span {white-space:pre}
27 </style>
28 </head>
29 <body>
30 <p class="p1"><span class="s1"><b>BinaryOpFunction<span class="Apple-tab-span"> </span></b></span><b>represent a binary oparation on a function</b></p>
31 <p class="p2"><br></p>
32 <p class="p1"><b>superclass: AbstractFunction</b></p>
33 <p class="p2"><br></p>
34 <p class="p1">Operating on functions instead of numbers, what results is not a result of the calculation, but a structure that represents that calculation.</p>
35 <p class="p3"><br></p>
36 <p class="p4">// example</p>
37 <p class="p4"><span class="s2">a = 5 + 7; </span>// result is 12.</p>
38 <p class="p4"><span class="s2">a = { b } + 7; </span>// result is<span class="Apple-converted-space">  </span>a BinaryOpFunction</p>
39 <p class="p5">b = 5;</p>
40 <p class="p4"><span class="s2">a.value; </span>// now it is evaluated, and the result is calculated</p>
41 <p class="p5">b = 8;</p>
42 <p class="p4"><span class="s2">a.value; </span>// again, with a different value.</p>
43 <p class="p6"><br></p>
44 <p class="p7"><span class="s2">see also: <a href="UnaryOpFunction.html"><span class="s3">UnaryOpFunction</span></a>, <a href="NAryOpFunction.html"><span class="s4">NAryOpFunction</span></a></span></p>
45 <p class="p8"><span class="s2">related: <a href="../Streams-Patterns-Events/BinaryOpStream.html"><span class="s5">BinaryOpStream</span></a>, <a href="../Streams-Patterns-Events/Patterns/Pbinop.html"><span class="s6">Pbinop</span></a></span></p>
46 <p class="p2"><br></p>
47 <p class="p3"><br></p>
48 <p class="p4">// sound example</p>
49 <p class="p5">(</p>
50 <p class="p5"><span class="s7">var</span> a = { 19.rand };</p>
51 <p class="p5"><span class="s7">var</span> b = { [5, 8, 9].choose };</p>
52 <p class="p5"><span class="s7">var</span> c = a + b;</p>
53 <p class="p5">fork {</p>
54 <p class="p5"><span class="Apple-tab-span"> </span>15.do {</p>
55 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>(instrument: <span class="s8">\default</span>, note: [c.value, a.value]).play;</p>
56 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>0.3.wait;</p>
57 <p class="p5"><span class="Apple-tab-span"> </span>}</p>
58 <p class="p5">}</p>
59 <p class="p5">)</p>
60 </body>
61 </html>