SelectL	

SelectL.ar(which,array)
SelectL.kr(which,array)

Part of wslib

The output is selected from an array of inputs with interpolation

See also [RotateL] and [Select]

(

SynthDef("help-SelectL",{ arg out=0;

	var a,cycle;
	a = [
			SinOsc.ar,
			Saw.ar,
			Pulse.ar,
			K2A.ar(0)  // silence
		];
	cycle = a.size  * 0.5;
	Out.ar(out,
		SelectL.ar( LFSaw.ar(1.0,0.0,cycle,cycle),a) * 0.2
	)
}).play;

)

Here used as a sequencer:
(
SynthDef("help-SelectL-2",{ arg speed = 1.0, out=0;
	// compare to Select example
	var a,s,cycle;
	a = Array.fill(32,{ rrand(30,80) }).midicps;
	a.postln;
	cycle = (a.size - 1)  * 0.5;

	s = Saw.ar(
			SelectL.kr( 
				LFSaw.kr(speed,0.0,cycle,cycle),
				a
			),
			0.2	
	);
	Out.ar(out,s )
}).play;
)

(
SynthDef("help-SelectL-3",{ arg speed = 1.0, out=0;
	// play u/d scale
	var a,s,cycle;
	a = (40.0, 41.0 .. 80.0).fold2(60.0);
	a.postln;
	cycle = a.size * 0.5;

	s = Saw.ar(
			SelectL.kr( 
				LFSaw.kr(speed,0.0,cycle,cycle),
				a
			).midicps,
			0.2	
	);
	Out.ar(out,s )
}).play;
)

(
SynthDef("help-SelectL-4",{ arg speed = 1.0, out=0;
	// same as above with only 3 inputs of array
	var a,s,cycle;
	a = [40,60];
	a.postln;
	cycle = a.size * 0.5;

	s = Saw.ar(
			SelectL.kr( 
				LFSaw.kr(speed,0.0,cycle,cycle),
				a
			).midicps,
			0.2	
	);
	Out.ar(out,s )
}).play;
)

AKAI S900 style timestretching..:

b = Buffer.read(s,"sounds/a11wlk01.wav");

(  // timestretch using easy crossfadelooping
SynthDef("cheap-timestretch",{ arg out=0, bufnum=0, fadeTime = 0.05, speed = 20.0;
	var timescale = MouseX.kr(0, 2, 0), ratescale = MouseY.kr(4, 0.25, 1);
	var trig, trigdiv, env, offset;
	trig = Impulse.kr(speed);
	trigdiv = PulseDivider.kr(trig, 2, [0,1]); // divide triggers over 2 channels
	env = Lag.kr(ToggleFF.kr(trig), fadeTime); // one signal to contol which channel is heard
	offset = Phasor.ar(0, timescale * BufRateScale.kr(bufnum), 0, BufFrames.kr(bufnum)); 
	Out.ar(out, SelectL.ar( env,
			PlayBuf.ar(1,b.bufnum,ratescale * BufRateScale.kr(bufnum), trigdiv, offset, 1.0) )
	);
}).play;
)