Code-Example (30-sex-peace)
The following code shows the synth definition for the piece „30-sex-peace“ in SuperCollider:
(
SynthDef(\thirtysex, {
arg rate = 10, lag = 0.0005;
var sig, env;
var freq, mul, bandwidth;
var pan;
var lo = 24, hi = 120;
env = EnvGen.ar(
Env(
[5, 30, 100, 500, 100, 20, 2],
[8, 7, 3, 3, 7, 2],
\lin
),
doneAction: 2
);
freq = Demand.ar(
Impulse.ar(rate * env),
0,
Dwhite.new(lo, hi)
).midicps;
mul = Demand.ar(
Impulse.ar(rate * env),
0,
Dwhite.new(0, 1.0)
);
pan = Demand.ar(
Impulse.ar(rate * env),
0,
Dwhite.new(-1, 1.0)
);
bandwidth = Demand.ar(
Impulse.ar(rate * env),
0,
Dwhite.new(0.1, 1.1)
);
sig = Resonz.ar(
SinOsc.ar(
freq.lag(lag), 0, mul.lag(lag)
),
freq.lag(lag),
bandwidth.lag(lag),
mul.lag(lag)
).lag(lag);
sig = HPF.ar(
sig,
XLine.ar(30, 14000, 30, doneAction: 2)
);
sig = Limiter.ar(sig);
Out.ar(
0,
Pan2.ar(
sig,
pan.lag(lag)
).lag(lag)
);
}).add;
)