Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Trumping 115granular
name
code content
////SAMPLES ~ragebass = Buffer.read(s, "C:/Users/Ian/Desktop/SUPERCOLLIDER/SAMPLES/final.wav"); ~trump = Buffer.read(s, "C:/Users/Ian/Desktop/SUPERCOLLIDER/SAMPLES/americandream.wav"); ~no = Buffer.read(s, "C:/Users/Ian/Desktop/SUPERCOLLIDER/SAMPLES/nonoonono.wav"); ~kanye = Buffer.read (s, "C:/Users/Ian/Desktop/SUPERCOLLIDER/SAMPLES/monokanye.wav"); ~stick = Buffer.read (s, "C:/Users/Ian/Desktop/SUPERCOLLIDER/SAMPLES/monostick.wav"); // =================================== // ASSIGNMENT 3 - IAN MCDOUGALL // =================================== // Your SynthDefs go here ( SynthDef("hihat", {arg out = 0, amp = 0.5, att = 0.01, rel = 0.2, ffreq = 12000, pan = 0; var env, snd; env = Env.perc( attackTime: att, releaseTime: rel, level: amp).kr(doneAction: 2); snd = WhiteNoise.ar( mul: env, add: 0); snd = LPF.ar( in: snd, freq: ffreq, mul: 1, add: 0); Out.ar(out, Pan2.ar(snd, pan)); }).add; SynthDef("granny3", {arg rate = 1, amp = 1, buffer, startPos = 0, attack = 0.02, release = 0.5, ffreq = 1000, rq = 0.1, panning = 0, delay = 0.3, decay = 1; var snd, env; env = Env.perc(attackTime: attack, releaseTime: release, level: amp).kr(doneAction: 2); snd = PlayBuf.ar( numChannels: 1, bufnum: buffer, rate: rate, startPos: startPos.linlin(0, 1, 0, BufFrames.kr(buffer)) ); snd = snd * env; snd = BPF.ar(snd, ffreq, rq); snd = CombC.ar(snd, maxdelaytime: 2, delaytime: delay, decaytime: decay); snd = Pan2.ar(snd, panning); Out.ar(0, snd); }).add; SynthDef("granny3", {arg rate = 1, amp = 1, buffer, startPos = 0, attack = 0.02, release = 0.5, ffreq = 1000, rq = 0.1, panning = 0, delay = 0.3, decay = 1; var snd, env; env = Env.perc(attackTime: attack, releaseTime: release, level: amp).kr(doneAction: 2); snd = PlayBuf.ar( numChannels: 1, bufnum: buffer, rate: rate, startPos: startPos.linlin(0, 1, 0, BufFrames.kr(buffer)) ); snd = snd * env; snd = BPF.ar(snd, ffreq, rq); snd = CombC.ar(snd, maxdelaytime: 2, delaytime: delay, decaytime: decay); snd = Pan2.ar(snd, panning); Out.ar(0, snd); }).add; SynthDef("kick", {arg out = 0, amp = 0.5, sinfreq = 60, glissf = 0.9, att = 0.01, rel = 0.45, pan = 0; var env, snd, ramp; env = Env.perc( attackTime: att, releaseTime: rel, level: amp).kr(doneAction: 2); ramp = XLine.kr( start: sinfreq, end: sinfreq * glissf, dur: rel ); snd = SinOsc.ar( freq: ramp, phase: 0, mul: env, add: 0); snd = Pan2.ar(snd, pan); Out.ar(out, snd); }).add; SynthDef("lowbuild", {arg out = 0, amp = 0.3, sinfreq = 80, glissf = 0.9, att = 0.01, rel = 0.45, pan = 0; var env, snd, ramp; env = Env.pairs([[0,0.05], [8.64, 0.2]], \lin).kr(doneAction: 2); ramp = XLine.kr( start: sinfreq, end: sinfreq * glissf, dur: rel ); snd = Saw.ar( freq: ramp, mul: env, add: 0); snd = Pan2.ar(snd, pan); Out.ar(out, snd); }).add; SynthDef("plucking", {arg amp = 0.1, freq = 440, decay = 5, dampen = 0.1; var env, snd; env = Env.linen(0.5, decay, 0).kr(doneAction: 2); snd = Pluck.ar( in: WhiteNoise.ar(amp), trig: Impulse.kr(0), maxdelaytime: 0.1, delaytime: (freq*2).reciprocal, decaytime: decay, coef: dampen); snd = snd * env; Out.ar(0, [snd, snd]); }).add; SynthDef("sawSynth", { arg freq = 440, amp = 0.1, att = 0.1, rel = 2, lofreq = 100, hifreq = 300000; 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 = Splay.ar(snd); Out.ar(0, snd); }).add; // simple synthdef, no filters or effects, just env and panning control SynthDef("ragebass", {arg rate = 1, amp = 1, buffer, startPos = 0, attack = 0.02, release = 0.5, panning = 0; var snd; snd = PlayBuf.ar( numChannels: 1, bufnum: buffer, rate: rate, startPos: startPos.linlin(0, 1, 0, BufFrames.kr(buffer)) ); snd = snd; snd = Pan2.ar(snd, panning); Out.ar(0, snd); }).add; SynthDef("trump", {arg rate = 1, amp = 1, buffer, startPos = 0, attack = 0.02, panning = 0; var snd, env; snd = PlayBuf.ar( numChannels: 1, bufnum: buffer, rate: rate, startPos: startPos.linlin(0, 1, 0, BufFrames.kr(buffer)) ); snd = snd; snd = Pan2.ar(snd, panning); Out.ar(0, snd); }).add; ) ) // end of SynthDefs // =================================== // Define a bunch of "score snippets" // =================================== ( ~kick1 = Pbind( \instrument, "kick", \midinote, Pseq([1], inf), \amp, Pseq([1.5], inf), \rel, 0.72167044595617, \dur, Pseq([0.72, Rest(0.72), 0.72], inf), \glissf, 0.5 ); ~hihats = Pbind( \instrument, "hihat", \dur, 0.5, \amp, Pseq([0.1, Rest(0.3), 0.3, 0.3], inf), \glissf, 0.2, \rel, 0.05 ); ~clap = Pbind( \instrument, "hihat", \midinote, Pseq([1], 3), \dur, 1, \amp, Pseq([0, 0, 1, 0], inf), \ffreq, 2000, \glissf, 0.2, \rel, 1.5 ); ~lowbuild = Pbind( \instrument, "lowbuild", \sinfreq, Pseq([30], 1), \dur, 8.64, \amp, 0.02, \rel, 8.64, \glissf, 5 ); ~bass1 = Pbind( \instrument, "ragebass", \rate, Pseq([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1], 1), // notice this one ENDS after 4 cycles \amp, 3, \startPos, 0, \attack, 0.55, \release, 0, \buffer, ~ragebass, // which buffer to play from \dur, 2.1420181405896, ); ~trumpdream = Pbind( \instrument, "trump", \rate, Pseq([1], 1), // notice this one ENDS after 4 cycles \amp, 3, \startPos, 0, \attack, 0, \buffer, ~trump, // which buffer to play from \dur, 0, ); ~bass2 = Pbind( \instrument, "ragebass", \rate, Pseq([1], inf), // notice this one ENDS after 4 cycles \amp, 3, \startPos, 0, \attack, 0.55, \release, 0, \buffer, ~ragebass, // which buffer to play from \dur, 2.1420181405896, ); ~melody = Pbind( \instrument, "sawSynth", \freq, Pseq([880, 880, 830.61, 880, 880, 830.61, 554.37], 2), \dur, Pseq([1/4, 1/4, 1/2, 1/4, 1/4, 1/2, 1], 2), \amp, 0.3, \rel, 1/2 ); ~stick1 = Pbind( \instrument, "granny3", \rate, Pseq([2, 4, 2], inf), // notice this one ENDS after 4 cycles \amp, 12, \startPos, Pseq([0], inf), \attack, 0.01, \release, 4, \buffer, ~stick, // which buffer to play from \dur, 4, ); ~melody2 = Pbind( \instrument, "sawSynth", \freq, Pseq([440, 440, 415.30,440, 440, 415.30, 246.94], 2), \dur, Pseq([1/4, 1/4, 1/2, 1/4, 1/4, 1/2, 1], 2), \amp, 0.3, \rel, 1/2 ); ~kick2 = Pbind( \instrument, "kick", \midinote, Pseq([1], inf), \amp, 0.6, \dur, Pseq([1/4, 1/4, Rest(1/2), 1, 1/4, 1/4, Rest(3/2)], inf), \glissf, 0.5 ); ~nono = Pbind( \instrument, "granny3", \rate, Pseq([2, 1.9, 1.8 , 2.5, 4, 4], 1), // notice this one ENDS after 4 cycles \amp, 12, \startPos, Pseq([0.18, 0.55, 0.4], inf), \attack, 0.01, \release, 4, \buffer, ~no, // which buffer to play from \dur, 1, ); ~kanye1 = Pbind( \instrument, "granny3", \rate, Pseq([1.5, 1, 2], 2), // notice this one ENDS after 4 cycles \amp, 12, \startPos, Pseq([0.24, 0.6, 0.4], inf), \attack, 0.01, \release, 4, \buffer, ~kanye, // which buffer to play from \dur, 4, ); ~kanye2 = Pbind( \instrument, "granny3", \rate, Pseq([2, 1.5, 1], 2), // notice this one ENDS after 4 cycles \amp, 12, \startPos, Pseq([0.18, 0.55, 0.4], inf), \attack, 0.01, \release, 4, \buffer, ~kanye, // which buffer to play from \dur, 4, ); ~hihats = Pbind( \instrument, "hihat", \dur, Pseq([Rest(1/2), 1/16, 1/16, 1/16, 1/16,1/16, 1/16,1/16, 1/16, Rest (2)], inf), \amp, 0.3, \glissf, 0, \rel, 0.005 ); ~clap2 = Pbind( \instrument, "hihat", \midinote, Pseq([Rest(1/2), 1/2, Rest(1/2), 1/2], inf ), \dur, 1, \amp, 0.8, \ffreq, 20000, \glissf, 0.2, \rel, 1 ); ) // end of Pbind definitions // ============ // Quick test // ============ ~kick1.play; ~hihats.play; ~clap.play; ~lowbuild.play; ~bass1.play; ~trumpdream.play; ~nono.play; ~bass2.play; ~melody.play; ~melody2.play; ~kanye1.play; // ===================== // Sequencing & playing // using Pspawner // ===================== ( Pspawner({ arg maestro; ~stickplayer = maestro.par(~stick1); maestro.seq(~bass1); ~bassplayer1 = maestro.par(Ppar([~bass2, ~kick1])); "1".postln; maestro.wait(8.64); maestro.seq(~lowbuild); maestro.suspend(~bassplayer1); maestro.suspend(~stickplayer1); maestro.seq(~trumpdream); "dowegethere".postln; maestro.seq(~clap); maestro.wait(2); "howaboutthis".postln; ~beatplayer1 = maestro.par(Ppar([~melody, ~kick2, ~clap2, ~hihats, ~kanye1])); maestro.wait(6); maestro.seq(Ppar([~melody2, ~kanye2])); maestro.seq(Ppar([~melody, ~nono])); maestro.seq(~trumpdream); maestro.suspendAll; }).play )
code description
https://soundcloud.com/user-68447368/trumping-115granular https://drive.google.com/open?id=0B4Ktno3iAlUoQmdqUHJ5cGVlV1k
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