[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] more on synthdef variants
On Dec 25, 2004, at 11:04 PM, James McCartney wrote:
variants only define default settings. if you set them then that
always overrides.
yeah, i understand that much. sorry i haven't had explained this very
clearly. in this situation:
(
x = SynthDef("varianttest", { |freq=200, gate=1|
Out.ar(0, SinOsc.ar(freq, 0, Linen.kr(gate, 0, 1, 0, doneAction: 2)));
}).variants = (alpha: #[\freq, 400]);
x.store;
)
Pbind(\instrument, "varianttest.alpha").play
the \freq in the default parent event overrides the \freq in the
synthdef variant. that doesn't seem intuitive. of course you could get
around it by supplying a protoEvent:
Pbind(\proto, (freq: 400), \instrument, "varianttest.alpha").play
but that defeats the purpose of using the variant. (and the purpose of
using the variant is not just to save on typing -- this is a simplified
example from a more complex little project that requires the use of
variants).
i dunno. perhaps the protoEvent could be made from the corresponding
SynthDesc?