Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Randomized FM7 perc sounds
name
code content
/** Requires: SuperCollider v3.8.0+ FM7 (sc3 plugins) Feedback Quark To run evaluate each of the numbered blocks **/ //////////////////// // 1 TempoClock.default.tempo_(60/60); //////////////////// // 2 ( ~env = {arg min = 1, max = 1, trig, dur; var shape = Env.shapeNames.choose; var num = rrand(4,16); var levels = (0..rrand(3,8)).collect({1.0.rand;}); var durs = (0..levels.size-1).collect({1.0.rand}).normalizeSum; var env = Env(levels,durs,shape); EnvGen.kr(env, gate:trig, timeScale:dur).range(min, max); }; ~ctrls = {arg freq, trig, dur; var ctrls = (0..5).collect({arg val; var min = rrand(0.25, 1.0); var max = rrand(1.0, 3.0); var fmul = ~env.(min, max, trig, dur); [freq * fmul, 0, 1]; }); ctrls; }; ~algos = [ [0,2] -> [ [0,1], [2,3], [3,4], [4,5], [5,5] ], [0,2] -> [ [0,1], [1,1], [2,3], [3,4], [4,5] ], [0,3] -> [ [0,1], [1,2], [3,4], [4,5], [5,5] ], [0,3] -> [ [0, 1], [1, 2], [3, 4], [4, 5], [5, 3] ], [0,2] -> [ [0,1], [2,3], [3,4], [3,5], [4,5] ], [0,1,2,3,4,5] -> [ [5,5] ] ]; ~mods = {arg trig, dur; var algo = ~algos.choose; var matrix = Array.fill2D(6, 6, 0); var vals = algo.value; vals.do {arg x; matrix[x[0]][x[1]] = ~env.(1.0.rand, 1.0.rand, trig, dur) }; [matrix, algo.key]; }; ~synth = { var freq, sig; thisThread.randSeed_(100000.rand.debug("seed")); freq = \freq.kr(432); sig = { var dur = \dur.kr(1); var trig = \trig.tr(0); var ctrls = ~ctrls.(freq, trig, dur); var mods = ~mods.(trig, dur); var sig = FM7.ar(ctrls, mods[0]).slice(mods[1]); var env = Env.linen(\atk.kr(0.01), \sus.kr(0), \rel.kr(1), curve:\curve.kr(-4)).kr(gate:trig); sig = Splay.ar(sig) * env; sig; }; Splay.ar(sig.()) * \amp.kr(0.1) * AmpCompA.kr(freq); }; ) //////////////////// // 3 ( ~fm11 = NodeProxy.audio; ~fm11.quant = 1.0; ~fm11[0] = ~synth; ) //////////////////// // 4 (~fm11[8] = \set -> Pbind( \trig, 1, \delta, Pwrand([Rest(0.5), 0.5], [0.2, 0.8], inf), \beatDur, Pfunc({thisThread.clock.beatDur}), \dur, Pkey(\beatDur) * Pkey(\delta) * 1, \sus, Pkey(\dur) * 0.05, \rel, Pkey(\dur) * Pwhite(0.01, 0.3), \curve, -4, \degree, Pwhite(0,5,inf), \octave, Pwrand([4,5,6], [0.3,0.6,0.01].normalizeSum, inf), \scale, Scale.hexSus )) //////////////////// // 5 ( Tdef(\main, { ~fm11.play; ~fm11[16] = \filter -> {arg in; var sig = FbC({arg fb; fb * 0.4 + in;}, 1.5/4); var sig2 = FbC({arg fb; fb * 0.5 + in;}, 4.5/4); sig + sig2; }; ~fm11[18] = \filter -> {arg in; GVerb.ar(in, 150, revtime:5, taillevel:0.7); }; ~fm11.set(\wet16, 0.5, \wet18, 0.2); loop({ "update".postln; ~fm11[0] = ~synth; 16.wait; }); }).play )
code description
Requires: SuperCollider v3.8.0+ FM7 (sc3 plugins) Feedback Quark
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