This file is indexed.

/usr/share/SuperCollider/HelpSource/Classes/BinaryOpUGen.schelp is in supercollider-common 1:3.8.0~repack-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
class:: BinaryOpUGen
summary:: Apply a binary operation to the values of an input UGen
related:: Classes/UnaryOpUGen, Classes/BinaryOpFunction, Classes/Pbinop, Overviews/Operators
categories:: UGens>Algebraic

description::
BinaryOpUGens are created as the result of a binary operator applied to a link::Classes/UGen::.
code::
(SinOsc.ar(200) * ClipNoise.ar).dump;
(SinOsc.ar(200).thresh(0.5)).dump;
::
The use of the binary operators code::*:: and code::thresh:: above each instantiate a BinaryOpUGen. The operators themselves  (which are methods) are not to be confused with the resulting BinaryOpUGen (which is an object). The unary and binary operators are defined in link::Classes/UGen::'s superclass link::Classes/AbstractFunction::, which creates the
BinaryOpUGen as a result of the operation.

When operating on UGens instead of numbers, what results is not a result of the calculation, but a structure that represents that calculation. For the immediate operations on numbers, see for example link::Classes/SimpleNumber::.

See link::Overviews/Operators:: for an overview of common operators.

classmethods::
private:: new1

method::new
return a new instance that applies the operator code::selector:: to the UGens code::a:: and code::b:: normally, this is implicitly called when applying an operator to a link::Classes/UGen::.
argument:: selector
The selector symbol for the binary operator
argument:: a
left operand
argument:: b
right operand
returns:: A new instance of BinaryOpUGen

instancemethods::
private:: init, optimizeGraph, constantFolding

examples::

code::
a = WhiteNoise.ar; // a WhiteNoise
b = a + 2; // a BinaryOpUGen.
b.operator; // +

// sound example
(
{
	var a = LFSaw.ar(300);
	var b = LFSaw.ar(329.1);
	a % b * 0.1
}.play;
)
::

subsection::The comparison operators

The operators code:: >, >=, <, <= :: are particularly useful for triggering. They should not be confused with their use in conditionals. Compare:

code::
if(1 > 0) { "1 is greater than 0".postln }; // > returns a boolean
::

with

code::
// trigger an envelope
(
{
    var trig;
    trig = SinOsc.ar(1) > 0.1;
    EnvGen.kr(Env.perc, trig, doneAction: 0) * SinOsc.ar(440,0,0.1)
}.play
) // > outputs 0 or 1
::

See link::Overviews/Operators:: or the implementation of these in link::Classes/AbstractFunction:: for more detail.

Since the equality operator ( code::==:: ) is used to distinguish objects including UGens, it cannot be used to create a BinaryOpUGen by application. Instead, to get a trigger value each time two signals are the same (instead of just finding out whether two UGens are the same), one can instantiate a BinaryOpUGen directly:

code::
(
{
    var a = SinOsc.ar(1).round(0.1);
    var b = SinOsc.ar(1.2).round(0.1);
    BinaryOpUGen('==', a, b) * 0.1
}.play;
)
::