Submit
Browse
Random
Anonymous
Login
RSS
☾
SuperCollider Code
Fork Code: 9/8 drum'n strings
name
code content
//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. /// creating a dictionary with samples. ( d = Dictionary.new; d.add(\tam -> PathName("/Users/bernhardzitz/Music/SUPERCOLLIDER/buffers/tamsolo/").entries.collect({ arg sf; Buffer.read(s, sf.fullPath); });); d.add(\kranz2 -> PathName("/Users/bernhardzitz/Music/SUPERCOLLIDER/buffers/kranz2/").entries.collect({ arg sf; Buffer.read(s, sf.fullPath); });); d.add(\wood1 -> PathName("/Users/bernhardzitz/Music/SUPERCOLLIDER/buffers/wood1/").entries.collect({ arg sf; Buffer.read(s, sf.fullPath); });); d.add(\wood5 -> PathName("/Users/bernhardzitz/Music/SUPERCOLLIDER/buffers/wood5/").entries.collect({ arg sf; Buffer.read(s, sf.fullPath); });); d.add(\drum1 -> PathName("/Users/bernhardzitz/Music/SUPERCOLLIDER/buffers/drum1/").entries.collect({ arg sf; Buffer.read(s, sf.fullPath); });); d.add(\kuerbis -> PathName("/Users/bernhardzitz/Music/SUPERCOLLIDER/buffers/kuerbis/").entries.collect({ arg sf; Buffer.read(s, sf.fullPath); });); d.add(\rassel4 -> PathName("/Users/bernhardzitz/Music/SUPERCOLLIDER/buffers/rassel4/").entries.collect({ arg sf; Buffer.read(s, sf.fullPath); });); ) // Masterbus with reverb and limiter. Must be the first SynthDef for correct node order. ( SynthDef.new(\revlimit, { arg in=50, out=0; var sig; sig = In.ar(in,2); sig = GVerb.ar(sig,24,0.25,0.15,0.17,15,1,0.1,0.02); sig = Limiter.ar(sig, 0.8,0.02); Out.ar(out, sig); }).play; ) // Sampleplayer for mono samples with panning and two channel ouput. Sends to bus 50 (Masterbus). ( SynthDef.new(\bufplay, { arg buf=0, rate=1, pan=0, amp=1; var sig; sig = PlayBuf.ar(1, buf, BufRateScale.ir(buf) * rate, doneAction:2); sig = Pan2.ar(sig,pan,amp); sig = sig.tanh * 0.7; Out.ar(50, sig); }).add; ) // Stringinstrument with extra reverb. Sends to bus 50 (Masterbus) ( SynthDef(\stringemil, {arg out = 0, hit = 0.1, amp = 1, freq = 440, decay = 5, pan=0,coef = 0.1; var env, snd; env = EnvGen.kr(Env.linen(0, decay, 0), doneAction: 2); snd = Pluck.ar( in: PinkNoise.ar(hit), trig: Impulse.kr(0), maxdelaytime: 0.1, delaytime: freq.reciprocal, decaytime: decay, coef: coef); snd = Pan2.ar(snd,pan,amp); snd = GVerb.ar(snd,34,0.55,0.25,0.27,55,1,0.25,0.2); snd = LeakDC.ar(snd).clip2; Out.ar(out, snd * env); }).add; ) // records to "/Users/admin/Music/SuperCollider Recordings/" s.record; s.stopRecording; // the Pdefs for percussion ( Pdef( \rhythm, Pbind( \instrument, \bufplay, \dur, 1/8, \buf, Prand(d[\kuerbis], inf), \rate, Pexprand(3.3,3.301, inf), \amp, Pseq([1,0.3,0.2,2,0.3,0.3,0.5,0.3,0.4],inf), \pan, 0.1, ) ) ) Pdef(\rhythm).stop; Pdef(\rhythm).play(quant:1); ( Pdef( \rhythm0, Pbind( \instrument, \bufplay, \dur, Pseq((Bjorklund2.new(7,9).rotate(0)/8), inf), \buf, Prand(d[\drum1], inf), \rate, Pexprand(0.70,0.704, inf), \amp, Pseq((Bjorklund.new(4,9).rotate(0)*1.5)+0.6,inf), \pan, 0, ) ) ) Pdef(\rhythm0).stop; Pdef(\rhythm0).play(quant:1); ( Pdef( \rhythm1, Pbind( \instrument, \bufplay, \dur, Pseq( [Pseq((Bjorklund2.new(7,12).rotate(0)/8),3),Pseq((Bjorklund2.new(5,9).rotate(2)/8),1)],inf), \buf, Prand(d[\kranz2],inf), \rate, Pexprand(4.7,4.71, inf), \amp, Pseq((Bjorklund.new(5,9).rotate(3)*1.2)+0.6,inf), \pan, -0.1, ); ) ) Pdef(\rhythm1).stop; Pdef(\rhythm1).play(quant:1); ( Pdef( \rhythm2, Pbind( \instrument, \bufplay, \dur, Pseq(Bjorklund2.new(7,12).rotate(2)/8, inf), \buf, Prand(d[\tam], inf), \rate, Pexprand(0.6,0.601,inf), \amp, Pseq((Bjorklund.new(2,9).rotate(5)*1.5)+0.6,inf), \pan, -0.3, ); ) ) Pdef(\rhythm2).stop; Pdef(\rhythm2).play(quant:1); ( Pdef( \rhythm3, Pbind( \instrument, \bufplay, \dur, Pseq(Bjorklund2.new(11,12).rotate(0)/8, inf), \buf, Prand(d[\rassel4]++d[\kuerbis], inf), \rate, 2.5, \amp, Pseq([Pseq((Bjorklund.new(4,9).rotate(1)+0.5),3),Pseq((Bjorklund.new(7,9).rotate(0)),1)],inf), \pan, 0.3, ); ) ) Pdef(\rhythm3).stop; Pdef(\rhythm3).play(quant:1); ( Pdef( \wood, Pbind( \instrument, \bufplay, \dur, Pseq(Bjorklund2.new(9,15).rotate(0)/8, inf), \buf, Prand(d[\wood1]++d[\wood5], inf), \rate, 0.7, \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), \pan, Pseq([-0.3,0,0.3,0],inf), ); ) ) Pdef(\wood).stop; Pdef(\wood).play(quant:1); // the Pdef for the stringinstrument ( Pdef(\hackbrett, Pbind( \instrument, \stringemil, \out, 50, \scale, Scale.rast, \octave, 4, //\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), \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), \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), \coef, Pseq((Bjorklund.new(11,16).rotate(7)*(0.1.neg))+0.8,inf), \decay, Pseq((Bjorklund.new(5,12).rotate(5)*2)+1,inf), \hit, Pseq((Bjorklund.new(7,12).rotate(3)*0.4)+0.6,inf), \amp, 0.7, \pan, 0, ); ) ) Pdef(\hackbrett).stop; Pdef(\hackbrett).play(quant:1);
code 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.
use markdown for formatting
preview markdown
category tags
comma separated, e.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identifiers, e.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change