Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: The Unfunky Drummer
name
code content
( fork{ //---------Source Files--------- ~numOfPatterns = 16; ~synthDefToUse = \bufPlay; //Change to \bufPlay2 to use stereo samples ~rate = 2; //Rate of playback ~source = [ // Create an array of your samples. ~media.samples points at my base sample directory and is defined in my startup file. ~media.samples ++ "808/kicks/808 kick 6.wav", ~media.samples ++ "808/snares/808 snare 6.wav", ~media.samples ++ "808/hats/808 hat 2.wav", ~media.samples ++ "808/other/808 cowbell.wav", ~media.samples ++ "808/other/808 clap.wav", ~media.samples ++ "808/other/808 rim.wav", ~media.samples ++ "808/other/808 maraca.wav" ]; Buffer.freeAll; ~buffers = ~source.collect{|source| Buffer.read(s, source)}; ~patterns = ~numOfPatterns.collect{|val| Pbind(*[dur: Pn(1/val, val)])}; ~randPattern = Prand(~patterns, 1); ~patterns = ~buffers.collect{|buf| Pbind(*[bufnum: buf]) <> ~randPattern}; SynthDef(\bufPlay, {|out = 0, bufnum, rateScale = 1, amp = 1| Out.ar(out, PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum) * rateScale, doneAction: 2) * amp!2);}).add; SynthDef(\bufPlay2, {|out = 0, bufnum, rateScale = 1, amp = 1| Out.ar(out, PlayBuf.ar(2, bufnum, BufRateScale.kr(bufnum) * rateScale, doneAction: 2) * amp);}).add; s.sync; Ppar(~patterns, inf).play(TempoClock(~rate, 0), protoEvent: (instrument: ~synthDefToUse, amp: 0.25)); //Change to /bufPlay2 for stereo samples }; )
code description
The Unfunky Drummer - Insert samples, extract joy. Code by Jonathan Siemasko http://www.schemawound.com/ NOTE: Set values for ~synthDefToUse, ~rate and ~source before running.
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.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