c

GEOps

Companion object GEOps

final classGEOps extends AnyVal

GEOps are operations for graph elements (GE). Instead of having these operations directly defined in each UGen, which is a huge list, they appear here as extension methods. Therefore, you can write SinOsc.ar.linLin ... as if linLin was defined for GE or SinOsc.

Many of these operations are defined for constant numbers, as well, for example you can write 0.5.linLin .... These operations are defined separately.

GE

Linear Supertypes
AnyVal, Any
Ordering
1. Alphabetic
2. By Inheritance
Inherited
1. GEOps
2. AnyVal
3. Any
1. Hide All
2. Show All
Visibility
1. Public
2. Protected

Instance Constructors

1. new GEOps(g: GE)

Value Members

1. final def !=(arg0: Any): Boolean
Definition Classes
Any
2. final def ##: Int
Definition Classes
Any
3. def %(b: GE): GE

Take the modulus of the signal.

Take the modulus of the signal. Negative input values are wrapped to positive ones, e.g. (DC.kr(-4) % 5) sig_== DC.kr(1). If the second operand is zero, the output is zero.

An alias for mod.

4. def &(b: GE): GE

Treats the signals as integer numbers and combines their bit representations through AND.

5. def *(b: GE): GE

Multiplies two signals.

6. def +(b: GE): GE

7. def -(b: GE): GE

Subtracts a signal from the receiver.

8. def /(b: GE): GE

Divides the receiver by another signal.

9. def <(b: GE): GE

Compares two signals and outputs one if the receiver is less than the argument.

10. def <<(b: GE): GE

Treats the signals as integer numbers and bit-shifts the receiver by the argument to the left.

11. def <=(b: GE): GE

Compares two signals and outputs one if the receiver is less than or equal to the argument.

Compares two signals and outputs one if the receiver is less than or equal to the argument.

Note that this can be surprising if the signals are not integer, because due to floating point noise two signals may be "almost identical" but not quite.

12. final def ==(arg0: Any): Boolean
Definition Classes
Any
13. def >(b: GE): GE

Compares two signals and outputs one if the receiver is greater than the argument.

Compares two signals and outputs one if the receiver is greater than the argument.

Example
// trigger an envelope
play {
val trig = SinOsc.ar(1) > 0
val env = EnvGen.kr(Env.perc, gate = trig, doneAction = doNothing) *
SinOsc.ar(440) * env * 0.1
}
14. def >=(b: GE): GE

Compares two signals and outputs one if the receiver is greater than or equal to the argument.

Compares two signals and outputs one if the receiver is greater than or equal to the argument.

Note that this can be surprising if the signals are not integer, because due to floating point noise two signals may be "almost identical" but not quite.

15. def >>(b: GE): GE

Treats the signals as integer numbers and bit-shifts the receiver by the argument to the right.

16. def ^(b: GE): GE

Treats the signals as integer numbers and combines their bit representations through XOR.

17. def abs: GE

Takes the absolute values or magnitudes of the signal (negative numbers become positive).

Takes the absolute values or magnitudes of the signal (negative numbers become positive).

signum

18. def absDif(b: GE): GE

Calculates the absolute difference of the two arguments, equivalent to the formula abs(a - b).

Calculates the absolute difference of the two arguments, equivalent to the formula abs(a - b).

Example
play {
// creates a pulsation
val mul = (SinOsc.ar(2) * 0.5) absDif 0.2
SinOsc.ar(440) * mul
}
19. def acos: GE

Uses the input signal as argument to the arc cosine (trigonometric) function.

Uses the input signal as argument to the arc cosine (trigonometric) function. Warning: produces NaN if the input is less than -1 or greater than +1

20. def amClip(b: GE): GE

Multiplies the input signal with the argument, while the argument is positive, otherwise outputs zero.

Multiplies the input signal with the argument, while the argument is positive, otherwise outputs zero. Thus equivalent to a * b.max(0).

