Should {}.play add the SynthDef to SynthDescLib?

I’ve typically been using explicitly defined SynthDefs in my code, but recently I’m more and more inclined to build SynthDefs on the fly from ugen graph “blocks” (functions). This has led me to sometimes use the “shortcut” method as opposed to writing a full SynthDef and then a Synth, mostly because I don’t want to deal with specifying synthdef names. However, I’ve found myself needing to look up Synth argument names and it turns out that with “vanilla” SC (*) that’s not possible for “temp” synths created by {}.play. For regular SynthDefs I can look into SynthDescLib.

  • What do you think about changing {}.play so that it adds the temp synthdef to SynthDescLib?
  • Is using {}.play in production code a bad idea?

Thanks for any input you might have on this!

(*) The autogui quark provides a solution to this, but it overwrites the SynthDef -build method and I don’t feel I’d like to depend on such implementation.

I’d suggest at minimum prototyping the behavior you want in a new method – copy/paste Function:play into your own new file and add what you need. If that works really well, then it could be proposed as a feature.

My caveat for this is that temp SynthDefs should be removed from the SynthDescLib when they are deleted from the server. Should be easy to do this in the same place that issues the d_free message.

I think it’s fine! I do it quite often for one-off effect synths when I don’t need a lot of external control.