«RaggaTek-000001» by Robert Boyd

on 14 Feb'23 03:46 in
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
51
52
// Raggatek track in SuperCollider

TempoClock.default.tempo = 190/60; // Set the tempo to 190 BPM

// Define the bassline
(
SynthDef(\bassline, {
    arg gate = 1, freq = 60, cutoff = 80, resonance = 0.9, dist = 0.8, amp = 1;
    var env, sound;
    env = Env.adsr(0.01, 0.2, 0.6, 0.2, 0.1);
    sound = Saw.ar(freq) * env;
    sound = LPF.ar(sound, cutoff, resonance);
    sound = Distortion.ar(sound, dist, 0.1);
    sound = sound * amp * gate;
    Out.ar(0, sound);
}).add;
)

// Define the drums
(
SynthDef(\drums, {
    arg gate = 1;
    var sound, env, amp;
    sound = PlayBuf.ar(1, BufRateScale.ir(BufRd.ar(1, Impulse.kr(0.5), 1)), loop: 1, doneAction: 2);
    sound = HPF.ar(sound, 50);
    env = EnvGen.kr(Env.linen(0, 0.05, 0.2, 0.1), gate, doneAction: 2);
    amp = EnvGen.kr(Env.new([0, 1, 0.6, 0], [0.1, 0.1, 0.8], [2, -3, -3]), doneAction: 2);
    sound = sound * env * amp;
    Out.ar(0, sound!2);
}).add;
)

// Play the bassline and drums
(
Pbind(
    \instrument, \bassline,
    \degree, Pseq([0, 0, 7, 7, 9, 9, 7, 5, 5, 4, 4, 2, 2], inf),
    \dur, Pseq([0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], inf),
    \gate, Pseq([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], inf),
    \cutoff, Pseq([80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80], inf),
    \resonance, 0.9,
    \dist, 0.8,
    \amp, 1
).play;
)

(
Pbind(
    \instrument, \drums,
    \gate, Pseq([1, 1, 1, 1, 1, 1, 1, 1], inf),
).play;
)
raw 1490 chars (focus & ctrl+a+c to copy)
reception
comments