How do update array index within pdef?

Hello all,

I am trying to update an array index within a pdef:

Pdef(\a16, Pbind(
\instrument, \mainbuf, \group, ~sources,
\patch, ~patch1,
\amp, 1,
\dur, 1/32,
\atk, 0.21,
\rel, 0.1,
\rate, 3,
\pos, 1,
\bank, ~arp_list[1],
)).quant_(4);

For the \bank argument- any idea how I can have this value randomly select between 1 and 10? If I use rrand(1,10) it only evaluates once. I would like to keep it updating consistently.

Thank you

I believe what you want is

\bank, Prand(~arp_list),
1 Like

Thank you. This works great

More generally, how do you ‘do some language feature’ in a pattern:

Pfunc({  ~arr.choose  })

… but Prand is what you want here.