Example
play {
// a sine envelope
WhiteNoise.ar.amClip(SinOsc.kr(1) * 0.2)
}
21. def ampDb: GE

Converts the input signal from a linear (amplitude) factor to a level in decibels (dB).

Converts the input signal from a linear (amplitude) factor to a level in decibels (dB). A unit amplitude of 1.0 corresponds with 0 dB. A factor or amplitude of 2.0 corresponds to c. +6 dB. A factor or amplitude of 0.5 corresponds wot c. -6 dB.

The inverse function is dbAmp.

dbAmp

22. final def asInstanceOf[T0]: T0
Definition Classes
Any
23. def asin: GE

Uses the input signal as argument to the arc sine (trigonometric) function.

Uses the input signal as argument to the arc sine (trigonometric) function. Warning: produces NaN if the input is less than -1 or greater than +1

24. def atan: GE

Uses the input signal as argument to the arc tangent (trigonometric) function.

Uses the input signal as argument to the arc tangent (trigonometric) function. It is also useful for "compressing" the range of an input signal.

There is also a binary operator atan2 for a greater (disambiguated) value range.

atan2

25. def atan2(b: GE): GE

Uses the input signal and the argument to calculate the arc tangent (trigonometric) function.

Uses the input signal and the argument to calculate the arc tangent (trigonometric) function. The input signal is the numerator ("x") and the argument b is the denominator ("y") of the parameter to arg tangent.

There is also a unary operator atan.

atan

26. def bilinRand: GE

Produces a random signal linearly distributed between -a and +a for input signal a.

Produces a random signal linearly distributed between -a and +a for input signal a.

rand2

27. def ceil: GE

Rounds the signal up to the next higher integer number.

Rounds the signal up to the next higher integer number.

floor

28. def clip(low: GE, high: GE): GE

Clips the receiver to a range defined by low and high.

Clips the receiver to a range defined by low and high. Outputs low if the receiver is smaller than low, and outputs high if the receiver is larger than high.

fold

wrap

clip2

29. def clip2(b: GE): GE

Clips the input signal to the range given by +/- the argument.

Clips the input signal to the range given by +/- the argument. If the input falls below -b, it is held at -b. If the input rises above +b, it is held at +b.

Example
play {
SinOsc.ar(500).clip2(Line.kr(0, 1, 8)) * 0.5
}

clip

30. def coin: GE

Produces a random signal taking the values zero or one, using the input signal as probability.

Produces a random signal taking the values zero or one, using the input signal as probability. If the input is 0.5, there is a 50:50 chance of the output sample becoming zero or one. If the input is 0.1, the chance of an output sample becoming zero is 90% and the chance of it becoming one is 10%.

If the input is zero or less than zero, the output is constantly zero. If the input is one or greater than one, the output is constantly one.

31. def cos: GE

Uses the input signal as argument to the cosine (trigonometric) function.

32. def cosh: GE

Uses the input signal as argument to the hyperbolic cosine (trigonometric) function.

33. def cpsMidi: GE

Converts the input signal from a frequency in cycles per second (Hertz) to a midi pitch number.

Converts the input signal from a frequency in cycles per second (Hertz) to a midi pitch number. A frequency of 440 cps corresponds to the midi pitch of 69 or note A4.

The inverse function is midiCps.

midiCps

34. def cpsOct: GE

Converts the input signal from a frequency in cycles per second (Hertz) to a "decimal octave".

Converts the input signal from a frequency in cycles per second (Hertz) to a "decimal octave". A frequency of 261.626 cps corresponds to the note C4 or "decimal octave" 4.0.

The inverse function is cpsOct.

cpsOct

35. def cubed: GE

Takes the signal to the power of three, equivalent to a * a * a.

Takes the signal to the power of three, equivalent to a * a * a.

pow

36. def dbAmp: GE

Converts the input signal from a level in decibels (dB) to a linear factor.

