LeastChange

object LeastChange extends ProductReader[LeastChange]

A UGen that switches between two input signal depending on which is changing less. Change is based on the absolute of the differentiation of the respective signals.

===Examples===

// mouse-x versus mouse-y
play {
 val x   = MouseX.kr(lag = 1)
 val y   = MouseY.kr(lag = 1)
 val c   = LeastChange.kr(x, y)
 val isX = c sig_== x
 val isY = 1 - isX
 // if X change weaker, modulate pan position
 val p   = LFTri.ar(c * 10 * isX)
 // if Y change weaker, modulate sine frequency
 val f   = LFTri.ar(c * 10 * isY).linExp(-1, 1, 100, 4000)
 // report current state
 c.poll(5, "c")
 x.poll(isX, "now X")
 y.poll(isY, "now Y")
 Pan2.ar(SinOsc.ar(f) * 0.1, p)
}
See also
Companion
class
trait Product
trait Mirror
trait ProductReader[LeastChange]
class Object
trait Matchable
class Any

Type members

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from
Mirror

Value members

Concrete methods

def ar(a: GE, b: GE): LeastChange
Value Params
a

first input signal to select from

b

second input signal to select from

def kr(a: GE, b: GE): LeastChange
Value Params
a

first input signal to select from

b

second input signal to select from

def read(in: RefMapIn, key: String, arity: Int): LeastChange