-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcode.rb
105 lines (95 loc) · 1.64 KB
/
code.rb
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
use_bpm 175
amp_bass = 1.5
amp_hi = 0.5
amp_kick = 1
amp_melody = 1.2
amp_pad = 0.7
#Bass
in_thread do
use_synth :chiplead
24.times do
play_pattern_timed [:a2,:a2,:c3,:d3,:a2,:a2,:g2,:gs2],
[1.5,1.5,1,1,1.5,1.5,1,1],
sustain: 0.5, release: 0.5, amp: amp_bass, pan: 0.51
end
end
define :wash do
10.times do
play :a3, release: 0.1, attack: 0.05, sustain: 0.1, amp: amp_hi, pan: 0.49
sleep 0.5
end
end
define :kick do
sample :drum_bass_hard
sleep 1.5
sample :drum_bass_hard
sleep 1.5
sample :drum_bass_hard
sleep 1
sample :drum_bass_hard
sleep 1
end
#Drums
in_thread do
use_synth :noise
24.times do
wash
end
4.times do
kick
end
16.times do
wash
end
4.times do
kick
end
end
define :melody1 do
play_pattern_timed [:c4,:a3,:e3,:c4,:a3,:ds3,
:c4,:a3,:d3,:c3,:d3],
[0.5,0.5,4,0.5,0.5,4,
0.5,0.5,4,0.5,0.5],
amp: amp_melody
sleep 4
play_pattern_timed [:c3,:a2,:gs3,:c3,:a2,:g3,
:c3,:a2,:fs3,:f3,:e3],
[0.5,0.5,4,0.5,0.5,4,
0.5,0.5,4,0.5,0.5],
amp: amp_melody
sleep 4
end
define :melody2 do
play_pattern_timed [:a2,:a2,:c3,:d3,:a2,:a2,:g2,:gs2],
[1.5,1.5,1,1,1.5,1.5,1,1],
sustain: 0.5, release: 0.5,amp: amp_melody
end
#Melody
in_thread do
sleep 40
use_synth :blade
2.times do
melody1
end
2.times do
melody2
end
2.times do
melody1
end
2.times do
melody2
end
end
#Pad
in_thread do
use_synth :fm
sleep 20
play_pattern_timed [:a3,:a2,:a3,:a2],[5,5,5,5],
amp: amp_pad, cutoff: 100
sleep 100
4.times do
play_pattern_timed [:a3,:a2,:a3,:a2],[5,5,5,5],
amp: amp_pad, cutoff: 100
end
end