Converts the input signal from a level in decibels (dB) to a linear factor. A level of 0 dB corresponds to a factor of 1.0. A level of +6 dB corresponds to a factor of c. 2.0 (double amplitude). A level of -6 dB corresponds to a factor of c. 0.5 (half amplitude).

The inverse function is ampDb.

ampDb

37. def difSqr(b: GE): GE

Calculates the difference of the squared arguments, equivalent to the formula (a*a) - (b*b).

Calculates the difference of the squared arguments, equivalent to the formula (a*a) - (b*b).

Example
play {
(SinOsc.ar(800) difSqr SinOsc.ar(XLine.kr(200, 500, 5))) * 0.125
}
38. def distort: GE

Produces a non-linear distortion using the formula a / (1 + abs(a)).

Produces a non-linear distortion using the formula a / (1 + abs(a)).

Example
// gradually increasing amount of distortion
play {
(SinOsc.ar(500) * XLine.kr(0.1, 10, 10)).distort * 0.25
}

softClip

39. def excess(b: GE): GE

Produces the difference of the input signal and it being clipped to the argument.

Produces the difference of the input signal and it being clipped to the argument. Thus equivalent to a - a.clip2(b).

Example
play {
SinOsc.ar(500).excess(Line.kr(0, 1, 8)) * 0.5
}
40. def exp: GE

Exponentiates the signal (with base e).

Exponentiates the signal (with base e).

The inverse function is log.

log

41. def expExp(inLow: GE, inHigh: GE, outLow: GE, outHigh: GE): GE

Scales the input signal a from an exponential source range to an exponential target range.

Scales the input signal a from an exponential source range to an exponential target range. The formula is (outHigh / outLow).pow((a / inLow).log / (inHigh / inLow).log) * outLow.

42. def expLin(inLow: GE, inHigh: GE, outLow: GE, outHigh: GE): GE

Scales the input signal a from an exponential source range to a linear target range.

Scales the input signal a from an exponential source range to a linear target range. The formula is (a / inLow).log / (inHigh / inLow).log * (outHigh - outLow) + outLow.

43. def expRand(b: GE): GE

Outputs random values exponentially distributed between the two signals.

44. def firstArg(b: GE): GE

A dummy operation that ensures the topological order of the receiver UGen and the argument UGen.

A dummy operation that ensures the topological order of the receiver UGen and the argument UGen. It ensures that the receiver is placed before the argument. Rarely used.

Example
// useful when two UGens need to be called, but only one of their outputs is used
play {
val a = Dpoll(Dseq(Seq(1, 2, 3, 4), inf), label = "a")
val b = Dpoll(Dseq(Seq(1955, 1952, 1823, 1452), inf), label = "b")
val c = Dpoll(a firstArg b, label = "a firstArg b ")  // c = a
Duty.kr(0.4, 0, c)
()
}
45. def flatten: GE

Creates a Flatten graph element that "flattens" the channels from a nested multi-channel structure, into a one-dimensional multi-channel structure.

Creates a Flatten graph element that "flattens" the channels from a nested multi-channel structure, into a one-dimensional multi-channel structure.

For example Pan.ar(SinOsc.ar(Seq(400, 600))) is a nested multi-channel structure, which appears as two channels (nested) during expansion. Instead, Pan.ar(SinOsc.ar(Seq(400, 600))).flatten appears as a flat four-channel signal.

Flatten

46. def floor: GE

Rounds the signal down to the next lower integer number.

Rounds the signal down to the next lower integer number.

ceil

47. def fold(low: GE, high: GE): GE

Folds or "reflects" the input signal at the boundaries given by the arguments.

Folds or "reflects" the input signal at the boundaries given by the arguments. For example, with low = -2 and high = +3 if the input falls below -2, it is reflected such that input -2.1 becomes output -1.9. If the input rises above +3, it is reflected such that input +3.1 becomes output +2.9.

clip

wrap

fold2

48. def fold2(b: GE): GE

Folds or "reflects" the input signal at the boundaries given by +/- the argument.

Folds or "reflects" the input signal at the boundaries given by +/- the argument. For example, with boundaries of +/- 2, if the input falls below -2, it is reflected such that input -2.1 becomes output -1.9. If the input rises above +2, it is reflected such that input +2.1 becomes output +1.9.

Example
play {
SinOsc.ar(500).fold2(Line.kr(0, 1, 8)) * 0.5
}

clip2

wrap2

fold

49. def frac: GE

Takes the fractional part of the signal, equivalent to modulus 1.0.

Takes the fractional part of the signal, equivalent to modulus 1.0.

trunc

50. def gcd(b: GE): GE

Treats the signals as integer numbers and outputs the greatest common divisor of both.

Treats the signals as integer numbers and outputs the greatest common divisor of both. This extends the usual definition by returning a negative number if both operands are negative. "greater" means "divisible by" in this interpretation, so -1 gcd -1 returns a negative number.

Example
// rhythmic pitch patterns with mouse control
play {
val mx = MouseX.kr(-200, 200)
val my = MouseY.kr(-200, 200)
val freq = (SinOsc.kr(0.3) * 20).gcd(GESeq(mx, my)) * 30 + 500
SinOsc.ar(freq) * 0.1
}

lcm

51. def getClass(): Class[_ <: AnyVal]
Definition Classes
AnyVal → Any
52. def hannWindow: GE

Scans the von Hann window function between the input signal's range of 0 and 1.

Scans the von Hann window function between the input signal's range of 0 and 1. The Hann window is a raised cosine starting and ending at zero at the interval boundaries, and going to 1.0 at the center (input 0.5). Outside of the interval [0, 1], the output will be zero.

53. def hypot(b: GE): GE

Calculates the hypotenuse of both signals, or the square root of the sum of the squares of both.

Calculates the hypotenuse of both signals, or the square root of the sum of the squares of both.

Example
// hypot used to calculate a Doppler shift pitch and amplitude based on distance.
play {
// object travels 200 meters in 6 secs (= 120 km/h) passing 10 meters
// from the listener
val x = 10
val y = LFSaw.kr(1.0/6) * 100
val distance = x hypot y
val velocity = Slope.kr(distance)
val pitchRatio = (344 - velocity) / 344  // speed of sound is around 344 m/s
val amplitude = 20 / distance.squared
SinOsc.ar(500 * pitchRatio) * amplitude
}

hypotApx

54. def hypotApx(b: GE): GE

An approximate and thus faster version of hypot to calculate the hypotenuse of both signals, or the square root of the sum of the squares of both.

An approximate and thus faster version of hypot to calculate the hypotenuse of both signals, or the square root of the sum of the squares of both.

hypot

55. final def isInstanceOf[T0]: Boolean
Definition Classes
Any
56. def lcm(b: GE): GE

Treats the signals as integer numbers and outputs the least common multiple of both.

Treats the signals as integer numbers and outputs the least common multiple of both. This extends the usual definition by returning a negative number if any of the operands is negative.

Example
// rhythmic pitch patterns with mouse control
play {
val mx = MouseX.kr(-20, 20)
val my = MouseY.kr(-20, 20)
SinOsc.ar((SinOsc.kr(0.3) * 20) lcm (GESeq(mx, my) * 30 + 500)) * 0.1
}

gcd

57. def linExp(inLow: GE, inHigh: GE, outLow: GE, outHigh: GE): GE

Scales the input signal a from a linear source range to an exponential target range.

Scales the input signal a from a linear source range to an exponential target range. The formula is (outHigh / outLow).pow((a - inLow) / (inHigh - inLow)) * outLow.

58. def linLin(inLow: GE, inHigh: GE, outLow: GE, outHigh: GE): GE

Scales the input signal a from a linear source range to a linear target range.

Scales the input signal a from a linear source range to a linear target range. The formula is (a - inLow) / (inHigh - inLow) * (outHigh - outLow) + outLow.

59. def linRand: GE

Produces a random signal linearly distributed between zero and the input signal.

Produces a random signal linearly distributed between zero and the input signal.

rand

60. def log: GE

Takes the natural logarithm of the input signal.

Takes the natural logarithm of the input signal.

Warning: Outputs NaN if the input is negative, and -Infinity if the input is zero.

The inverse function is exp.

exp

log2

log10

61. def log10: GE

Takes the logarithm of the input signal, using base 10.

Takes the logarithm of the input signal, using base 10.

Warning: Outputs NaN if the input is negative, and -Infinity if the input is zero.

log

log2

62. def log2: GE

Takes the logarithm of the input signal, using base 2.

Takes the logarithm of the input signal, using base 2.

Warning: Outputs NaN if the input is negative, and -Infinity if the input is zero.

log

log10

63. def max(b: GE): GE

Outputs the larger of two signals.

Outputs the larger of two signals.

Example
// LFO distorts and envelopes z
play {
val z = SinOsc.ar(500)
z max SinOsc.ar(0.1)
}
64. def midiCps: GE

Converts the input signal from midi pitch to a frequency in cycles per second (Hertz).

Converts the input signal from midi pitch to a frequency in cycles per second (Hertz). A midi pitch of 69 corresponds to A4 or 440 cps. A pitch of 69 + 12 = 81 is one octave up, i.e. A5 or 880 cps.

The inverse function is cpsMidi.

Example
// midi pitch from 24 to 108 to oscillator frequency
play {
Saw.ar(Line.kr(24, 108, dur = 10).midiCps) * 0.2
}

cpsMidi

65. def midiRatio: GE

Converts the input signal from midi pitch interval to a frequency ratio.

Converts the input signal from midi pitch interval to a frequency ratio. An interval of zero corresponds to unison and thus a frequency ratio of 1.0. An interval of +12 corresponds to an octave up or ratio of 2.0. An interval of -12 corresponds to an octave down or ratio of (1.0/2.0) = 0.5.

The inverse function is ratioMidi.

ratioMidi

66. def min(b: GE): GE

Outputs the smaller of two signals.

Outputs the smaller of two signals.

Example
// LFO distorts and envelopes z
play {
val z = SinOsc.ar(500)
z min SinOsc.ar(0.1)
}
67. def mod(b: GE): GE

Take the modulus of the signal.

Take the modulus of the signal. Negative input values are wrapped to positive ones, e.g. DC.kr(-4).mod(5) sig_== DC.kr(1) If the second operand is zero, the output is zero.

Creates a MulAdd UGen, by first multiplying the receiver with mul, then adding the add parameter. It can be used to change the value range of the receiver. For example, SinOsc has a nominal range of -1 to +1. Using SinOsc.ar.mulAdd(3, 4) that range would become (-1 * 3) + 4 = 1 to (+1 * 3) + 4 = 7.

69. def octCps: GE

Converts the input signal from "decimal octaves" to a frequency in cycles per second (Hertz).

Converts the input signal from "decimal octaves" to a frequency in cycles per second (Hertz). For example, octave 4 begins with 4.0 or note C4, corresponding to 261.626 cps. The tritone above that (plus 6 semitones or half an octave), is "decimal octave" 4.5, corresponding with note F♯4 or 369.994 cps.

The inverse function is cpsOct.

cpsOct

70. def out(range: Range): GE

Creates a proxy that represents a specific range of output channels of the element.

Creates a proxy that represents a specific range of output channels of the element.

range

a range of channels, zero-based. Indices which are greater than or equal to the number of outputs are wrapped around.

returns

a new element that represents the given channels of the receiver

ChannelRangeProxy

71. def out(index: Int): GE

