TIRand not in range

That’s why I didn’t post the full code initially :innocent:

I wrote it like this:

//bufidx1=TIRand.ar(0,nbuf-1,trig1)
bufidx1=K2A.ar(TIRand.kr(0,nbuf-1,trig1));

And although the random part seems to be done correctly, I end up loosing triggers. Probably due to the mix of Control and Audio rates… :pensive:

No positive impact. Neither on original version nor on the K2A version.

There is one thing I don’t get: how are initialized the variables ?
E.g.

cueidx20=K2A.ar(TIRand.kr(0,ncue2-2,trig2)).poll(poll,";2_cue start");

How does SC initialize the value of cueidx20 before trig2 occurs ? I expected it to be 0 or nil. But there is a value
“;2_cue start: 2
It seems that SC “play” the TIRand at the begining, ignoring default values.
Why ? Is it due to the bug I went into the other day ?