Ndef as a fx chain: i'm stuck

What about this ?

SynthDef(\fx_synthdef_name, {
	|asarg=220| Out.ar(0,Pan2.ar(SinOsc.ar(asarg,0,\asctrl.kr(0.2))));
}).add;


(
~transform=
{
|synth,pos|
var code=SynthDescLib.global.at(synth).def.func.asCompileString;
var argNames=SynthDescLib.global.at(synth).controlNames;
argNames.do({|p| 
	var s=p.asString.trim;
	format("--%-- (%)",s,s.class).postln;
	code=code.replace(s,s++pos);
});
code.interpret;
}
)


Ndef(\a,~transform.(\fx_synthdef_name,10));
Ndef(\a)[1]=~transform.(\fx_synthdef_name,11);
Ndef(\a).set(\asarg10,220);
Ndef(\a).set(\asctrl10,0.2);
Ndef(\a).set(\asarg11,330);
Ndef(\a).set(\asctrl11,0.05);

Ndef(\a).gui
2 Likes