GameOfLife / Unit-Lib

The Unit Library is a system that provides high level abstractions on top of the SuperCollider language.
25 stars 6 forks source link

Playing more then 150 simultaneous events (across any number of servers) UGroup stops working properly #41

Closed miguel-negrao closed 9 years ago

miguel-negrao commented 10 years ago
//1 server
UScore(*150.collect{ UChain(\sine).ugroup_(\a) }).gui

//4 servers
UScore(*150.collect{ UChain(\sine) }.clump(4).collect{ |arr| arr.collect{ |x,i| x.ugroup_(("a"++i).asSymbol) } }.flatten).gui

//for reseting
UGroup.all = []

//to check state of UGroup
UGroup.all.collect(_.groups).flatten
UGroup.all.collect(_.children).flatten.do(_.postln)
UGroup.all.collect(_.children).flatten.size

So we start the score and then hit stop and we can see using the commands above that not all children were removed from the UGroups. I have a postln in freeAction_ in UChain and I can see that not all freeActions are being triggered.

doing cmd-. runs all the remaining free actions which were not run...

My theory is that this is happening because sclang can't handle all the incoming free messages ...

miguel-negrao commented 10 years ago

Hum, just with synths, it seems sc has not problem running the freeAction for 200 of them...

(
y = [];
g = Group();
x = 200.collect{ 
    x = Synth(\u_sine,target:g).freeAction_{ |s| s.postln; y.remove(s) };
    y = y.add(x);
    x
}
)

y
g.free
x.do(_.free)
miguel-negrao commented 10 years ago

Sorted this out, it's a combination of things:

n_end message only go up to 1024, scsynth needs to be patched for more. -> still not in main supercollider. after a certain number of messages, udp packets are lost, tcp should be used instead

miguel-negrao commented 9 years ago

This is essentially fixed by using tcp servers and patching scsynth for n_end messaged hard coded limit. Should be documented though...