RotateN					rotate array

RotateN.ar(n, array)
RotateN.kr(n, array)

Part of wslib

Rotates an array of input channels. Works like .rotate but on non-scalar arrays.

See also [RotateL]

n - amount of channels to shift
array - array of input signals

// rotate 4 inputs
Server.internal.boot;

(
{arg level = 0.125, speed = 1;
	var inArray = [SinOsc.ar, Saw.ar, Pulse.ar, GrayNoise.ar];
	var n = Phasor.ar(0, speed / 44100, 0.0, inArray.size);
	RotateN.ar(n, inArray) * level;
}.play(Server.internal);
Server.internal.scope;
)

// Also included in wslib are convenience methods for array:

[1,2,3].rotateN(1); // equivalent to .rotate if n is scalar
["a","b","c"].rotateN(1); 

(  //same as first example
{ arg level = 0.125, speed = 1;
	var inArray = [SinOsc.ar, Saw.ar, Pulse.ar, GrayNoise.ar];
	var n = Phasor.ar(0, speed / 44100, 0.0, inArray.size);
	inArray.rotateN(n) * level; 
	}.play(Server.internal);
)