Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / HelpSource / Classes / BinaryOpFunction.schelp
blob1459c139b04ec65328760adba3e903948b81d54e
1 class:: BinaryOpFunction
2 summary:: represent a binary operation on a function
3 categories:: Core
4 related:: Classes/UnaryOpFunction,Classes/NAryOpFunction,Classes/BinaryOpStream,Classes/Pbinop
6 description::
8 Operating on functions instead of numbers, what results is not a result of the calculation, but a structure that represents that calculation.
10 instanceMethods::
12 private::storeOn
14 method::value
16 Executes each of the operand functions and then performs the selector on the result.
18 method::valueArray
20 the same as link::#-value::
22 examples::
24 code::
25 // example
26 a = 5 + 7; // result is 12.
27 a = { b } + 7; // result is  a BinaryOpFunction
28 b = 5;
29 a.value; // now it is evaluated, and the result is calculated
30 b = 8;
31 a.value; // again, with a different value.
34 code::
35 // sound example
37 var a = { 19.rand };
38 var b = { [5, 8, 9].choose };
39 var c = a + b;
40 fork {
41         15.do {
42                 (instrument: \default, note: [c.value, a.value]).play;
43                 0.3.wait;
44         }