There’s one caveat I couldn’t improve from the original source.
The main function defines a new ParGroup
as a local var
… so hitting Cmd. will cause this to occur:
FAILURE IN SERVER /n_free Node 1009 not found
FAILURE IN SERVER /n_set Node 1004 not found
FAILURE IN SERVER /s_new Group 1003 not found
I tried one solution:
- changing the local
var
to global - appending the source with
CmdPeriod.add{ ~dx7group = new ( ParGroup ) }
Of course, the synthdefs are compiled & defined with the original group object which the global (or local) variable is simply a reference to… which means once the group is freed, there’s no way to get it back.
Some workarounds:
- setting
CmdPeriod.freeServers
tofalse
to disables.freeAll
fromCmdPeriod.objects
, though should be left to the user - wrapping the entire source inside of
CmdPeriod.add
, which beyond being rather unelegant would require the interpreter variables to be redeclared since the source function is so large to the extent it only works when used directly with the interpreter.
So ultimately I believe this task may be rather unelegant & daunting unless there’s a determined path to turn this ParGroup
into a persistent one.