{
   "ancestor_list" : [],
   "description" : "An experiment with euclidian patterns, sampled drums and synthesized strings. Inspired by middle eastern 9/8 rhythms. Replace the samples in the dictionary with whatever percussion sounds you have.",
   "name" : "9/8 drum'n strings",
   "author" : "bernhard",
   "id" : "1-5d9",
   "is_private" : null,
   "code" : "//An experiment with euclidian patterns, sampled drums and synthesized strings. Inspired by middle eastern 9/8 rhythms. Replace the samples in the dictionary with whatever percussion sounds you have.\r\n\r\n\r\n/// creating a dictionary with samples.\r\n\r\n(\r\nd = Dictionary.new;\r\nd.add(\\tam -> PathName(\"/Users/bernhardzitz/Music/SUPERCOLLIDER/buffers/tamsolo/\").entries.collect({\r\n\targ sf;\r\n\tBuffer.read(s, sf.fullPath);\r\n}););\r\n\r\nd.add(\\kranz2 -> PathName(\"/Users/bernhardzitz/Music/SUPERCOLLIDER/buffers/kranz2/\").entries.collect({\r\n\targ sf;\r\n\tBuffer.read(s, sf.fullPath);\r\n}););\r\n\r\nd.add(\\wood1 -> PathName(\"/Users/bernhardzitz/Music/SUPERCOLLIDER/buffers/wood1/\").entries.collect({\r\n\targ sf;\r\n\tBuffer.read(s, sf.fullPath);\r\n}););\r\n\r\n\r\nd.add(\\wood5 -> PathName(\"/Users/bernhardzitz/Music/SUPERCOLLIDER/buffers/wood5/\").entries.collect({\r\n\targ sf;\r\n\tBuffer.read(s, sf.fullPath);\r\n}););\r\n\r\nd.add(\\drum1 -> PathName(\"/Users/bernhardzitz/Music/SUPERCOLLIDER/buffers/drum1/\").entries.collect({\r\n\targ sf;\r\n\tBuffer.read(s, sf.fullPath);\r\n}););\r\n\r\n\r\nd.add(\\kuerbis -> PathName(\"/Users/bernhardzitz/Music/SUPERCOLLIDER/buffers/kuerbis/\").entries.collect({\r\n\targ sf;\r\n\tBuffer.read(s, sf.fullPath);\r\n}););\r\n\r\nd.add(\\rassel4 -> PathName(\"/Users/bernhardzitz/Music/SUPERCOLLIDER/buffers/rassel4/\").entries.collect({\r\n\targ sf;\r\n\tBuffer.read(s, sf.fullPath);\r\n}););\r\n\r\n)\r\n\r\n// Masterbus with reverb and limiter. Must be the first SynthDef for correct node order.\r\n\r\n(\r\nSynthDef.new(\\revlimit, {\r\n\targ in=50, out=0;\r\n\tvar sig;\r\n\tsig = In.ar(in,2);\r\n\tsig = GVerb.ar(sig,24,0.25,0.15,0.17,15,1,0.1,0.02);\r\n\tsig = Limiter.ar(sig, 0.8,0.02);\r\n\tOut.ar(out, sig);\r\n}).play;\r\n)\r\n\r\n// Sampleplayer for mono samples with panning and two channel ouput. Sends to bus 50 (Masterbus).\r\n\r\n(\r\nSynthDef.new(\\bufplay, {\r\n\targ buf=0, rate=1, pan=0, amp=1;\r\n\tvar sig;\r\n\tsig = PlayBuf.ar(1, buf, BufRateScale.ir(buf) * rate, doneAction:2);\r\n\tsig = Pan2.ar(sig,pan,amp);\r\n\tsig = sig.tanh * 0.7;\r\n\tOut.ar(50, sig);\r\n}).add;\r\n)\r\n\r\n// Stringinstrument with extra reverb. Sends to bus 50 (Masterbus)\r\n\r\n(\r\nSynthDef(\\stringemil, {arg out = 0, hit = 0.1, amp = 1, freq = 440, decay = 5, pan=0,coef = 0.1;\r\n\tvar env, snd;\r\n\tenv = EnvGen.kr(Env.linen(0, decay, 0), doneAction: 2);\r\n\tsnd = Pluck.ar(\r\n\t\tin: PinkNoise.ar(hit),\r\n\t\ttrig: Impulse.kr(0),\r\n\t\tmaxdelaytime: 0.1,\r\n\t\tdelaytime: freq.reciprocal,\r\n\t\tdecaytime: decay,\r\n\t\tcoef: coef);\r\n\tsnd = Pan2.ar(snd,pan,amp);\r\n\tsnd = GVerb.ar(snd,34,0.55,0.25,0.27,55,1,0.25,0.2);\r\n\tsnd = LeakDC.ar(snd).clip2;\r\n\tOut.ar(out, snd * env);\r\n}).add;\r\n\r\n)\r\n\r\n// records to \"/Users/admin/Music/SuperCollider Recordings/\"\r\ns.record;\r\n\r\ns.stopRecording;\r\n\r\n// the Pdefs for percussion\r\n\r\n(\r\nPdef(\r\n\t\\rhythm,\r\n\tPbind(\r\n\t\t\\instrument, \\bufplay,\r\n\t\t\\dur, 1/8,\r\n\t\t\\buf, Prand(d[\\kuerbis], inf),\r\n\t\t\\rate, Pexprand(3.3,3.301, inf),\r\n\t\t\\amp, Pseq([1,0.3,0.2,2,0.3,0.3,0.5,0.3,0.4],inf),\r\n\t\t\\pan, 0.1,\r\n\t)\r\n)\r\n)\r\n\r\nPdef(\\rhythm).stop;\r\nPdef(\\rhythm).play(quant:1);\r\n\r\n\r\n(\r\nPdef(\r\n\t\\rhythm0,\r\n\tPbind(\r\n\t\t\\instrument, \\bufplay,\r\n\t\t\\dur, Pseq((Bjorklund2.new(7,9).rotate(0)/8), inf),\r\n\t\t\\buf, Prand(d[\\drum1], inf),\r\n\t\t\\rate, Pexprand(0.70,0.704, inf),\r\n\t\t\\amp, Pseq((Bjorklund.new(4,9).rotate(0)*1.5)+0.6,inf),\r\n\t\t\\pan, 0,\r\n\t)\r\n)\r\n)\r\n\r\nPdef(\\rhythm0).stop;\r\nPdef(\\rhythm0).play(quant:1);\r\n\r\n\r\n(\r\nPdef(\r\n\t\\rhythm1,\r\n\tPbind(\r\n\t\t\\instrument, \\bufplay,\r\n\t\t\\dur, Pseq(\r\n\t\t\t[Pseq((Bjorklund2.new(7,12).rotate(0)/8),3),Pseq((Bjorklund2.new(5,9).rotate(2)/8),1)],inf),\r\n\t\t\\buf, Prand(d[\\kranz2],inf),\r\n\t\t\\rate, Pexprand(4.7,4.71, inf),\r\n\t\t\\amp, Pseq((Bjorklund.new(5,9).rotate(3)*1.2)+0.6,inf),\r\n\t\t\\pan, -0.1,\r\n\t);\r\n)\r\n)\r\n\r\nPdef(\\rhythm1).stop;\r\nPdef(\\rhythm1).play(quant:1);\r\n\r\n\r\n(\r\nPdef(\r\n\t\\rhythm2,\r\n\tPbind(\r\n\t\t\\instrument, \\bufplay,\r\n\t\t\\dur, Pseq(Bjorklund2.new(7,12).rotate(2)/8, inf),\r\n\t\t\\buf, Prand(d[\\tam], inf),\r\n\t\t\\rate, Pexprand(0.6,0.601,inf),\r\n\t\t\\amp, Pseq((Bjorklund.new(2,9).rotate(5)*1.5)+0.6,inf),\r\n\t\t\\pan, -0.3,\r\n\t);\r\n)\r\n)\r\n\r\nPdef(\\rhythm2).stop;\r\nPdef(\\rhythm2).play(quant:1);\r\n\r\n(\r\nPdef(\r\n\t\\rhythm3,\r\n\tPbind(\r\n\t\t\\instrument, \\bufplay,\r\n\t\t\\dur, Pseq(Bjorklund2.new(11,12).rotate(0)/8, inf),\r\n\t\t\\buf, Prand(d[\\rassel4]++d[\\kuerbis], inf),\r\n\t\t\\rate, 2.5,\r\n\t\t\\amp, Pseq([Pseq((Bjorklund.new(4,9).rotate(1)+0.5),3),Pseq((Bjorklund.new(7,9).rotate(0)),1)],inf),\r\n\t\t\\pan, 0.3,\r\n\t);\r\n)\r\n)\r\n\r\nPdef(\\rhythm3).stop;\r\nPdef(\\rhythm3).play(quant:1);\r\n\r\n\r\n(\r\nPdef(\r\n\t\\wood,\r\n\tPbind(\r\n\t\t\\instrument, \\bufplay,\r\n\t\t\\dur, Pseq(Bjorklund2.new(9,15).rotate(0)/8, inf),\r\n\t\t\\buf, Prand(d[\\wood1]++d[\\wood5], inf),\r\n\t\t\\rate, 0.7,\r\n\t\t\\amp, Pseq([Pseq((Bjorklund.new(2,9).rotate(3)*1.3)+0.7,3),Pseq((Bjorklund.new(4,9).rotate(0)*1.8),1)],inf),\r\n\t\t\\pan, Pseq([-0.3,0,0.3,0],inf),\r\n\r\n\t);\r\n)\r\n)\r\n\r\n\r\nPdef(\\wood).stop;\r\nPdef(\\wood).play(quant:1);\r\n\r\n\r\n// the Pdef for the stringinstrument\r\n\r\n(\r\nPdef(\\hackbrett,\r\n\r\nPbind(\r\n\t\\instrument, \\stringemil,\r\n\t\\out, 50,\r\n\t\\scale, Scale.rast,\r\n\t\\octave, 4,\r\n\r\n\t\t\t\t//\\degree, Pseq([Pwrand([0,1,2,3,4,5,6,7,8,9],[3,1,2,2,1,1,2,3,2,1].normalizeSum,47),Prand([0,2,3,4,7],40),Pseq([7,8,9,10,11,12,13],1)],inf),\r\n\r\n\t\t\\degree, Pseq([Pwrand([0,2,3,-1,5,6,7,8,9],[3,2,2,1,1,1,2,3,1].normalizeSum,47),Prand([-1,0,2,3,4,6,7,9,10],40),Pseq([6,7,8,9,10,11,12,13],1),Prand([6,0,2,3,7,6,7,9,10],40),Pseq([6,7,9,10,11,13,14].reverse,1)],inf),\r\n\r\n\t\t\\dur, Pseq([Pseq(Bjorklund2.new(5,9).rotate(0)/8, 8),Pseq(Bjorklund2.new(2,9).rotate(0)/24, 1),Pseq(Bjorklund2.new(1,9).rotate(0)/24, 1),Pseq(Bjorklund2.new(4,9).rotate(3)/24, 1)],inf),\r\n\r\n\t\\coef, Pseq((Bjorklund.new(11,16).rotate(7)*(0.1.neg))+0.8,inf),\r\n\t\\decay, Pseq((Bjorklund.new(5,12).rotate(5)*2)+1,inf),\r\n\t\\hit, Pseq((Bjorklund.new(7,12).rotate(3)*0.4)+0.6,inf),\r\n\t\\amp, 0.7,\r\n\t\\pan, 0,\r\n\r\n\t);\r\n)\r\n)\r\n\r\nPdef(\\hackbrett).stop;\r\nPdef(\\hackbrett).play(quant:1);",
   "labels" : [
      "drums",
      "pluck",
      "euclidian",
      "98",
      "strings",
      "persian",
      "turk",
      "gipsy"
   ]
}
