-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathDrum Pattern Demo
More file actions
37 lines (32 loc) · 819 Bytes
/
Drum Pattern Demo
File metadata and controls
37 lines (32 loc) · 819 Bytes
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
#Drum patterns
#Coded by Davids Fiddle
#Samples to use
kick = :drum_bass_hard
snare = :drum_snare_hard
hat = :drum_cymbal_closed
#Patterns
#Kick:
pat_kick = [
(bools 1,0,0,0,1,0,0,0), #Section 0
(bools 1,0,0,1,0,1,0,0) #Section 1
] #Extend to add more sections
#Snare
pat_snare = [
(bools 0,0,1,0,0,0,1,0),
(bools 0,0,1,0,0,0,1,0)
]
#Hihat:
pat_hat = [
(bools 1,1,1,1,1,1,1,1),
(bools 1,1,1,1,1,1,1,1)
]
#Copy and adapt for more samples
#Section Pattern:
sections = (ring 0,0,0,1).stretch(8) #stretch should have the pattern length as parameter, otherwise weird things will happen
live_loop :play_patterns do
tick
sample hat if pat_hat[sections.look].look
sample kick if pat_kick[sections.look].look
sample snare if pat_snare[sections.look].look
sleep 0.25
end