FAILURE IN SERVER /s_new Group 1 not found

This is a quite large amount of code and it seems to contain private classes too, so the error is not reproducable, in general it’s recommended to post a clear reproducer as otherwise it’s rather unlikely that people spend time with your problem - but I see that this is difficult in this case.

So all I can do is mentioning some points that I’m noticing:

  • You are using interpreter variables at several occasions (f, m, d, q, x - or did I overlook variable definitions ?). In such a large piece of code that’s potentially dangerous.

  • What looks especially critical to me is that you are building an array of Routines { … } ! cbsize and they all seem to use the same interpreter variables, this looks insane. Does the problem occur with cbsize == 1 ? This check could pinpoint it.

  • You could use trace to check your Pbinds or at least certain of their streams. What about \dur d ? Small or zero durations are a frequent source of errors. You could check with the scheme below.

{ 
	|i| 
	var d = rrand(0.5, 2);
	Pbind(\midinote, 50 + (5 * i), \dur, Pfunc { d }.trace(prefix: "dur_" ++ i.asString ++ " ")).play
} ! 7
)
  • In general I’d try to modularize the code into smaller pieces. This makes debugging much easier and helps to look through the code when you come back to it after a while.

Hope that helps a bit.