-
Notifications
You must be signed in to change notification settings - Fork 0
/
drums.synth
48 lines (39 loc) · 1.9 KB
/
drums.synth
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
# This patch demonstrates some basic drums using pinged filters
# Define a clock based on a 48hz sine wave. Sequencers expect a
# 24 PPQ clock signal so this gives us a 120 BPM clock.
clock=Sine(2*24)
# Define three sequencers playing a standard drum pattern
# Everything inside the {}s is the loop. The (clock) at
# the end connects our clock node above to the input
# of the sequence.
# The pattern notation here is that 1s are hits and ~s are rests.
# Groups inside []s occupy a single beat, which makes them
# 1/8 notes in this example.
hihat_pattern=Seq{[1 1] [1 1] [1 1] [1 1]}(clock)
snare_pattern=Seq{~ 1 ~ 1}(clock)
kick_pattern=Seq{[1 1] ~ 1 ~}(clock)
# Define a node to which we can send our pre-effects signals
send=StereoIdentity
# Define the hi-hat sound. It consists of a resonant bandpass
# filter being fed enveloped noise with the envelope triggering
# based on the hihat_pattern sequencer
hihat=Bp(300, 0.98, Noise(1000)*Ad(0.01, 0.05, Bg(0.9, hihat_pattern|1)))^2
# Connect the output of the hihat node to the 0th and 1st inputs of
# the send node.
(send, 0, hihat*0.05)
(send, 1, hihat*0.05)
# Similar to the hihat sound but with some additional noise to make it a snare
snare=Bp(160, 0.9, Noise(1000)*Ad(0.01, 0.01, snare_pattern|1))+Noise(5000*Rescale(0.1,1, Ad(0.05, 0.05, snare_pattern|1)))*(Ad(0.001, 0.14, snare_pattern|1)^2)*0.05
(send, 0, snare)
(send, 1, snare)
# Similar to the other drums but energized by a saw wave rather than
# a noise pulse to give it a cleaner sound and with an additional
# high-pass to cut out some of the intense low end.
kick=Hp(100, 0, Bp(80, 0.97, Saw(100)*Ad(0.01, 0.01, kick_pattern|1)))
(send, 0, kick)
(send, 1, kick)
# Pass the signal accumulated in the send node into a short reverb.
reverb=Reverb(0.1, 0.9, send|0, send|1)
# Mix the dry send with the reverb and connect the result to the output.
(output, 0, reverb|0*0.3 + send|0)
(output, 1, reverb|1*0.3 + send|1)