@@ -101,7 +101,7 @@ FluidDataSet : FluidDataObject
101101 actions[\getIds ] = [nil ,action];
102102 this .prSendMsg(this .getIdsMsg(labelSet));
103103 }
104-
104+
105105 kNearestMsg {|buffer,k|
106106 ^this .prMakeMsg(\kNearest ,id, this .prEncodeBuffer(buffer),k);
107107 }
@@ -119,4 +119,23 @@ FluidDataSet : FluidDataObject
119119 actions[\kNearestDist ] = [numbers(FluidMessageResponse ,_,nil ,_ ),action];
120120 this .prSendMsg(this .kNearestDistMsg(buffer,k));
121121 }
122+
123+ kr {|trig, inputBuffer, outputBuffer, numNeighbours, lookupDataSet|
124+ ^FluidDataSetRead .kr(trig,
125+ this , numNeighbours??{this .numNeighbours}, lookupDataSet.asUGenInput,
126+ inputBuffer,outputBuffer);
127+ }
128+ }
129+
130+ FluidDataSetRead : FluidRTMultiOutUGen
131+ {
132+ *kr { |trig, ds, numNeighbours, lookupDataSet, inputBuffer, outputBuffer |
133+ ^this .multiNew('control' , trig, ds.asUGenInput, numNeighbours, lookupDataSet!?(_ .asUGenInput)??{-1 }, inputBuffer.asUGenInput, outputBuffer.asUGenInput)
134+ }
135+
136+ init { arg ... theInputs;
137+ inputs = theInputs;
138+ ^this .initOutputs(1 , rate);
139+ }
140+
122141}
0 commit comments