hysysk:old

this blog will not be updated.

日曜日, 4月 30, 2006

Bach Invention Invasion

日本三大SCサイトでおなじみSuperCollider in Saitamamoxuse君
ノートナンバーにしてくれたものを元に作りました。
まず//instruments以下を実行して楽器を作ってくださいね。
あとBPMも114で。
プログラムだけ配るレーベルやりたい。

//structure
Tempo.bpm=114;
(
Pbind(
\instrument, \mil2,
\amp, 0.8,
\note,
Pseq([
\,4,9,12,11,4,11,14,12,16,8,16,9,4,9,12,11,4,11,14,12,9,
16,12,16,9,12,4,7,5,9,14,17,14,11,14,7,11,2,5,4,7,12,16,
12,9,12,5,14,11,7,11,4,12,9,5,9,2,11,12,7,12,16,14,7,14,17,16,19,11,19,
12,7,12,16,14,7,14,17,16,12,19,16,
24,21,16,21,12,16,9,12,14,18,21,24,
23,19,14,19,11,14,7,11,12,16,19,23,
21,18,15,18,11,15,6,9,7,19,
16,12,16,9,18,14,11,14,7,16,12,9,12,6,19,18,16,15,18,11,15,16,
19,22,19,16,19,13,16,19,16,13,16,9,
17,20,17,14,17,11,14,17,14,11,14,7,
16,19,16,12,16,9,12,15,12,9,12,6,
14,17,14,11,14,8,11,14,11,8,11,4,
4,9,12,11,4,11,14,12,9,8,4,
9,12,16,12,9,12,6,9,12,9,6,9,3,12,11,9,8,11,14,11,8,11,
2,5,8,5,2,5,-1,5,4,2,0,4,9,4,0,4,-3,0,3,0,-3,0,-6,0,-1,-3,-4,11,8,4,
4,9,12,11,4,11,14,12,9,12,16,14,11,14,17,16,12,16,19,17,16,14,12,11,
12,14,16,17,14,20,14,23,14,12,21,17,14,11,14,8,11,12,9,4,9,11,8,9,4,0,4,-3
]+12,1),

\dur,
Pseq([
1,1,1,1,1,1,1,1,2,2,2,2,1,1,1,1,1,1,1,1,2,7,
1,1,1,1,1,1,1,2,2,2,3,1,1,1,1,1,1,1,2,2,2,3,
1,1,1,2,3,1,1,1,2,3,1,1,1,2,2,9,1,1,1,1,1,1,1,2,2,2,2,
1,1,1,1,1,1,1,1,2,2,2,2,
1,1,1,1,1,1,1,1,2,2,2,2,
1,1,1,1,1,1,1,1,2,2,2,2,
1,1,1,1,1,1,1,1,2,3,
1,1,1,2,3,1,1,1,2,3,1,1,1,1,1,1,1,1,1,1,1,9,
1,1,1,1,1,1,1,1,1,1,1,5,
1,1,1,1,1,1,1,1,1,1,1,5,
1,1,1,1,1,1,1,1,1,1,1,5,
1,1,1,1,1,1,1,1,1,1,1,5,
1,1,1,1,1,1,1,2,2,2,2,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,3,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,12
]/4,1)
).play;

Pbind(
\instrument, "mil3",
\amp, 0.2,
\note,
Pseq([
-3,9,8,9,4,9,12,11,4,11,14,12,9,8,4,
9,4,9,12,11,4,11,14,12,9,12,9,
14,9,5,9,2,5,-3,0,-1,2,7,11,
7,4,7,0,4,-5,-1,-3,0,2,5,-1,2,-5,-1,0,4,
-2,0,-7,-10,-5,7,5,7,0,7,12,16,14,7,14,17,16,12,11,7,
12,7,12,16,14,7,14,17,16,12,
19,16,19,12,16,7,11,9,12,16,19,
18,21,14,18,9,14,6,9,7,11,14,18,
16,19,12,16,7,12,4,7,6,9,11,15,
16,12,16,9,12,16,19,18,14,11,14,7,11,14,18,16,12,9,12,6,9,12,
11,12,9,11,-1,4,16,11,7,4,-1,-5,-1,-8,4,7,10,1,
19,17,16,14,2,5,8,-1,
17,16,14,12,0,4,6,-3,
16,15,13,11,-1,2,5,-4,
14,12,11,12,9,8,4,
9,4,9,12,11,4,11,14,
12,16,21,16,12,16,9,12,6,9,12,9,6,9,3,6,
4,8,11,8,4,-1,-4,-8,
-3,0,4,0,-3,0,-9,
11,8,4,2,11,8,2,0,
4,-4,4,-3,6,-1,8,0,
9,2,10,8,5,2,-1,-4,
-3,-10,-8,-7,-9,-8,4,-3
]+12,1),

\dur,
Pseq([
2,4,2,1,1,1,1,1,1,1,1,2,2,2,2,
1,1,1,1,1,1,1,1,2,2,2,2,
1,1,1,1,1,1,1,1,2,2,2,3,
1,1,1,1,1,1,1,2,2,1,1,1,1,2,2,1,1,
1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,
1,1,1,1,1,1,1,1,2,7,
1,1,1,1,1,1,1,2,2,2,2,
1,1,1,1,1,1,1,1,2,2,2,2,
1,1,1,1,1,1,1,1,2,2,2,3,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,
1,1,1,2,2,1,1,1,1,1,1,1,1,2,2,2,2,5,
1,1,1,2,2,2,2,5,
1,1,1,2,2,2,2,5,
1,1,1,2,2,2,2,5,
1,1,1,2,2,2,2,
1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,
2,2,2,2,2,2,5,
1,1,1,1,1,1,1,2,
2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,24
]/4,1)
).play;

Pbind(
\instrument, "riz2",
\freq, Pseq([Pseq([500,\r,2000,\r], 2),Pseq([50,7000,\r,\r], 2),Pseq([100,\r,5000,2000,5000,\r,\r,\r],1)], 10),
\dur,
Pseq([
1,1,1,1
],25),
\amp,0.3,\rez,0.3,\pan,Pfunc({1.0.rand2})
).play;

Pbind(
\instrument, "kk",
\freq, Pseq([Pseq([80,\r,\r,\r,\r,\r,\r,\r], 6),Pseq([80,\r80,60,\r], 2),Pseq([60,60,\r,\r,50,\r,\r,\r],1)], 10),
\dur,
Pseq([
1,1,1,1
]/2,49),
\amp,0.3
).play;

Pbind(\instrument, "glit1",
\amp, 0.8,
\freq, Pseq([Pseq([3000,4000,\r,\r], 6),Pseq([\r,5000,2000,\r,4000,8000,7000,\r],1)], 9),
\dur,
Pseq([
1,1,1,1
]/4,94),
\pan,Pfunc({1.0.rand2})).play;

Pbind(\instrument, "particles",
\amp, 0.9,
\freq, Pseq([Pseq([8000,2000,\r,\r], 5),Pseq([\r,100,200,\r,400,7000,\r],2),Pseq([\r,1000,\r,\r,400,\r,70],1)], 10),
\dur,
Pseq([
1,1,1,1
]/2,48),
\pan,Pfunc({1.0.rand2})).play;

d=Synth.after(1, "reverb");
)

