Oh, and a last detail I forgot: SynthDescLib sends all .add
ed SynthDefs when a server boots. So you could .add
defs during language startup, long before booting a server, and they will be transmitted later – no need to run a SynthDef script after server boot.
// Server not booted
(
SynthDef(\boop, { |out, freq = 220, amp = 0.1, decay = 0.15|
var eg = EnvGen.kr(Env.perc(0.01, decay), doneAction: 2);
var sig = SinOsc.ar(freq);
Out.ar(out, (sig * amp * eg).dup);
}).add;
)
s.boot;
(instrument: \boop).play; // OK!
So I have some classes that use SynthDefs, which .add
those in *initClass. Other SynthDefs get built during the load script for my live setup.
hjh