twentyDBlockers


25 August 2011

Finally I got the DetaBlockerBuf r/t save (thanks, Dave)! I celebrate this with a recording of 20 Dblockers playing at the same time.

s.boot;

q = ();

b = BBlockerProgram({256.rand}!256).makeBuffer;

// generated values
b.loadCollection({256.rand}!256);
b.sine1(1, true, false, true);
b.sine1([255, 128], false, true, true);
b.sine1([255, 128], false, false, true);

// save a state (evaluate one line to save the current state
b.loadToFloatArray(action: {|array| a = array});
b.loadToFloatArray(action: {|array| c = array});
b.loadToFloatArray(action: {|array| d = array});
b.loadToFloatArray(action: {|array| e = array});
b.loadToFloatArray(action: {|array| f = array});

// reload recorded states
b.loadCollection(a)
b.loadCollection(c)
b.loadCollection(d)
b.loadCollection(e)
b.loadCollection(f)

// load saved states from file (see below)

q.progs = "%/programs.scd".format(Document.current.path.dirname).load
b.loadCollection(q.progs[0]);
b.loadCollection(q.progs[1]);
b.loadCollection(q.progs[2]);
b.loadCollection(q.progs[3]);
b.loadCollection(q.progs[4]);

(
Ndef(test, {|impFreq = 2000, resetFreq = 0.5|
	LeakDC.ar(Splay.ar({|i| Demand.ar(Impulse.ar(impFreq, Rand()), Impulse.ar(resetFreq), DetaBlockerBuf(b.bufnum, Dseq([0, 10, 20] + (i * 3), inf)))}!20))
}).play;
Ndef('test').set('resetFreq', 10.0, 'impFreq', 11172.648398147);
)
Ndef(test).pause
Ndef(test).resume
NdefMixer(s)

I saved the recorded programs by opening them first in a new Document which I then saved to the same directory.

Document.new("programs", [a, c, d, e, f].as(Array).asCompileString).front

In a way, this is the very first generated score I’ve ever actively done.