Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: 115pluck (Assignment 1)
name
code content
( SynthDef("hihat", {arg out = 0, amp = 0.5, att = 0.01, rel = 0.2, ffreq = 6000, pan = 0; var env, snd; env = Env.perc(att, rel, amp).kr(doneAction: 2); snd = WhiteNoise.ar; snd = HPF.ar(in: snd, freq: ffreq, mul: env); Out.ar(out, Pan2.ar(snd, pan)); }).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("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("sawSynth", { arg freq = 440, amp = 0.1, att = 0.1, rel = 2, lofreq = 1000, hifreq = 3000; var env, snd; env = Env.perc( attackTime: att, releaseTime: rel, level: amp ).kr(doneAction: 2); snd = Saw.ar(freq: freq * [0.99, 1, 1.001, 1.008], mul: env); snd = LPF.ar( in: snd, freq: LFNoise2.kr(1).range(lofreq, hifreq) ); snd = Splay.ar(snd); Out.ar(0, snd); }).add; ( SynthDef("plucking", {arg amp = 0.1, freq = 440, decay = 5, dampen = 0.1; var env, snd; env = Env.linen(0, decay, 0).kr(doneAction: 2); snd = Pluck.ar( in: WhiteNoise.ar(amp), trig: Impulse.kr(0), maxdelaytime: 0.1, delaytime: freq.reciprocal, decaytime: decay, coef: dampen); Out.ar(0, [snd, snd]); }).add; ) ) ( ~hihat = Pbind( \instrument, "hihat", \dur, Pseq([Rest(1/4), 1/4], inf), \att, 0.01, \rel, 0.1, \ffreq, 11000, \pan, 0, \amp, 0.3 ); ~snare = Pbind( \instrument, "snare", \dur, Pseq([Rest(1/2), 1/2], inf), \att, 0.01, \rel, 0.4, \sinfreq, 70, \ffreq, 2000, \amp, 1 ); ~kick = Pbind( \instrument, "kick", \dur, 1/3, \att, 0.01, \rel, 0.22, \sinfreq, 60, \glissf, 0.9, \amp, 1, ); ~saw1 = Pbind( \instrument, "sawSynth", \midinote, Pseq([ [51, 55, 58, 60], [53, 56, 58, 60], Prand([ [30, 35, 40, 45], [49, 52, 54, 56], ], 1) ], inf ), \dur, Prand([1, 2.5, 4, 4.5], inf), \att, 0.1, \rel, Pkey(\dur) + 1, \hifreq, 500, \amp, 1 ); ~saw2 = Pbind( \instrument, "sawSynth", \midinote, Pseq([30, 35, 37, 39], inf), \dur, Prand([1/4, 1/4, 1/2, Rest(3), 1/4], inf), \ctranspose, [0, -12], \att, 0.01, \rel, 0.2, \amp, 0.4, \lofreq, 100, \hifreq, 1000 ); ~pluck = Pbind( \instrument, "plucking", \dur, 1/2,); ) ~hihat.play; ~snare.play; ~kick.play; ~saw1.play; ~saw2.play; ~pluck.play; ( { ~hihatplay = ~hihat.play; 2.wait; ~snareplay = ~snare.play; ~kickplay = ~kick.play; ~saw2play = ~saw2.play; 4.wait; ~hihatplayer = ~hihat.play; 2.wait; ~saw1play = ~saw1.play; }.fork )
code description
https://soundcloud.com/macdaddymase/sc-161108-115354
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