MulAdd

final case
class MulAdd(in: GE, mul: GE, add: GE) extends SingleOut

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
trait Lazy
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

override
def toString: String
Definition Classes
Any

Inherited methods

final
def name: String
Inherited from
UGenSource
def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product

Inherited fields

lazy override
val hashCode: Int
Inherited from
UGenSource