//instruments
(
(
SynthDef("glit1",{arg freq, pan=0, amp=0.2;
var randfreq,mixer;
mixer=Mix.new({randfreq = rrand(500, freq);
SinOsc.ar(randfreq,
mul: EnvGen.kr(Env.perc(0.01, 500/randfreq),
Dust.kr(0.1), 0.2,doneAction:2))
});
Out.ar(0,Pan2.ar(mixer,pan,amp))
}).send(s)
);

(
SynthDef("particles", {arg freq=80, amp=0.5, pan=0;
var src, env, fil;
src=Dust2.ar(freq, amp);
env=EnvGen.kr(Env.new([0,0.5,0.8,0],[0.02,0.3,0.02],'sine'),doneAction:2);
fil=HPF.ar(src*env, 3000);

Out.ar(0, Pan2.ar(fil,pan))
}).store;
);

(
SynthDef(\riz2, { arg out,freq=1200,amp=0.5,cut=3000,rez=0.1,pan=0;
var src,env,fil;
src=SinOsc.ar(XLine.kr(freq*5,freq,0.2),0,amp).abs+ClipNoise.ar(0.05);
env=EnvGen.kr(Env.perc(0.1,0.4,amp),doneAction:2);
fil=RLPF.ar(src*env,cut,rez);
Out.ar(out,Pan2.ar(fil,pan));
}).send(s)
);

(
SynthDef("mil2",{ arg out,freq=440,gate=1,amp=0.4,pan=0;
var src,env,fil;
src=SinOsc.ar(freq);
env=EnvGen.kr(Env.adsr(0.01,1.5,0.3,4,0.6),gate,doneAction:2);
fil=RHPF.ar(src*env,3000,0.5,amp);
Out.ar(out,Pan2.ar(fil,pan,amp));
}).store;
);

(
SynthDef("mil3",{ arg out,freq=440,gate=1,amp=0.4,pan=0;
var src,env,fil;
src=SinOsc.ar(freq);
env=EnvGen.kr(Env.perc(0.05,0.6,0.8),gate,doneAction:2);
fil=RLPF.ar(src*env,3000,0.1,amp);
Out.ar(out,Pan2.ar(fil,pan,amp));
}).store;
);

(
SynthDef("kk",
{arg out=0,freq=80,amp=0.5,tbeat=0.5,fbeat=2;
var src,env;
src=FSinOsc.ar(XLine.kr(500,freq,0.05),0,amp);
env=EnvGen.kr(Env.perc(0.05,0.25),doneAction:2);
Out.ar(out,Pan2.ar(src*env,0));
}).send(s);
);

(
SynthDef("reverb", { arg out=0, decay=0.8, wet=0.1, gate=1;
var zout, env;
zout = In.ar(out);
env = Linen.kr(gate, 0.1, 1, 0.1);
8.do({ zout = AllpassN.ar(zout, 0.1, {Rand(0.01,0.05)}.dup, decay)});
XOut.ar(out, wet * env, zout);
FreeSelfWhenDone.kr(env);
}).send(s);
)
)