74 lines
1.5 KiB
Python
74 lines
1.5 KiB
Python
|
( // Init some shit
|
||
|
t = TempoClock(120/60);
|
||
|
~reverbBus = Bus.audio(s,2);
|
||
|
~srcGrp = Group.new;
|
||
|
~fxGrp = Group.after(~srcGrp);
|
||
|
~reverb = Synth.new(\reverb, [\in, ~reverbBus], ~fxGrp);
|
||
|
)
|
||
|
|
||
|
(
|
||
|
SynthDef.new(\reverb, {
|
||
|
arg in, out=0, mix=0.6, room=0.8, damp=0.1;
|
||
|
var sig;
|
||
|
sig = In.ar(in, 2);
|
||
|
sig = FreeVerb2.ar(sig[0], sig[1], mix, room, damp);
|
||
|
Out.ar(out,sig);
|
||
|
}).add;
|
||
|
)
|
||
|
|
||
|
( //reset fx
|
||
|
~fxGrp.freeAll;
|
||
|
~reverb = Synth.new(\reverb, [\in, ~reverbBus], ~fxGrp);
|
||
|
)
|
||
|
|
||
|
(
|
||
|
SynthDef.new(\bell, {
|
||
|
arg freq=440, rel=0.6, amp=0.3, pan=0, gate=1, out=0,
|
||
|
atk=0.01, dec=0.4, sus=0;
|
||
|
var sig, env;
|
||
|
env = EnvGen.kr(Env.new([0,1,0], [atk,rel], [1,-1]), gate, doneAction:2);
|
||
|
sig = Pan2.ar(SinOsc.ar(freq) * env * amp, pan);
|
||
|
Out.ar(out,sig);
|
||
|
}).add;
|
||
|
)
|
||
|
|
||
|
(
|
||
|
SynthDef.new(\pad, {
|
||
|
arg freq=440, rel=1, amp=0.3, pan=0, gate=1, out=0,
|
||
|
atk=1, dec=0.5, sus=0;
|
||
|
var sig, env;
|
||
|
env = EnvGen.kr(Env.adsr(atk, dec, sus, rel, amp), gate, doneAction:2);
|
||
|
sig = Pan2.ar(Saw.ar(freq) * env * amp, pan);
|
||
|
Out.ar(out,sig);
|
||
|
}).add
|
||
|
)
|
||
|
|
||
|
|
||
|
Env.new([0,1,0], [0.01,3], [1,1.5]).plot
|
||
|
|
||
|
|
||
|
|
||
|
(
|
||
|
~bells = Pbind (
|
||
|
\instrument, \bell,
|
||
|
\dur, Pseq([1, 2, 1], inf, 0),
|
||
|
\midinote, Prand(Scale.minor.degrees + 60, inf),
|
||
|
\amp, 0.5,
|
||
|
\out, ~reverbBus,
|
||
|
\group, ~srcGrp,
|
||
|
).play;
|
||
|
)
|
||
|
~bells.stop;
|
||
|
|
||
|
(
|
||
|
~pad = Pbind (
|
||
|
\instrument, \pad,
|
||
|
\dur, Pseq([1, 2, 1], inf, 0),
|
||
|
\midinote, Prand(Scale.minor.degrees + 60, inf),
|
||
|
\amp, 0.5,
|
||
|
\out, ~reverbBus,
|
||
|
\group, ~srcGrp,
|
||
|
).play;
|
||
|
)
|
||
|
~pad.stop;
|