Creates a proxy that represents a specific output channel of the element.

Creates a proxy that represents a specific output channel of the element.

index

channel-index, zero-based. Indices which are greater than or equal to the number of outputs are wrapped around.

returns

a monophonic element that represents the given channel of the receiver

ChannelProxy

72. def poll(trig: GE = 10, label: String = "\$auto", trigId: GE = -1): Poll

Polls the output values of this graph element, and prints the result to the console.

Polls the output values of this graph element, and prints the result to the console. This is a convenient method for wrapping this graph element in a Poll UGen.

trig

a signal to trigger the printing. If this is a constant, it is interpreted as a frequency value and an Impulse generator of that frequency is used instead.

label

a string to print along with the values, in order to identify different polls. Using the special label "\$auto" (default) will generated automatic useful labels using information from the polled graph element

trigId

if greater then 0, a "/tr" OSC message is sent back to the client (similar to SendTrig)

de.sciss.synth.ugen.Poll

73. def poll: Poll

Creates a Poll UGen, printing the receiver's values to the console, ten times a second.

Creates a Poll UGen, printing the receiver's values to the console, ten times a second.

Poll

74. def pow(b: GE): GE

Takes the power of the signal.

Takes the power of the signal.

Warning: Unlike a normal power operation, the signum of the left operand is always preserved. I.e. DC.kr(-0.5).pow(2) will not output 0.25 but -0.25. This is to avoid problems with floating point noise and negative input numbers, so DC.kr(-0.5).pow(2.001) does not result in a NaN, for example.

75. def ramp: GE

Scans a ramp function rising from zero to one across the input signals' range of 0 and 1.

Scans a ramp function rising from zero to one across the input signals' range of 0 and 1. The function moves linearly from the zero at the interval start to 1.0 at the interval end. When the input is smaller than zero, the output is zero, and when the input is larger than one, the output is one.

76. def rand: GE

Produces a random signal evenly distributed between zero and the input signal.

Produces a random signal evenly distributed between zero and the input signal.

linRand

77. def rand2: GE

Produces a random signal evenly distributed between -a and +a for input signal a.

Produces a random signal evenly distributed between -a and +a for input signal a.

bilinRand

78. def rangeRand(b: GE): GE

Outputs random values evenly distributed between the two signals.

79. def ratioMidi: GE

Converts the input signal from a frequency ratio to a midi pitch interval.

Converts the input signal from a frequency ratio to a midi pitch interval. A frequency ratio of 1.0 corresponds to the unison or midi interval 0. A ratio of 2.0 corresponds to an octave up or the midi pitch interval +12. A ratio of 0.5 corresponds to an octave down or the midi pitch interval -12.

The inverse function is midiRatio.

midiRatio

80. def reciprocal: GE

Takes the reciprocal value of the input signal, equivalent to 1.0 / a.

Takes the reciprocal value of the input signal, equivalent to 1.0 / a.

Warning: Outputs NaN if the input is zero ("division by zero").

81. def rectWindow: GE

Scans the rectangular window function between the input signal's range of 0 and 1.

Scans the rectangular window function between the input signal's range of 0 and 1. A rectangular window has value 1.0 at every point in the interval [0, 1]. Outside of that range, the output will be zero.

82. def ring1(b: GE): GE

An optimized operation on the signals corresponding to the formula a * b + a.

An optimized operation on the signals corresponding to the formula a * b + a.

Example
play {
(SinOsc.ar(800) ring1 SinOsc.ar(XLine.kr(200, 500, 5))) * 0.125
}
83. def ring2(b: GE): GE

An optimized operation on the signals corresponding to the formula a * b + a + b.

An optimized operation on the signals corresponding to the formula a * b + a + b.

Example
play {
(SinOsc.ar(800) ring2 SinOsc.ar(XLine.kr(200, 500, 5))) * 0.125
}
84. def ring3(b: GE): GE

An optimized operation on the signals corresponding to the formula a * a * b.

