`variant` not supported as parameter in Pbind?

The docs for Pbind indicate that variant can be set like instrument or group. However this does not seem to be the case. While \variant is a valid key for a Pbind, assigning this value has no effect. \instrument supports “'synthdefname.variant” of course. There is no indication in the sclang source that this key is ever used.

Is there some way to get this to work in Pbind I am missing?

Per this earlier message, it’s been broken for awhile now (where somebody decided that I “redundantly” assigned the SynthDesc back into the event, but it’s actually necessary for later event processing, and this wasn’t caught in code review, and either the change was untested or nobody thought to test it with variants).

Basically: SynthDef variants are currently a hot mess and I would personally avoid them. Better to write up your own preset approach.


@jamshark70 thanks for context. From that discussion, and understanding the drawbacks of the variant system suggest a different approach in the future –

The whole purpose was to set it in the Event so that synthDefName would have access to it. So the later changes to this line need to be reverted.

Is this still perhaps worth doing to recover the previously working functionality?

Or, perhaps I should ask, what is lost by not using \variant and instead using “synthdef.variant” for \instrument? E.g., is transitioning between variants from event to event different than transitioning between (synthdef.variant) instrument values?