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 positionval p = LFTri.ar(c * 10 * isX)
// if Y change weaker, modulate sine frequencyval 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)
}
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
MostChange