various pre-release typos fixes

nix
Pierre Alexandre Tremblay 5 years ago
parent d192230cb5
commit 1423a64a4b

@ -83,5 +83,4 @@ FluidBufNNDSVD.process(s, b, ~bases, ~activations, coverage: 0.5, action: {\done
//use the bases to run NMF on
FluidBufNMF.process(s, b, resynth: ~resynth, bases: ~bases, activations: ~activations,actMode: 2, components: ~bases.numChannels, action: {\done.postln;})
{PlayBuf.ar(~resynth.numChannels, ~resynth)[1]}.play
}
::

@ -107,7 +107,7 @@ EXAMPLES::
code::
s.boot;
s.reboot;
// Create a DataSet with random data
@ -167,7 +167,7 @@ code::
~dsC = FluidDataSet.new(s,\joinC);
)
//feed them items with the same labels but with different dimensions
//feed them items with almost overlaping label lists but with different dimensions
~dsA.load(Dictionary.newFrom([\cols, 2, \data, Dictionary.newFrom([\zero, [0,0], \one,[1,11],\two,[2,22], \three,[3,33],\four,[4,44]])]));
~dsB.load(Dictionary.newFrom([\cols, 2, \data, Dictionary.newFrom([\one,[111,1111],\two,[222,2222], \three,[333,3333],\four,[444,4444],\five,[555,5555]])]));
~dsA.print;

@ -19,7 +19,7 @@ The number of neighbours to return. A 0 will return all points in order of dista
ARGUMENT:: radius
The threshold of acceptable distance for a point to be returned. A 0 will bypass this function, returning numNeighbours points.
ARGUMENT:: lookupDataSet
An optional link::Classes/FluidDataSet:: from which data points will be returned for realtime queries. This does not need to be the same DataSet that the tree was fitted against, but does need to have matching labels. Using this mechanism, we have a way to, e.g. associate labels with segments of playback buffers, without needing pass strings around the server. warning::This parameter can not be safely changed after the instance of FluidKDTree has been created::
An optional link::Classes/FluidDataSet:: from which data points will be returned for realtime queries. This does not need to be the same DataSet that the tree was fitted against, but does need to have matching labels. Using this mechanism, we have a way to, e.g. associate labels with segments of playback buffers, without needing pass strings around the server. warning::This parameter can not be changed after the instance of FluidKDTree has been created::
INSTANCEMETHODS::
@ -51,11 +51,10 @@ code::
// Make a DataSet of random 2D points
s.boot;
s.reboot;
(
fork{
~ds = FluidDataSet.new(s,\kdtree_help_rand2d);
~dsL = FluidDataSet.new(s,\kdtree_help_indices);// for use later in KR query
d = Dictionary.with(
*[\cols -> 2,\data -> Dictionary.newFrom(
100.collect{|i| [i, [ 1.0.linrand,1.0.linrand]]}.flatten)]);
@ -65,7 +64,7 @@ fork{
)
// Make a new tree, and fit it to the DataSet
~tree = FluidKDTree(s,numNeighbours:5,lookupDataSet:~dsL);
~tree = FluidKDTree(s,numNeighbours:5);
//Fit it to the DataSet
~tree.fit(~ds);
@ -102,7 +101,6 @@ fork{
// Limit the search to an acceptable distance in a radius
// Define a point, and observe typical distance values
~p = [ 0.2,0.2];
~tree.numNeighbours = 20;
(
~tmpbuf = Buffer.loadCollection(s, ~p, 1, {
~tree.kNearestDist(~tmpbuf,{ |a|a.postln;~nearest = a;});
@ -122,31 +120,32 @@ fork{
subsection:: Server Side Queries
code::
//set the buffers and busses needed
(
~inputPoint = Buffer.alloc(s,2);
~predictPoint = Buffer.alloc(s,5);
~pitchingBus = Bus.control;
~catchingBus = Bus.control;
~tree.numNeighbours = 5;
~tree.radius = 0;
)
//populate the lookupDataSet
//here we populate with numbers that are in effect the indicies, but it could be anything numerical that will be returned on the server-side and would be usable on that side
(
~dsL = FluidDataSet.new(s,\kdtree_help_indices);
fork{
d = Dictionary.with(
*[\cols -> 1,\data -> Dictionary.newFrom(
100.collect{|i| [i, [ i ]]}.flatten)]);
s.sync;
~dsL.load(d, {~dsL.print});
~dsL.load(d, {~dsL.print});
}
)
// instantiate a tree with a lookup dataset. Note that this 'association' has to be done at instantiation.
~tree = FluidKDTree(s,numNeighbours:5, lookupDataSet:~dsL);
~tree.fit(~ds)
//set the buffers and busses needed
(
~inputPoint = Buffer.alloc(s,2);
~predictPoint = Buffer.alloc(s,5);
~pitchingBus = Bus.control;
~catchingBus = Bus.control;
)
(
~tree.inBus_(~pitchingBus).outBus_(~catchingBus).inBuffer_(~inputPoint).outBuffer_(~predictPoint);
{
var trig = Impulse.kr(4); //can go as fast as ControlRate.ir/2
@ -159,8 +158,5 @@ fork{
}.play(~tree.synth,addAction:\addBefore);
)
::

@ -185,7 +185,7 @@ code::
~classifier.inBus_(~ib).outBus_(~ob).inBuffer_(~inpPoint).outBuffer_(~outPoint);
//pitching
{
var trig = Impulse.kr(MouseX.kr(0,1).exprange(0.5,ControlRate.ir /2).poll);
var trig = Impulse.kr(MouseX.kr(0,1).exprange(0.5,ControlRate.ir /2).poll(trig:2, label: "Query Frequency"));
var step = Stepper.kr(trig,max:3);
var point = TRand.kr(-0.1, [0.1, 0.1], trig) + [step.mod(2).linlin(0,1,-0.6,0.6),step.div(2).linlin(0,1,-0.6,0.6)] ;
point.collect{|p,i| BufWr.kr([p],~inpPoint,i)};

@ -195,7 +195,7 @@ code::
~classifier.inBus_(~ib).outBus_(~ob).inBuffer_(~inpPoint).outBuffer_(~outPoint);
//pitching
{
var trig = Impulse.kr(MouseX.kr(0,1).exprange(0.5,ControlRate.ir /2).poll);
var trig = Impulse.kr(MouseX.kr(0,1).exprange(0.5,ControlRate.ir /2).poll(trig: 2,label: "Query Frequency"));
var step = Stepper.kr(trig,max:3);
var point = TRand.kr(-0.1, [0.1, 0.1], trig) + [step.mod(2).linlin(0,1,-0.6,0.6),step.div(2).linlin(0,1,-0.6,0.6)] ;
point.collect{|p,i| BufWr.kr([p],~inpPoint,i)};

@ -72,11 +72,10 @@ FluidBufNMF.process(s,~src2,bases:~src2Bases,activations:~src2Activations, compo
~morph = { |source, target, activations, interp, autoassign|
FluidNMFMorph.ar(source,target,activations,autoassign,interp) * 80
};
)
~synth = ~morph.play(s,args:[\source,~src1Bases,\target,~src2Bases,\activations,~src2Activations,\interp,0.5,\autoassign,1]);
)
//Play with different interpolation values
~synth.set(\interp,0.0);
~synth.set(\interp,1.0);

Loading…
Cancel
Save