Storing Data with a SynthDef

Hi there -
I’m interested in keeping a log of poll values produced in a SynthDef.
Let’s say something like this:

SynthDef("a",{var sig = SinOsc.ar(LFDNoise1.ar(0.3).poll.range(100, 1000), 0, 0.2); Out.ar(0, sig)}).play;

I think that “Archive.write” tends to be the standard approach for saving text files of data in SC - this all, I’d imagine to be more “client-side”.

Is there a standard approach for this procedure? Maybe it’s in the documentation somewhere and I’m missing it.

Thanks!

(
l = List.new;
OSCdef(\recordData, { |msg|
	l.add(msg[3]);
}, '/data', s.addr);
)

(
a = {
	var lfo = LFDNoise3.kr(0.5);
	SendReply.kr(Impulse.kr(5), '/data', lfo);
	Silent.ar(1)
}.play;
)

a.free;
OSCdef(\recordData).free;

l  // your data
-> List[ -0.67433023452759, -0.67721915245056, -0.67670929431915, -0.67190545797348, -0.66191250085831, -0.64583516120911, -0.6229727268219, ....... ]

hjh

3 Likes