[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] A quick way to send the same Synthdef to many Servers



servers.do(SynthDef(...).send(_)) is a bit inefficient because it
rebuilds the graph and creates the binary stream for each server.

Faster (Tim Walters' suggestion -- this builds the graph just once):

~def = SynthDef(...);

~servers.do(~def.send(_));

But this is faster still. The above converts the synthdef to binary
repeatedly, once for each server. This way creates the binary stream
only once.

~def = SynthDef(...);
~defBinary = ~def.asBytes;

~servers.do(_.sendMsg(\d_recv, ~defBinary));

But making a SynthDef is fairly low-traffic, maybe not worth the
hackery to save just a few cpu cycles :)

hjh


-- 
James Harkins /// dewdrop world
jamshark70@xxxxxxxxxxxxxxxxx
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/