-
Notifications
You must be signed in to change notification settings - Fork 4
/
pbass.scd
52 lines (38 loc) · 1.44 KB
/
pbass.scd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
(
//https://sccode.org/1-4YY
SynthDef(\pbass, {
arg out = 0, pan = 0, freq = 200;
var subfreq = freq / 2;
// Envelopes
var subenv = EnvGen.kr(Env.perc(0, 1), doneAction:2);
var env = EnvGen.kr(Env.perc(0, 0.5));
// Component synthesis
var pluck = Pluck.ar(PinkNoise.ar, 1, 0.2, subfreq.reciprocal) * subenv * 2;
var tri = VarSaw.ar(freq) * env;
var sin = SinOsc.ar(freq) * env;
var sub = (SinOsc.ar([subfreq, subfreq - 2, subfreq + 2]).sum * subenv).tanh;
var click = RLPF.ar(Impulse.ar(0), [2000, 8000], 1).sum * 1000;
// Initial signal
var sig = pluck + tri + sub + click;
// Resonant LPFs
sig = RLPF.ar(sig, XLine.ar(freq * 100, freq * 10, 0.15));
sig = sig + (MoogFF.ar(sig, freq * 20, 2.5) * 0.1);
// EQ resulting signal
sig = BPeakEQ.ar(sig, 400, 0.5, -9);
sig = BPeakEQ.ar(sig, 2000, 0.5, 6);
sig = BHiShelf.ar(sig, 8000, 1, 3);
sig = BPeakEQ.ar(sig, 200, 1, 3);
// Apply another envelope to dampen a bit more
sig = sig * XLine.kr(1, 0.6, 0.1);
// Tanh distortion / limiting
sig = (sig * 1).tanh;
// Another round of signal coloring, using another RLPF
// and sine components
sig = sig + RLPF.ar(sig, XLine.ar(freq * 100, freq * 10, 0.15)) + sin + sub;
// Another round of tanh distortion / limiting
sig = (sig / 2.3).tanh;
// Another resonant LPF
sig = MoogFF.ar(sig, XLine.ar(freq*150, freq*30, 0.1), 0.1);
OffsetOut.ar(out, DirtPan.ar(sig, ~dirt.numChannels, pan, env));
}).add;
)