Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Melodic, beat driven, evening synthesis.
name
code content
s.boot; ( b = Buffer.alloc(s, 96000*10, 1); SynthDef(\kick, { | out = 0, peakFreq = 90, attack = 0.01, decay = 0.95, pos = 0, amp = 0.33| var multipliers, pitchEnv, snd; multipliers = [1,1.015, 0.502]; pitchEnv = EnvGen.ar(Env.new([40, peakFreq, 20], [attack, decay], 'exp'), doneAction:2); snd = Mix(SinOsc.ar(pitchEnv*multipliers, 0, EnvGen.ar(Env.perc(attack, decay)) * 1/multipliers.size)); snd = Compander.ar(snd, snd, 0.001, 1, 0.6, 0.012, 0.25, 7.5); Out.ar(out, Pan2.ar(snd, pos, amp)); }).add; SynthDef(\fmTone, { | out = 0, amp = 0.8, freq = 940, modRate = 2000, index = 5, attack = 0.01, dur = 1, pos = 0 | var env, mod, snd; // mod = LFSaw.ar(LFNoise2.ar(0.12, 2000, 20).abs, 0, LFSaw.ar(0.3, 0, 1000)).abs; env = EnvGen.ar(Env.perc(attack, dur-attack), doneAction:2); // mod = EnvGen.ar(Env.triangle(dur)); mod = Phasor.ar(0, TRand.ar(0.01, 1, Impulse.ar(0)), 0, index); snd = Mix([ SinOsc.ar(freq, 0, 0.3), SinOsc.ar(freq + mod, 0, 0.5), SinOsc.ar((freq*3) + (mod), 0, 0.1), SinOsc.ar((freq*6) + (mod), 0, 0.1) ]); Out.ar(out, Pan2.ar(snd, pos, env * amp)); }).add; SynthDef(\distortion, { | out = 0, in = 10, smoothing = 1, amp = 0.6, pos = 0 | var snd; // snd = CrossoverDistortion.ar(In.ar(in), 0.35, XLine.ar(1, 0.01, 60, doneAction:2), LFNoise2.ar(0.15)); snd = CrossoverDistortion.ar(In.ar(in), 0.35, smoothing, LFNoise2.ar(0.15)); Out.ar(out, Pan2.ar(snd, pos, amp)); }).add; SynthDef(\grains, { |amp = 0.15, out = 0, pos = 0 | var snd, trate, dur, rate; trate = LFNoise2.ar(0.5, 50, 2).abs; dur = 7 / trate; rate = Drand([-12, -7, 5, -24, -8, 11, 12, 24].midiratio, inf); snd = Mix(TGrains.ar(2, Impulse.ar(trate), b, rate, LFNoise2.ar(0.1,BufDur.kr(b)), dur, 0, SinOsc.ar(0.1), 2)); Out.ar(out, Pan2.ar(snd, pos, amp)); }).add; SynthDef(\verb_1, { |out = 0, in = 20| var snd; snd = GVerb.ar( LPF.ar(In.ar(in), LFNoise2.ar(1, 6000, 500).abs), 10, LFNoise2.ar(1, 5, 0.2).abs, 0.965, 1, LFNoise2.ar(1, 25, 1).abs, 1, 0.2, 1, mul: 0.2 ); Out.ar(out, snd); }).add; SynthDef(\verb_2, { |out = 0, in = 20| var snd = GVerb.ar( LPF.ar(In.ar(in), 200), 49, LFNoise2.ar(0.5, 15, 0.2).abs, 0.91, 0.7, LFNoise2.ar(1, 25, 1).abs, 1, 0.2, 1, mul: LFNoise2.ar(0.8, 0.225, 0.1).abs ); Out.ar(out, snd); }).add; SynthDef(\noise, { | decay = 0.1, maxRate = 50, amp = 0.08, out = 0 | var snd, rate, trig; rate = LFNoise2.ar(2, maxRate, 1).abs.clip(0, maxRate); trig = Impulse.ar(rate); snd = Resonz.ar( // Input, AD enveloped white noise: Decay.ar(trig, LinExp.ar(rate, 0, maxRate, 5, 0.01), WhiteNoise.ar), // Freq: LinLin.ar(rate, 0, maxRate, 2500, 10000), // RQ: LinLin.ar(rate, 0, maxRate, 1, 0.001) ); Out.ar(out, Pan2.ar(snd, snd, amp)); }).add; ) ( ~fxBus = 20; /* For outputting to Ardour for further editing: ~kickOut = 4; ~synthOut = 6; ~grainsOut = 8; ~noiseOut = 10; ~verb1Out = 12; ~verb2Out = 14; ~distortionOut = 16; */ ~kickOut = 0; ~synthOut = 0; ~grainsOut = 0; ~noiseOut = 0; ~verb1Out = 0; ~verb2Out = 0; ~distortionOut = 0; Synth(\verb_1, [\out, ~verb1Out]); Synth(\verb_2, [\out, ~verb2Out]); Synth(\distortion, [\in, ~fxBus, \out, ~distortionOut, \smoothing, 0.65, \amp, 0.026]); SynthDef(\sampler, {RecordBuf.ar(In.ar(~fxBus), b.bufnum, loop:1)}).play; Pdef(\kick, Pbind(\instrument, \kick, \out, [~kickOut,~fxBus], \amp, [0.65, 0.24], \peakFreq, [102, 282], \attack, Pwrand([0.0035, 0.5], [0.95, 0.05], inf), // \delta, Pstutter(8, Prand([0.1, 0.2, 0.4], inf)), \delta, Pwrand([ Pseq([0.8, 0.8, 0.4, 0.2, 0.4], 1), Pseq([1.6, 0.4, 0.2, 0.2, 0.2], 1), Pseq(0.1!12, 1) ], [0.4, 0.4, 0.2], inf), \decay, Pkey(\delta) * Pexprand(0.7, 4) ) ).play(quant:1); Pmono(\noise, \out, [~fxBus, ~noiseOut], \amp, 0.025).play; Pdef(\melody, Pbind(\instrument, \fmTone, \out, [~synthOut, ~fxBus], \midinote, Pstutter(Pexprand(1, 12), Ptuple([ Pseq([61, 64, 71], 1), Prand([61, 64, 71]+5, 1), Prand([61, 64, 71]+7, 1), Prand([61, 64, 71]+12, 1), Prand([61, 64, 71]+24, 1) ], inf)) - 2, \dur, Pexprand(0.12, 4), \delta, Pstutter(4, Prand([0.1, 0.2, 0.4], inf)), \strum, Pwrand( [ 0, Pkey(\delta)/Prand([0.5,1,2,4,8], 5) ], [0.85, 0.15], inf), \index, Pexprand(5, 50), \attack, 0.01, \amp, 0.15) ).play(quant:1); Pmono(\grains, \out, [~fxBus, ~grainsOut], \amp, 0.13).play; )
code description
Posted at the request of Jonathan Reus. Melodic components generated with a simple fm based synth. A nice kick drum sound, some swirly noise and a bit of granular ambience.
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