{
   "id" : "1-5bt",
   "is_private" : null,
   "code" : "/*\r\n*  Twilight Luminaries by Alexander Zhagun-Linnik\r\n*  Moscow, 2019\r\n*\r\n*  Endless generative composition based on random polyphonic sequences.\r\n*\r\n*  etherguide@gmail.com\r\n*/\r\n(\r\nServer.default = s;\r\no=s.options;\r\no.memSize;\r\no.sampleRate;\r\no.memSize = 2.pow(16);\r\no.sampleRate = 44100;\r\ns.quit;\r\ns.waitForBoot({\r\n\t~rseq = {Array.fill(~num = rrand(2, 8), {arg i; rrand(0, 12)})};\r\n\t~scale = Scale.at(Scale.names.choose);\r\n\t~time = 5;\r\n\t~root = rrand(0, 12);\r\n\t~maingain = 4;\r\n\t{\r\n\t\tSynthDef(\\sin, {arg freq=440, amp = 0.9, gate=1, out=0, release=1, attack=0.01, maingain=4, decay=1, detune=0.01;\r\n\t\t\tvar sig = Mix.fill(12, {arg i;\r\n\t\t\t\tSinOsc.ar(freq+(freq*Rand(detune.neg, detune)), Rand(0.0, 1.0), amp/12);\r\n\t\t\t});\r\n\t\t\tsig = (sig*maingain).softclip;\r\n\t\t\tsig = (sig * Env.adsr(attack, decay, 1.0, release).kr(2, gate));\r\n\t\t\tsig = Pan2.ar(sig, Line.kr(Rand(-1.0, 1.0), Rand(-1.0, 1.0), Rand(0.01, 3.0)));\r\n\t\t\tOut.ar(out, sig);\r\n\t\t}).add;\r\n\t\tSynthDef(\\sim, {arg freq=440, out=0, release=1, maingain=4;\r\n\t\t\tvar amp = Rand(0.0, 0.5);\r\n\t\t\tvar sig = SinOsc.ar(freq, Rand(0.0, 1.0), amp/12);\r\n\t\t\tsig = (sig*maingain).softclip;\r\n\t\t\tsig = sig * Env.perc(0.0001, releaseTime: release, curve: -8).kr(2);\r\n\t\t\tsig = CombC.ar(sig, Rand(0.01, 0.4), Rand(0.01, 0.4), Rand(0.01, 0.3), Rand(0.01, 2));\r\n\t\t\tsig = Pan2.ar(sig, Line.kr(Rand(-1.0, 1.0), Rand(-1.0, 1.0), Rand(0.01, 3.0)));\r\n\t\t\tOut.ar(out, sig);\r\n\t\t}).add;\r\n\t\tSynthDef(\\str, {arg freq=440, amp = 1.0, gate=1, out=0, verb=0.5, release=1, attack=0.01, maingain=4, decay=1, detune=0.01;\r\n\t\t\tvar sig = Mix.fill(12, {\r\n\t\t\t\tVarSaw.ar(freq+(freq*Rand(detune.neg, detune)), Rand(0.0, 1.0), Rand(0.0, 1.0),  amp/12);\r\n\t\t\t});\r\n\t\t\tattack = attack*2;\r\n\t\t\tsig = (sig*maingain).softclip;\r\n\t\t\tsig = sig * Env.adsr(attack, decay, 1.0, release).kr(2, gate);\r\n\t\t\tsig = Pan2.ar(sig, Line.kr(Rand(-1.0, 1.0), Rand(-1.0, 1.0), Rand(0.01, 3.0)));\r\n\t\t\tOut.ar(out, sig);\r\n\t\t}).add;\r\n\t\ts.sync;\r\n\t\tloop{\r\n\t\t\t~rseq = {Array.fill(~num = rrand(2, 8), {arg i; rrand(0, 8)})};\r\n\t\t\tif(rrand(1, 5)==4, {\r\n\t\t\t\t~scale = Scale.at(Scale.names.choose);\r\n\t\t\t});\r\n\t\t\tif(rrand(1, 5)==4, {\r\n\t\t\t\t~root = rrand(0, 12);\r\n\t\t\t});\r\n\t\t\tPdef(\\main,\r\n\t\t\t\tPpar(Array.fill(rrand(1, 8), {\r\n\t\t\t\t\tPbind(\r\n\t\t\t\t\t\t\\instrument, [\\sin, \\str, \\sim].choose,\r\n\t\t\t\t\t\t\\scale, ~scale,\r\n\t\t\t\t\t\t\\dur, [2, 1, 1/2, 1/4, 1/8, 1/16, 1/32, 1/3, 1/6, 1/12].choose*~time,\r\n\t\t\t\t\t\t\\degree, Pseq(~rseq.value, inf),\r\n\t\t\t\t\t\t\\octave, [2, 3, 4, 5, 6].choose,\r\n\t\t\t\t\t\t\\type, Pfunc({[\\note, \\note, \\rest].choose}),\r\n\t\t\t\t\t\t\\verb, rrand(0.05, 0.8),\r\n\t\t\t\t\t\t\\release, rrand(0.0, 4.0),\r\n\t\t\t\t\t\t\\attack, rrand(0.001, 1.0),\r\n\t\t\t\t\t\t\\root, ~root,\r\n\t\t\t\t\t\t\\maingain, Pbrown(0.1, 6.0, Pfunc({rrand(0.1, 1.0)}), inf),\r\n\t\t\t\t\t\t\\detune, rrand(0.005, 0.015),\r\n\t\t\t\t\t\t\\decay, Pfunc({rrand(0.01, 2.0)}),\r\n\t\t\t\t\t)\r\n\t\t\t\t}))\r\n\t\t\t).play();\r\n\t\t\tNdef(\\proc, {\r\n\t\t\t\tvar sig = FreeVerb.ar(\r\n\t\t\t\t\tIn.ar(0, 2),\r\n\t\t\t\t\trrand(0.01, 0.99),\r\n\t\t\t\t\trrand(0.01, 0.99),\r\n\t\t\t\t\trrand(0.01, 0.99)\r\n\t\t\t\t);\r\n\t\t\t\tOut.ar(0, sig);\r\n\t\t\t}).fadeTime_(rrand(0.1, 3.0));\r\n\t\t\t([8, 4, 2, 1].choose*~time).sleep;\r\n\t\t}\r\n\t}.fork;\r\n});\r\n)",
   "labels" : [
      "simple",
      "random",
      "endless",
      "generative",
      "algorithmic",
      "sequence",
      "polyphonic"
   ],
   "description" : "Twilight Luminaries is an endless generative composition based on random polyphonic sequences. \r\n\r\nWhile it has some hard limitations like fixed note lengths within a sequence, I was aiming for maximum combinatoric diversity.\r\nThis is the first piece in series and I'm currently working on overcoming these limitations. The problem of static timbres is another thing I would like to address in future iterations.",
   "ancestor_list" : [],
   "author" : "Alexander Zhagun-Linnik",
   "name" : "Twilight Luminaries"
}
