final case classMulAdd(in: GE, mul: GE, add: GE) extends SingleOut with Product with Serializable
A UGen that multiplies an input with another signal
and then adds a third signal. This can be used to translate
an element into a different value range.
Usually the graph element operator madd is used
instead of explicitly writing MulAdd.
MulAdd(in, mul, add) == in.madd(mul, add) == in * mul + add
Examples
// scale value range
play {
// input range -1 to +1,// output range ((-1 * 100) + 300) = 200// to ((+1 * 100) + 300) = 400val freq = SinOsc.kr(1).madd(100, 300) // or MulAdd(..., 100, 300)
freq.poll(label = "freq")
SinOsc.ar(freq) * 0.1
}
in
the input signal to scale and offset
mul
the scaling factor, applied first to the input
add
the offset, added after applying the multiplication
A UGen that multiplies an input with another signal and then adds a third signal. This can be used to translate an element into a different value range.
Usually the graph element operator
madd
is used instead of explicitly writingMulAdd
.Examples
the input signal to scale and offset
the scaling factor, applied first to the input
the offset, added after applying the multiplication
Sum4
Sum3
BinaryOpUGen