An optimized operation on the signals corresponding to the formula a * a * b.

Example
play {
(SinOsc.ar(800) ring3 SinOsc.ar(XLine.kr(200, 500, 5))) * 0.125
}
85. def ring4(b: GE): GE

An optimized operation on the signals corresponding to the formula a * a * b - b * b * a.

An optimized operation on the signals corresponding to the formula a * a * b - b * b * a.

Example
play {
(SinOsc.ar(800) ring4 SinOsc.ar(XLine.kr(200, 500, 5))) * 0.125
}
86. def roundTo(b: GE): GE

Rounds the input signal up or down to a given degree of coarseness.

Rounds the input signal up or down to a given degree of coarseness. For example, roundTo(1.0) rounds to the closest integer, roundTo(0.1) rounds to the closest number for which modulus 0.1 is zero.

87. def roundUpTo(b: GE): GE

Rounds the input signal up to a given degree of coarseness.

Rounds the input signal up to a given degree of coarseness. For example, roundUpTo(1.0) rounds up to the closest integer, roundTo(0.1) rounds up to the closest number for which modulus 0.1 is zero.

88. def sCurve: GE

Scans a sinusoidal S-shaped function ("easy in, easy out") rising from zero to one across the input signals' range of 0 and 1.

Scans a sinusoidal S-shaped function ("easy in, easy out") rising from zero to one across the input signals' range of 0 and 1. The function begins to rise from the zero at the interval start to 0.5 at the center to 1.0 at the interval end. When the input is smaller than zero, the output is zero, and when the input is larger than one, the output is one.

89. def scaleNeg(b: GE): GE

Scales the negative part of the input by the argument, outputs positive input unaltered.

Scales the negative part of the input by the argument, outputs positive input unaltered. Thus equivalent to a.min(0) * b + a.max(0).

Example
play {
// increasing half-wave asymmetry
(SinOsc.ar(500) * 0.25).scaleNeg(Line.ar(1, -1, 4))
}
90. def sig_!=(b: GE): GE

Compares two signals and outputs one if they are different, otherwise zero.

Compares two signals and outputs one if they are different, otherwise zero.

Note that this can be surprising if the signals are not integer, because due to floating point noise two signals may be "almost identical" but not quite, thus resulting in an output of one.

91. def sig_==(b: GE): GE

Compares two signals and outputs one if they are identical, otherwise zero.

Compares two signals and outputs one if they are identical, otherwise zero.

Note that this can be surprising if the signals are not integer, because due to floating point noise two signals may be "almost identical" but not quite, thus resulting in an output of zero.

92. def signum: GE

Takes the signum of the signal, being 1 for positive signals, -1 for negative signals, and zero for a zero input.

Takes the signum of the signal, being 1 for positive signals, -1 for negative signals, and zero for a zero input.

abs

93. def sin: GE

Uses the input signal as argument to the sine (trigonometric) function.

94. def sinh: GE

Uses the input signal as argument to the hyperbolic sine (trigonometric) function.

95. def softClip: GE

Produces a non-linear distortion, wherein the input range of -0.5 to +0.5 is linear.

Produces a non-linear distortion, wherein the input range of -0.5 to +0.5 is linear.

Example
// gradually increasing amount of distortion
play {
(SinOsc.ar(500) * XLine.kr(0.1, 10, 10)).softClip * 0.25
}

distort

96. def sqrDif(b: GE): GE

Squares the difference of the two arguments, equivalent to the formula (a - b) * (a - b).

Squares the difference of the two arguments, equivalent to the formula (a - b) * (a - b).

Example
play {
(SinOsc.ar(800) sqrDif SinOsc.ar(XLine.kr(200, 500, 5))) * 0.125
}
97. def sqrSum(b: GE): GE

Squares the sum of the two arguments, equivalent to the formula (a + b) * (a + b).

