Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Sound Design and Chill A2
name
code content
( SynthDef("am1", {arg freq = 440, modfreq = 1, amp = 0.2, att = 0.01, rel = 3, wubb = 1; var carrier, modulator, env, wub; env = Env.perc( attackTime: att, releaseTime: rel, level: amp ).kr(2); modulator = SinOsc.ar(modfreq).range(0, 1); carrier = LPF.ar( Saw.ar(freq: freq, mul: env * modulator)); Out.ar(0, carrier ! 2); }).add; SynthDef("fm2", {arg freq = 440, modindex = 10, amp = 0.1, pos = 0, gate = 1, att = 0.01, rel = 0.3; var carrier, modulator, freqdev, env, modfreq; // i = d/m, so d = m*i modindex = Line.kr(modindex, 1, att); modfreq = freq / 2; freqdev = modfreq * modindex; modulator = SinOsc.ar(freq: modfreq, mul: freqdev); carrier = SinOsc.ar(freq: freq + modulator); env = Env.asr( attackTime: att, sustainLevel: amp, releaseTime: rel ).kr(doneAction: 2, gate: gate); carrier = Pan2.ar(in: carrier, pos: pos, level: env); Out.ar(0, carrier * 0.5); }).add; SynthDef("kick", {arg out = 0, amp = 0.3, sinfreq = 60, glissf = 0.9, att = 0.01, rel = 0.45, pan = 0; var env, snd, ramp; env = Env.perc(att, rel, amp).kr(doneAction: 2); ramp = XLine.kr( start: sinfreq, end: sinfreq * glissf, dur: rel ); snd = SinOsc.ar(freq: ramp, mul: env); snd = Pan2.ar(snd, pan); Out.ar(out, snd); }).add; SynthDef("snare", {arg out = 0, amp = 0.1, sinfreq = 180, att = 0.01, rel = 0.2, ffreq = 2000, pan = 0; var env, snd1, snd2, sum; env = Env.perc(att, rel, amp).kr(doneAction: 2); snd1 = HPF.ar( in: WhiteNoise.ar, freq: ffreq, mul: env ); snd2 = SinOsc.ar(freq: sinfreq, mul: env); sum = snd1 + snd2; Out.ar(out, Pan2.ar(sum, pan)); }).add; SynthDef(\snare2, { |out = 0, pan = 0, amp = 0.3| var pop, popAmp, popFreq; var noise, noiseAmp; var snd; popFreq = EnvGen.ar(Env([3261, 410, 160], [0.005, 0.01], curve: \exp)); popAmp = EnvGen.ar(Env.perc(0.001, 0.11)) * 0.7; pop = SinOsc.ar(popFreq) * popAmp; noiseAmp = EnvGen.ar(Env.perc(0.001, 0.15), doneAction: 2); noise = BPF.ar(WhiteNoise.ar, 810, 1.6) * noiseAmp; snd = (pop + noise) * 1.3; Out.ar(out, Pan2.ar(snd, pan, amp)); }).add; SynthDef("riser", {arg out = 0, amp = 0.5, pan = 0; var env, snd; env = Env.linen( 2, 0.000001, 0.0001, 0.5).kr(doneAction: 2); snd = LPF.ar( in: WhiteNoise.ar(env), freq: 2000, mul: amp ); Out.ar(out, Pan2.ar(snd, pan)); }).add; SynthDef(\wobble, { arg out=0, amp=0.1, gate=2, pan=0, spread=0.8, freq=200, doneAction=2; var sig, sig1, sig2, sig3; sig1 = LFSaw.ar(freq * 1 + (0.04 * [1,-1])); sig2 = LFSaw.ar(freq * 0.99 ); sig3 = LFSaw.ar(freq * 1 ); sig = sig1 + sig2 + sig3; sig = (sig*50).tanh; sig = sig * EnvGen.ar(\adsr.kr(Env.adsr(0.01,0.1,0.8,0.5)),gate,doneAction:doneAction); sig = Splay.ar(sig, spread, amp, pan); Out.ar(out, sig); }).add; SynthDef(\wobble2, { arg out=0, amp=0.1, gate=2, pan=0, spread=0.8, freq=200, doneAction=2, modfreq=1; var sig, sig1, sig2, sig3, modulator; modulator = SinOsc.ar(modfreq).range(0, 1); sig1 = LFSaw.ar(freq * 1 + (0.04 * [1,-1])); sig2 = LFSaw.ar(freq * 0.99 ); sig3 = LFSaw.ar(freq * 1 ); sig = sig1 + sig2 + sig3; sig = (sig*50).tanh; sig = sig * EnvGen.ar(\adsr.kr(Env.adsr(0.01,0.1,0.8,0.5)),gate,doneAction:doneAction); sig = Splay.ar(sig, spread, amp*modulator, pan); Out.ar(out, sig); }).add; SynthDef(\sub, {arg out = 0, amp = 0.3, sinfreq = 60, sus = 0.1, glissf = 0.005, att = 0.01, rel = 0.45, pan = 0; var env, snd, ramp; env = Env.linen(attackTime: 0.25, sustainTime: sus, releaseTime: rel, level: amp).kr(doneAction: 2); ramp = XLine.kr( start: sinfreq, end: sinfreq, dur: rel ); snd = SinOsc.ar(freq: ramp, mul: env); snd = Pan2.ar(snd, pan); Out.ar(out, snd); }).add; ) /////////////// ( ~snare =Pbind( \instrument, "snare", \sinfreq, 100, \dur, Pseq([Rest(2), 4, 4, 2], 1), \amp, 0.15, \rel, 0.5, ); ~snare2 =Pbind( \instrument, \snare2, \sinfreq, 120, \dur, Pseq([Rest(2), 4, 4, 2], 1), \amp, 0.25, \rel, 0.5, ); ~kick = Pbind( \instrument, "kick", \dur, Pseq([ 4, 1/2, 1/4, 1/4, 3, 1/2, 1/2, 2, 1/2, 1/4, 1/4], 1), \att, 0.0001, \rel, 0.75, \sinfreq, 120, \glissf, 0.001, \amp, 0.6, ); ~start = Pbind( \instrument, "fm2", \dur, Pseq([7/2, Rest(1/2), 7/2, Rest(1/2), 7/4, 7/4, 1/2], 1), \midinote, Pseq([ [69, 65, 62], \rest, [67, 64, 60], \rest, [65, 62, 58], [67, 64, 60], [69, 65, 62], ], 1), \ctranspose, [0, 12], \modindex, Pseq([1, \rest, 5, \rest, 6, 7, 10], inf), \amp, 0.1, \att, 0.01, \rel, Pwhite(1, 1.5), \pos, 0 ); ~amx = Pbind( \instrument, "am1", \midinote, Pseq([84, 84, 84, 86, 84, 84, 84, 84, 86, 84, 81, 84, 86, 86, 88], 1), \dur, Pseq([1, 1, 1, 1, 1/2, 1/2, 1, 1, 1, 3/4, 3/4, 3/4, 3/4, 1/2, 1/2], 1), \amp, 1, \att, 0.01, \rel, 1, \pos, 0 ); ~amx2 = Pbind( \instrument, "am1", \midinote, Pseq([84, 84, 84, 86, 84, 84, 84, 84, 86, 84, 81, 84, 86, 86, 88], 1), \dur, Pseq([1, 1, 1, 1, 1/2, 1/2, 1, 1, 1, 3/4, 3/4, 3/4, 3/4, 1/2, 1/2], 1), \amp, 0.5, \att, 0.01, \rel, 1, \pos, 0, \ctranspose, [-12, 0, 12], ); ~riser = Pbind( \instrument, "riser", \dur, 6, \degree, Pseq([1], 1), \amp, 1 ); ~saw = Pbind( \instrument, \wobble, \dur, Pseq([7/2, Rest(1/2), 7/2, Rest(1/2), 7/4, 7/4, 1/2], 1), \midinote, Pseq([ [69, 65, 62], \rest, [67, 64, 60], \rest, [65, 62, 58], [67, 64, 60], [69, 65, 62], ], inf), \ctranspose, [ -12, 0, 12], \amp, 0.025, ); ~wubwub = Pbind( \instrument, \wobble2, \dur, Pseq([7/2, Rest(1/2), 7/2, Rest(1/2), 7/4, 7/4, 1/2], 1), \midinote, Pseq([ [69, 65, 62], \rest, [67, 64, 60], \rest, [65, 62, 58], [67, 64, 60], [69, 65, 62], ], inf), \ctranspose, [ -24, -12, 0], \amp, 0.05, \modfreq, Pseq([ 0, \rest, 6, \rest, 0, 10, 0], 1), ); ~sub = Pbind( \instrument, \sub, \dur, Pseq([4, 4, 7/4, 7/4, 1/2], 1), \att, 5, \sus, Pseq([1, 1, 1/2, 1/2, 1/8], 1), \rel, 0.01, \sinfreq, Pseq([ 73.4, 65.4, 58.3, 65.4, 73.4], 1), \amp, 0.20, \glissf, 0.005 ); ) ///////////// ~start.play(TempoClock(145/60)); ~kick.play(TempoClock(145/60)); ~snare.play(TempoClock(145/60)); ~snare2.play(TempoClock(145/60)); ~amx.play(TempoClock(145/60)); ~amx2.play(TempoClock(145/60)); ~riser.play(TempoClock(145/60)); ~saw.play(TempoClock(145/60)); ~sub.play(TempoClock(145/60)); ~wubwub.play(TempoClock(145/60)); /////////////////// ( Pspawner({arg maestro; maestro.seq(~start); maestro.seq(~start); maestro.seq(Ppar([~start, ~amx], 2)); maestro.seq(Ppar([~start, ~amx2, ~saw], 2)); maestro.seq(~riser); maestro.seq(Ppar([ ~kick, ~snare, ~snare2, ~amx2, ~sub, ~wubwub, ~saw], 4)); maestro.seq(Ppar([~start, ~kick, ~snare, ~snare2, ~amx2, ~wubwub], 4)); maestro.seq(Ppar([~start, ~amx, ~kick, ~snare, ~snare2])); maestro.seq(~start); maestro.suspendAll; }).play(TempoClock(145/60)); )
code description
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