Mix

final case
class Mix(elem: GE) extends SingleOut

A graph element that mixes the channels of a signal together. It works like the sclang counterpart.

The Mix companion object contains various useful mixing idioms:

  • Mix.tabulate(n: Int)(fun: Int => GE): corresponds to Seq.tabulate and to Array.fill in sclang.
  • Mix.fill(n: Int)(thunk: => GE): corresponds to Seq.fill.
  • Mix.seq(elems: GE*): A shortcut for Mix(GESeq(elems: _*)).

A separate graph element is Mix.mono. Mix.mono(elem: GE) flattens all channels of the input element before summing them, guaranteeing that the result is monophonic.

Finally, Mix.fold is an idiom that not actually adds elements, but recursively folds them. Thus, Mix.fold(elem: GE, n: Int)(fun: GE => GE) is equivalent to

(1 to n).foldLeft(elem) { (res, _) => fun(res) }

Mix.fold is often used in the SuperCollider examples to apply a filtering process such as reverberation several times. For cases where the iteration index is needed, the full form as shown above can be used instead.

Value Params
elem

the graph element whose channels to mix together

See also

BinaryOpUGen

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

Value members

Concrete methods

def rate: MaybeRate
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