Get standard arguments of a synthdef as a dictionary or array?

Hello, i want to get the standard arguments as pairs/array or dictionary or from a synth def.
Lets say i have this SynthDef:

(
SynthDef(\test_synth,{
	|amp = 0.3, freq = 220, rel = 1|
	Out.ar(0,SinOsc.ar(freq!2)*Line.kr(amp,0,rel,doneAction:2));
}).add;
)

Synth(\test_synth)

Then i want a function or method that gives me [\amp, 0.3, \freq, 220, \rel, 1] or something similar. The arguments might also be initialized in the synthdef by \amp.kr(0.3) or something.

Is this possible somehow? It would help me out a lot.
Thank you!

Like this!

SynthDescLib.at(\test_synth).controlDict.collect(_.defaultValue)
3 Likes

Thank you very much, especially for the quick response, keeps me coding (:

Your welcome!
Take a peek at SynthDesc and ControlName if you want to see why this works.
J

1 Like

Interesting, I didn’t know you could just do .at directly with the Synth name, I thought you had to go through the \global SynthDescLib. Anyhow, I did something similar (maybe with a bit fancier output, and including things like lag info) for Bacalao: