Where does the magic frequency 261.6255653006 come from?

Thinking about this a bit more, on one hand it might be useful if set (and everything else in Event) could fetch not only the msgFunc from the synthDesc, which it does (if args are set to []), but perhaps also the default values for the synth controls… and then used those in preference to Event defaults if “nothing is specified” for some key in the event. Alas “nothing is specified” is tedious to detect in Event, as it does its own calculations which have a lot of inputs (esp. for the frequency stuff). So, one could implement such a policy more explicitly in a \finish callback that e.g. looks up in synthDesc only specific keys (say specified in a defArgs, possibly with [] meaning all found in the synthDesc) and sets only those if “not set” in event.

I almost started coding this idea, but I realised that’s actually inferior to just putting the synth defaults in another event/environment, and chaining that before the event… which is exactly what I usually do with a Pdef.envir. That approach, besides sidestepping the issue of detecting what’s “not set” in the Event, has an extra advantage that a persistent set of defaults, after being initialized with the synthdef ones, can be easily tweaked in a gui. When I find myself that I often change the default value of some control like that, I go back and change the synthdef default. Because of that workflow, in which I always have the defaults loaded in an chained envir, I didn’t even have much realization of Event defaults for things like amp, freq etc. And I didn’t need type: \set much until recently… for which getting the args constructed in that case is also rather easy as Pdef(...).controlKeys. Even without Pdefs, that’s straightforward (past loading those defaults into an event)

e = SynthDescLib.global.synthDescs.at(\default).controls.inject((), { |e, c| e[c.name] = c.defaultValue });
(instrument: \default, dur: 1, amp: 0.2).next(e).play