Rotating array with Dswitch1

Hello all,

i’m trying to create a rotating array with Dswitch1, to output the same results as the example with Select. For some reason, the demand version seems static (or skipping values if sequence is modded with %7 for example).
Any ideas as to why this is and on how to achieve the same results?

{Select.kr((LFSaw.kr(1/2).range(0,7)+(0..7))%8,(1..8)).poll}.play //expected rotating sequence

vs

({ Demand.kr(
	Impulse.kr(1),
    0,
	Dswitch1((1..8), (Dseries(0,1)+(0..7))%8)   //seemingly static
).poll  
}.play;
)

Thanks,

Jan

this is working as you expected or? if so its because demand ugens dont multichannel expand.

(
{ 
	var trig = Impulse.kr(1);
	(0..7).collect{ |i|
		Demand.kr(trig, 0, Dswitch1((1..8), Dseries(0, 1) + i % 8)).poll(trig, \demand);
	};
}.play;
)
1 Like

yes, this is working as expected, thank you @dietcv!
don’t yet quite understand how it is a multichannel expansion issue, because demand generally does expand, both with arrays in the trigger or demand section?

({ Demand.kr(
	Impulse.kr(1),
    0,
	Dswitch1((1..8), (Dseries(0,1)+(0..7))%8)   
).poll  
}.play;
)

//both examples return 8 values

({ Demand.kr(
	Impulse.kr(1!8),
    0,
	Dswitch1((1..8), (Dseries(0,1)+[(0..7)])%8)   
).poll  
}.play;
)
1 Like

but i think the triggers are just polling one value from Dseries each time. but maybe someone else can clarify.