A UGen that adds data points with associated identifiers to a link::Classes/FluidDataSet:: Internally, this calls code::setPoint::, so IDs that already exist will be overwritten, and new IDs will be added. The actual work is done on the server's command queue, rather than the real-thread.
@ -21,10 +21,10 @@ CLASSMETHODS::
private:: *new1
METHOD:: kr
The equivalent of calling link::Classes/FluidDataSet#-addPoint::, but within a link::Classes/Synth::
The equivalent of calling link::Classes/FluidDataSet#-setPoint::, but within a link::Classes/Synth::
ARGUMENT:: dataset
An instance of link::Classes/FluidDataSet:: or an instance's name.
An instance of link::Classes/FluidDataSet::
ARGUMENT:: idPrefix
A string or symbol with a prefix for generated identifiers.
@ -67,58 +67,38 @@ s.reboot;
(
~ds.clear;
OSCFunc({
"FluidDataSetWr help: all points written".postln;
~ds.print
"FluidDataSetWr help: all points written".postln;
~ds.print
},'/datasetwrdone').oneShot;
{ |n|
var b = LocalBuf.newFrom([0,1,2,3]);
var trig = Impulse.kr(ControlRate.ir / 8);
var idx = Stepper.kr(trig,min:-1, max:n); //we need to start at -1 to catch the first increment
Each time link::Classes/FluidDataSetWr:: is triggered it is like the link::Classes/FluidDataSet#-setPoint:: method so if the identifier does not exist it creates it. If the identifier does it exist then it updates it with the new values.
By looping code::idNumber:: values, we can use a link::Classes/FluidDataSet:: similar to a "circle buffer", always have the most recent code::n:: points in it that we want.
code::
// always have only the most recent 10 points in the buffer
(
{
var buf = LocalBuf.newFrom([0,1,2,3]);
var noise = 4.collect{WhiteNoise.kr()};
var noise = WhiteNoise.kr(1.dup(4)) + Sweep.kr(1,1);
var trig = Impulse.kr(2);
var count = Stepper.kr(trig, min: 0, max: 9, resetval: -1); //0 to 9, starting at -1 to catch the first entry