A UGen that switches between two input signal depending on which is changing
more. 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 = MostChange.kr(x, y)
val isX = c sig_== x
val isY = 1 - isX
// if X change stronger, modulate pan positionval p = LFTri.ar(c * 10 * isX)
// if Y change stronger, 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 more. Change is based on the absolute of the differentiation of the respective signals.
Examples
LeastChange