Squares the sum of the two arguments, equivalent to the formula (a + b) * (a + b).

Example
play {
(SinOsc.ar(800) sqrSum SinOsc.ar(XLine.kr(200, 500, 5))) * 0.125
}
98. def sqrt: GE

Takes the square root of the signal.

Takes the square root of the signal. If the input is negative, it returns the negative of the square root of the absolute value, i.e. sqrt(-2) == -sqrt(2), so the output is valid for any input.

pow

99. def squared: GE

Takes the square of the signal, equivalent to a * a.

Takes the square of the signal, equivalent to a * a.

pow

100. def sum3Rand: GE

Produces a random signal following an approximated Gaussian distribution between zero and the input signal.

Produces a random signal following an approximated Gaussian distribution between zero and the input signal. It follows the formula Mix.fill(3)(Rand(0.0, 1.0)) - 1.5 * (2.0/3), thus summing three evenly distributed signals

101. def sumSqr(b: GE): GE

Calculates the sum of the squared arguments, equivalent to the formula (a*a) + (b*b).

Calculates the sum of the squared arguments, equivalent to the formula (a*a) + (b*b).

Example
play {
(SinOsc.ar(800) sumSqr SinOsc.ar(XLine.kr(200, 500, 5))) * 0.125
}
102. def tan: GE

Uses the input signal as argument to the tangent (trigonometric) function.

103. def tanh: GE

Uses the input signal as argument to the hyperbolic tangent (trigonometric) function.

104. def thresh(b: GE): GE

A threshold comparison where the output is zero when input signal is less than the argument, otherwise the input signal is passed.

A threshold comparison where the output is zero when input signal is less than the argument, otherwise the input signal is passed.

Example
play {
// a low-rent gate
(LFNoise0.ar(50) * 0.5) thresh 0.45
}

de.sciss.synth.ugen.Gate

105. def toString()
Definition Classes
Any
106. def triWindow: GE

Scans the triangular window function between the input signal's range of 0 and 1.

Scans the triangular window function between the input signal's range of 0 and 1. The triangular window moves from linearly from the zero at the interval start to 1.0 at the center (input 0.5) back to 0.0 at the interval end. Outside of the interval [0, 1], the output will be zero.

107. def trunc(b: GE): GE

Removes the fractional part of the input signal.

Removes the fractional part of the input signal.

frac

108. def unary_!: GE

Logically negates the signal.

Logically negates the signal. Outputs 1 if the signal is greater than zero, otherwise outputs 0.

109. def unary_-: GE

Negatives the signal.

Negatives the signal. As if multiplying the signal by -1.

Example
// pseudo-stereo by phase inversion
play {
val a = LFNoise1.ar(1500) * 0.5
Seq(a, -a)
}
110. def unary_~: GE

Treats the signal as integer numbers and inverts its bits.

111. def welchWindow: GE

Scans the Welch window function between the input signal's range of 0 and 1.

Scans the Welch window function between the input signal's range of 0 and 1. The Welch window is a parabolic curve starting and ending at zero at the interval boundaries, and going to 1.0 at the center (input 0.5). Outside of the interval [0, 1], the output will be zero.

112. def wrap(low: GE, high: GE): GE

Wraps the input signal at the boundaries given by the arguments.

Wraps the input signal at the boundaries given by the arguments. If the input falls below low, it is wrapped back to high. If the input rises above high, it is wrapped back to low.

clip

fold

wrap2

113. def wrap2(b: GE): GE

Wraps the input signal at the boundaries given by +/- the argument.

Wraps the input signal at the boundaries given by +/- the argument. If the input falls below -b, it is wrapped back to +b. If the input rises above +b, it is wrapped back to -b.

Example
play {
SinOsc.ar(500).wrap2(Line.kr(0, 1, 8)) * 0.5
}

clip2

fold2

wrap

114. def |(b: GE): GE

Treats the signals as integer numbers and combines their bit representations through OR.