Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: hommage à l'impressionnisme
name
code content
// example 1: Klank with 16 Ringzes: ( fork{ SynthDef(\aKlank16, { arg atk, rls, frqs = #[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], amps = #[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], rngs = #[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; var snd, env; snd = Klank.ar(`[frqs, amps, rngs], PinkNoise.ar(1!2)); env = EnvGen.kr(Env([0,1,0], [atk, rls], -5), doneAction:2); OffsetOut.ar(0, snd * env); }).add; s.sync; { var numDo, ptchs, frqs, rngs, amps; numDo = 200; ptchs = (21, 23..135); frqs = { (ptchs.wchoose(Array.fill(ptchs.size, { |i| (i/ptchs.size*pi).sin }).normalizeSum).midicps) }; amps = { (-96..-54).choose.dbamp }; rngs = { exprand(1.5, 3.5) }; numDo.do{ arg i; var wait, waitFactor; wait = exprand(0.05, 2.5); waitFactor = 1; // Array.fill(numDo, { |i| 0.8 + ((numDo/2+i/numDo*pi).sin.abs * 2) })[i]; s.makeBundle(0.2, { Synth(\aKlank16, [ \atk,[0.01]++(wait*(2.5..5.5)).wchoose([0.3, 0.15, 0.2, 0.15, 0.2]), \rls, wait*(5.5..9.5).choose, \frqs, {frqs.()}.dup(16), \amps, {amps.()}!16, \rngs, {rngs.()}!16 ], 1, 0) }); (waitFactor*wait).wait } }.fork } ) // example 2: Klank with 9 Ringzes(sc posts a warning message when exceeding 9 Ringzes): ( fork{ SynthDef(\aKlank9, { arg atk, rls; var snd, env, ptchs, wghts; ptchs = (21, 23..135); wghts = Array.fill(ptchs.size, { |i| (i/ptchs.size*pi).sin }).normalizeSum; snd = Klank.ar( `[ { TWChoose.kr( 1, ptchs.midicps, wghts) }!9, { Rand(-96, -54).dbamp }!9, { Rand(1.5, 3.5) }!9 ], PinkNoise.ar(1!2) ); env = EnvGen.kr(Env([0,1,0], [atk, rls], -5), doneAction:2); OffsetOut.ar(0, snd * env); }).add; s.sync; { var numDo = 200; numDo.do{ arg i; var wait, waitFactor; wait = exprand(0.05, 2.5); waitFactor = 1; // Array.fill(numDo, { |i| 0.8 + ((numDo/2+i/numDo*pi).sin.abs * 2) })[i]; s.makeBundle(0.2, { Synth(\aKlank9, [ \atk,[0.01]++(wait*(2.5..6.5)).wchoose([0.3, 0.15, 0.2, 0.15, 0.2]), \rls, wait*(5.5..9.5).choose ], 1, 0) }); (waitFactor*wait).wait } }.fork } )
code description
An example of iterating randomly filtered pink noise with envelope controls.
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