FluidNRTProcess: server is not taken into consideration

Hello everyone!

First post here, hopefully useful!

As some of you may know, I am developing a testing framework for the project.
This framework is built in SuperCollider, and it’s based around the idea of spawning x number of parallel servers to execute various tests on the Fluid classes.
One bug I found (and it was actually quite painful to debug) is that the FluidNRTProcess class, which is the one that takes care of the actual FluidBuf NRT processes, doesn’t take into account which SC server sent the /done OSC message back, but it just accounts for the Synth's ID. However, on single client/multiple servers setup (like the one I am having for these tests), the OSCFunc could be triggered by a different server than the one intended, if more than one server has the same Synth ID active.

A simple fix is to look for an answer back from the specific server.addr that the FluidNRTProcess's Synth was spawned in. This is achieved by adding a srcID:server.addr to the OSCFunc in FluidNRTProcess, like this:

OSCFunc({ |m|
			forkIfNeeded{
				outputBuffers.do{|buf|
					buf = server.cachedBufferAt(buf.asUGenInput);
					buf.updateInfo;
				};
				server.sync;
				if(action.notNil && m[2]==0){action.valueArray(outputBuffers)};
				c.test = true;
				c.signal;
			}
		},'/done', srcID:server.addr, argTemplate:[synth.nodeID]).oneShot;
2 Likes

Thanks @francesco.cameli . You’re quite right, it should match against the dispatching server. Can you put a PR in through Github?

Sure! I will do it later tonight :slight_smile:

EDIT:

1 Like