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 mulAdd
is used
instead of explicitly writing MulAdd
.
MulAdd(in, mul, add) == in.mulAdd(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) = 400
val freq = SinOsc.kr(1).mulAdd(100, 300) // or MulAdd(..., 100, 300)
freq.poll(label = "freq")
SinOsc.ar(freq) * 0.1
}
- Value Params
- add
the offset, added after applying the multiplication
- in
the input signal to scale and offset
- mul
the scaling factor, applied first to the input
- See also
- Companion
- object
trait Serializable
class SingleOut
class SomeOut
trait Lazy
trait GE
class UGenSource[UGenInLike]
trait Expander[UGenInLike]
trait Lazy
trait Product
trait Equals
class Object
trait Matchable
class Any