Select gen , rename second argument possible?

Hi all
I am making a microtonic clone again :slight_smile: ( already did one in reaktor )
At the moment there are three oscillators , sine ,saw, triangle and their frequency can be modulated by an lfo ( audio rate ) , envelope or s/h ( audio rate gives noise ) or all at once .
In microtonic there is the option to select which osc to route to the output
So I declared a new variable z with an array that houses all osc’s ( the modulation of the osc’s is already done on their respective codeline )
Next is a Select.ar , the ffirst argument 'which 'is the array ( previous line ), the next argument ‘array’ is the variable for the osc selection
When I want to make a synthdef , the second argument of the select module needs the already declared variables ( sine,saw ,tri) and I would like these to have a different name for dynamic switching .
Don’t mind the parameters at the bottom , since the synthdef is not yet created

Edit …seems that I don’t know exactly how the select module works , it’s confusing since the second argument is called “array” and the first ‘which’’, but choosing the array called z as the first arg , and osc as second it works as expected …maybe the parameters are mixed up ?
Either way , the issue is still .to rename the already declared variables

(
{   arg freq1=50,lfofreq=200 ,lfoamount=500,penvamount=2000,
	    decaycurve=(-5),patt=0.001,pdec=4.500,shamount=0,shrate=3,
	ampatt=0.001,ampdec=2,ampdecaycurve=(-5);
	var sin,tri,saw,lfo,modsh,penv,ampenv,sh;
	sh=LFNoise0.ar(shrate)*shamount;
	penv=EnvGen.ar(Env([0,1,0],[patt,pdec],[0,decaycurve]),doneAction:0)*penvamount;
	ampenv=EnvGen.ar(Env([0,1,0],[ampatt,ampdec],[0,ampdecaycurve]),doneAction:0);
	lfo=SinOsc.ar(lfofreq)*lfoamount;
	sin=SinOsc.ar(freq1+penv+lfo+sh)*ampenv;
	tri=LFTri.ar(freq1+ penv +lfo+sh)*ampenv;
	saw=LFSaw.ar(freq1+penv+lfo+sh)*ampenv;
	z=[sin,tri,saw];
	Select.ar(z,sin);//////////I want to give the second argument a new name so I can dynamically select it 





}.play
)

//////////////////////////



(\freq1,100)
(\penvamount,2000)/////pitch env amount
(\lfofreq,0)      /////LFO frequency
(\lfoamount,200)///lfo amount
(\shrate,10)////////shrate
(\shamount,10)//////////shamount
(\ampatt,0.001)/////amp attack
(\ampdec,0.750)//////amp decay
(\ampdecaycurve,-5)////ampdecay curve

Looking up the help file it is indeed the second argument that selects the array , an lfsaw is used to scan through 3 waveforms , but if you flip the order so the firstst argument takes the array , the second argument the name of an element in that array .
Confusing to say the least

We can create an array as the second argument of the select module , the first argument selects the element , so we can create an arguemnt for it for the synthdef
Issue solved

(
SynthDef (\Tonic,

{   arg freq1=50,lfofreq=200 ,lfoamount=100,penvamount=200,
       decaycurve=(-5),patt=0.001,pdec=4.500,shamount=0,shrate=3,
   ampatt=0.001,ampdec=10,ampdecaycurve=(-5),selectwaveform=1,signalout=0.7;
   var sin,tri,saw,lfo,modsh,penv,ampenv,sh,signal;
   sh=LFNoise0.ar(shrate)*shamount;
   penv=EnvGen.ar(Env([0,1,0],[patt,pdec],[0,decaycurve]),doneAction:0)*penvamount;
   ampenv=EnvGen.ar(Env([0,1,0],[ampatt,ampdec],[0,ampdecaycurve]),doneAction:2);
   lfo=SinOsc.ar(lfofreq)*lfoamount;
   sin=SinOsc.ar(freq1+penv+lfo+sh)*ampenv;
   tri=LFTri.ar(freq1+ penv +lfo+sh)*ampenv;
   saw=LFSaw.ar(freq1+penv+lfo+sh)*ampenv;
   signal=Select.ar(selectwaveform,[sin,tri,saw])*signalout!2;
   Out.ar(0,signal);
}).add
)

//////////////////////////

~tonz=Synth (\Tonic);
~tonz.free;
~tonz.set(\freq1,100);
~tonz.set(\penvamount,1000);/////pitch env amount
~tonz.set(\pdec,2);
~tonz.set(\lfofreq,100);      /////LFO frequency
~tonz.set(\lfoamount,110);///lfo amount
~tonz.set(\shrate,0);////////shrate
~tonz.set(\shamount,0);
~tonz.set(\ampatt,0);
~tonz.set(\ampdecay,5);
~tonz.set(\ampdecay,5);
~tonz.set(\ampdecaycurve,-5);////ampdecay curve
~tonz.set(\selectwaveform,0);///SINE
~tonz.set(\selectwaveform,1);////TRI
~tonz.set(\selectwaveform,2);///SAW
~tonz.set(\signalout,0.9);///outputvolume
//////////