Skip to content

Instantly share code, notes, and snippets.

@LFSaw
Created January 21, 2024 22:52
Show Gist options
  • Save LFSaw/eb9fa31f8ef1c0d240e07c3bae7be7f1 to your computer and use it in GitHub Desktop.
Save LFSaw/eb9fa31f8ef1c0d240e07c3bae7be7f1 to your computer and use it in GitHub Desktop.
deta-nocturn

Deta-Nocturn

2011, Till Bovermann

A piece experimenting with the settling of 8-bit programs running in BetaBlocker (Dave Griffith & Till Bovermann, 2011).

q = ();
// either create new programs, or see already generated ones from the programs file
// q.programs = "%/DetaNocturn-programs.scd".format(Document.current.path.dirname).load;
// if new, also adjust score indices. (see below)
q.programs = {[\ORG] ++ ({([0, 1, 2] ++ (5..25)).choose}!250) ++ [\JMP, 1]}!200;
s.boot;
NdefMixer(s);
(
// put all programs into buffers. re-running these lines will start with a new set of programs that will -- over a long time period -- relax their amplitudes and complexity.
q.buffers = q.programs.collect{|prog|
BBlockerProgram(prog).makeBuffer
};
// add specs
Spec.add(\rate, [1, 40000, \exp]);
)
Ndef(\deta).clear
(
// the score player
Tdef(\player).quant = nil;
Ndef(\deta).quant = nil;
Ndef(\deta).fadeTime = 0;
Tdef(\player, {
var score = 48.collect{
([3, 11, 13, 17, 25, 26, 38, 4, 6, 8, 34, 38, 43, 44, 52, 71, 72, 85, 90]
.scramble[0..7])
};
score.do{|a|
Ndef(\deta, {|rate = 20000|
Splay.ar((a.collect{|number|
LeakDC.ar(Demand.ar(Impulse.ar(rate), 0, DetaBlockerBuf(q.buffers[number].bufnum, 0)))
})).tanh
}).play(fadeTime: 0);
2.7.wait
};
Ndef(\deta).stop
})
)
Ndef(\deta).play
// start piece
{Ndef(\deta).set(\rate, 9965.3); Tdef(\player).reset.play;}.fork
// stop piece
Tdef(\player).stop; Ndef(\deta).stop
// a saw wave generating program
q.bblocker = BBlockerProgram([\ORG, \INC, \INC, \JMP, 1]);
q.buf = q.bblocker.makeBuffer
Ndef(\deta, {|rate = 20000|
Demand.ar(Impulse.ar(rate), 0, DetaBlockerBuf(q.buf.bufnum, 0)).tanh!8
});
Tdef(\ticker, {
loop{
q.programs.do({|prog, i|
i.postln;
BBlockerProgram(prog).fillBuffer(q.buf);
1.wait;
})
}
})
Tdef(\ticker).stop
Tdef(\ticker).play
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment