Skip to content

Instantly share code, notes, and snippets.

@44kwm20
Created August 14, 2011 23:34
Show Gist options
  • Save 44kwm20/1145458 to your computer and use it in GitHub Desktop.
Save 44kwm20/1145458 to your computer and use it in GitHub Desktop.
SuperCollider study 110810
(
(SynthDef(\aaaa,{
arg gate=1,freq,amp=1,de,atk=2,rls=2,bus;
var mix,osc1;
var env1;
osc1 = FSinOsc.ar(freq+({Rand(-1*de,de)}!2));
env1 = EnvGen.kr(
Env([0,1,1,1,0],[atk,0,0,rls],[2,1,1,-2],3),gate,doneAction:2);
mix = osc1 * env1 * amp;
Out.ar(bus,mix*0.15);
}).add;
);
(SynthDef(\bbbb,{
arg gate=1,freq,amp=1,bus;
var mix,osc1;
var env1;
osc1 = MoogFF.ar(WhiteNoise.ar,freq+({Rand(-3,3)}!2),3.5);
env1 = EnvGen.kr(
Env([0,1,0,0],[0.01,6,0.1],[2,-4,-4],2),gate,doneAction:2
);
mix = osc1 * env1 * amp;
Out.ar(bus,mix*1.0);
}).add;
);
(SynthDef(\eff01,{
arg bus;
var in,com,mix;
in = In.ar(bus,2);
com = CombL.ar(in,3,3,10);
mix = (in*0.6) + (com*0.4);
Out.ar(0,mix);
}).add;
);
(SynthDef(\eff02,{
arg bus;
var in,local,mix;
in = In.ar(bus,2);
local = (LocalIn.ar(2)*0.7) + [in[0],0];
local = DelayN.ar(local,2,2);
mix = (in*0.5) + (local*0.5);
LocalOut.ar(local.reverse);
Out.ar(0,mix);
}).add;
);
)
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
(
var bpm = 60;
var oscG,effG,eff1,eff2;
var bus1,bus2;
var p01,p02,p03,p04,p05,p06,n01;
TempoClock.default.tempo = bpm/60;
bus1 = Bus.audio(s,2);
bus2 = Bus.audio(s,2);
oscG = Group.head(s);
effG = Group.after(oscG);
eff1 = Synth.head(effG,\eff01,[\bus,bus1.index]);
eff2 = Synth.head(effG,\eff02,[\bus,bus2.index]);
p01 = Pbind(\de,4,\instrument, \aaaa,\dur, 4,
\degree, Prand([0,2,3,4,6],inf),\amp,0.8,\bus,bus1.index);
p02 = p01;
p03 = Pbindf(p01,\octave,3,\degree, Prand([-1,0,2,3,4],inf),\amp,0.8,\stretch,2,\de,0);
p04 = Pbindf(p01,\mtranspose,3,\amp,0.8,\atk,1);
p05 = Pbindf(p01,\mtranspose,8,\amp,0.6,\de,6);
p06 = Pbindf(p01,\mtranspose,13,\amp,Pwrand([0,0.2],[0.7,0.3],inf),
\delta,4,\sustain,0.5,\atk,0.5,\rls,2,\de,0);
n01 = Pbind(\instrument, \bbbb, \tg , 1,
\degree,Pseq([Pseq([\],1),Pseq([-7,0],inf)],1),
\octave,7,\amp,Pseq([0.3,1.0],inf),\dur,16,\bus,bus2.index);
Pchain(Ppar([p01,p02,p03,p04,p05,p06,n01]),
Pbind(\group, oscG)
).play
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment