Pbind in set type as stream

Hi everyone,

I am trying to use pbind set event type as Stream so that I can call next on it and handle its timing differently than the traditional \dur key does.

I tried like this and it does not work

(
x = {SinOsc.ar(\freq.kr(200)) * 0.1}.play;
p = Pbind(
	\type, \set,
	\id, x.nodeID,
	\args, #[\freq],
	\freq, Pwhite(200, 1000),
).asStream;
)
p.next(())

The event gets post as usual but nothing is happening. I am a bit surprised by this behaviour…

I found a solution using another syntax so my question is purely technical, wasn’t it suppose to work in the first place ?

Here is my solution :

(
p = Pbind(
	\freq, Pwhite(200, 1000),
).asStream
)
x.set(*p.next(()).asArgsArray)

Thank you for your help :slight_smile:

The Event has to be played to cause the intended behaviour, this does it:

p.next(()).play

1 Like

Thank you very much, it makes perfect sense !