Clarification about the Select ugen

Hello,

I am hoping someone can assist me in understanding the Select ugen.

I understand that the Select ugen takes 2 params 1. an index and an arry of inputs,
and 2. the array of inputs
The index selects the input to use. However, the example from the sc help file
looks like this:

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

	 var a,cycle;
	 a = [
	      SinOsc.ar,
	      Saw.ar,
	      Pulse.ar
	      ];
	 cycle = a.size  * 0.5;
	 Out.ar(out,
	        Select.ar(LFSaw.kr(1.0,0.0,cycle,cycle),a) * 0.2
	        )
         }).play;
         )

When I run this example the sound rotates through the three osc in the “a” array.

It seems the sound is chosen by the first param to the Select, however, when I examine
this param it looks like this is a sawtooth string of integers ranging from 1.5 to 3.

cycle = 1.5
LFSaw outputs a series of floats between 0 - 1
using cycle as the mul param changes this output to floats between 0 - 1.5
using the add param to LFSaw changes this output from LFSaw to 1.5 - 3.

I would think that the first param to select should be ints between 0 - 2.

Can someone add some clarity to how this is working?

Thanks

The output range of LFSaw is actually -1 to +1

So: using cycle as the mul param changes this output to floats between -1.5 and 1.5
and using cycle as the add param changes this output to floats between 0 and 3.

Best,
Paul

1 Like

Admittedly the whole thing would be clearer like…

LFSaw.kr(1).range(0, a.size)

Thanks very much - this cleared it up.

I feel a little silly for missing this.