[Sc-devel] LastValue ugen - 0 as 2nd arg
Fredrik Olofsson
f at fredrikolofsson.com
Mon Jun 16 04:29:00 PDT 2008
(sorry to reply to my own post - my provider's mail server broke down
sunday and i lost some messages)
julian - yes, a new ugen that'd recall last value is a good option.
LastValueTrig? TrigLastValue? or?
i could probably do one tomorrow if no one else...
for now i solved my problem by not using LastValue.
//a delay that crossfades when delaytime is changed
RedDelay {
*ar {|in= 0, maxdelaytime= 0.2, delaytime= 0.2, lagTime= 0.1, mul=
1, add= 0|
var t= HPZ2.ar(delaytime);
var d= Latch.ar(delaytime, PulseDivider.ar(t, 2, #[0, 1]));
var z= DelayN.ar(in, maxdelaytime, d, mul, add);
^XFade2.ar(z[0], z[1], Ramp.ar(ToggleFF.ar(t), lagTime, 2, -1));
}
*kr {|in= 0, maxdelaytime= 0.2, delaytime= 0.2, lagTime= 0.1, mul=
1, add= 0|
var t= HPZ2.kr(delaytime);
var d= Latch.kr(delaytime, PulseDivider.kr(t, 2, #[0, 1]));
var z= DelayN.kr(in, maxdelaytime, d, mul, add);
^XFade2.kr(z[0], z[1], Ramp.kr(ToggleFF.kr(t), lagTime, 2, -1));
}
}
it seems to work ok.
_f
15 jun 2008 kl. 17.33 skrev Fredrik Olofsson:
> hi,
> i have a question about the LastValue ugen. shouldn't the primitive
> check difference like this...
> if(diff > delta)
> instead of how it is now...
> if(diff >= delta)
>
>
> currently having 0.0 as the diff argument doesn't work...
>
> (
> a= {|freq= 400|
> var lastfreq= LastValue.ar(freq, 0.00001).poll;
> SinOsc.ar(lastfreq, 0, 0.1);
> }.play
> )
> a.set(\freq, 500)
> a.set(\freq, 600)
> a.set(\freq, 601)
> a.free
>
>
>
>
> (
> a= {|freq= 400|
> var lastfreq= LastValue.ar(freq, 0).poll;
> SinOsc.ar(lastfreq, 0, 0.1);
> }.play
> )
> a.set(\freq, 500)
> a.set(\freq, 600)
> a.set(\freq, 601)
> a.free
#|
fredrikolofsson.com klippav.org musicalfieldsforever.com
|#
More information about the Sc-devel
mailing list