Hi, I stumbled upon an issue. When I use a controlname that starts with a single character followed by an underscore (i.e. t_trigger, x_something) and then have another control with the same name but without the first part, I get an error. I’m pretty sure that wasn’t the case in pre-3.13.0 versions of sc. Is this a bug or a feature? The problem seems to be related to SynthDesc.
SynthDef( "test", { |hello = 1, t_hello = 1| }).add;
ERROR: Function argument 'hello' already declared in Interpreter:functionCompileContext
in interpreted text
line 1 char 20:
#{ arg hello, hello;
var xFC556959 = Array.new(4);
-----------------------------------
cheers & thanks,
Wouter
That should be the case for at least the last 22 years (SynthDescLib · supercollider/supercollider@be72d62 · GitHub).
JMc’s idea for rate prefixes (t_
etc.) was that the name in an event should not state the rate prefix – as far as events are concerned, it’s just “hello.” Agreement on this isn’t universal but this design does date back to the beginning of SynthDescLib.
Currently any alpha ++ "_"
is treated as a prefix, whether it means anything to SynthDef
or not. A valid fix might be to discard the prefix only for supported rate prefixes (a_
, i_
, t_
) and let the user have all of the other letters.
hjh
I see, a feature then ;-). I think the more recent change is that SynthDescLib is used in more methods. I used writeDefFile
for SynthDefs a lot, which in the past didn’t do anything with SynthDescs. It seems that since this commit in 2012 it does: https://github.com/supercollider/supercollider/commit/2070b6d9305cbcb9694b15eb1b4709f9e73c4b8c, so some older code I tried suddenly gave this error. It would be very useful to me if this functionality was limited to only a_
, i_
and t_
, as in fact I’m using u_
heavily in my Unit Lib / WFSCollider library quarks for ‘private’ arguments (there I’ve bypassed SynthDescs more thoroughly, but I’d actually like to use them as some functionality I have doubles with it). I wouldn’t really know how to work around that though without having a lot of backwards compatibility issues… (in WFSCollider we can save “.uscore” files that hold all information for a composition, and they may include ‘u_’ arguments too)
cheers & thanks,
Wouter