[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] trigger when value changes



HPZ2?   = out(i) = 0.25 * (in(i) - (2*in(i-1)) + in(i-2))

I always use HPZ1.kr(x).abs > 0 to measure instantaneous value changes - since first, you're only interested in the difference between two successive samples (HPZ1) where HPZ2 looks at 3 successive samples, and second, you can't assume the change will always be positive (hence .abs).

hjh

On Dec 27, 2007, at 6:12 AM, Julian Rohrhuber wrote:

hey

is there a UGen which produce a trigger signal (kr) when a value changes? like InTrig for arguments.


a = { |x| Decay.kr(HPZ2.kr(x) > 0, 0.01) * SinOsc.ar(4000) * 0.1 }.play;

a.set(\x, 1.0.rand);


: H. James Harkins

: jamshark70@xxxxxxxxxxxxxxxxx

: http://www.dewdrop-world.net

.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:


"Come said the Muse,

Sing me a song no poet has yet chanted,

Sing me the universal."  -- Whitman