Here’s the “pseudo ugen” that @spluta and I were talking about a few weeks ago, in conversation with @tremblap. It works nicely–makes the server integration of KDTree lookup smoooooooth. Check out the test file to see the two options: (1) supply your own buffers if you want to get access to the buffers elsewhere or (2) if you just need the kr stream in the synth the method
.krstreamlocal will make 2
LocalBufs for you.
(1) When I run this code it works great (boots the server, loads the datasets, etc.), but then if I hit Command period to stop it and Command return to run it all again, the server crashes and says:
ERROR: FluidKDTree wrong number of arguments.Ran out of arguments at dataSet Server 'localhost' exited with exit code 0..
(2) I believe I’ve correctly assumed that if numNeighbours is greater than 1, the outputBuffer needs to be (cols of lookupDataSet * numNeighbours) which is very slick, just checking that the output then would be, for example (cols = 2, neighbours = 2)
[ neighbour1-col1, neighbour1-col2, neighbour2-col1, neighbor2-col2 ]. Is this order correct?