-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathChallengeD.rb
More file actions
102 lines (85 loc) · 1.08 KB
/
ChallengeD.rb
File metadata and controls
102 lines (85 loc) · 1.08 KB
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
# DIRECTIONS: Use functions to optimize this code!
use_bpm 136
use_synth :piano
define :bg_notes do |x|
play:E3, amp: x
sleep 1
play:B3, amp: x
play:E4, amp: x
sleep 1
play:B3, amp: x
sleep 1
play:E4, amp: x
sleep 1
end
define :measures_2and8 do
play:E4
sleep 1
play:E5
play:Gs4
sleep 2
play:E5
play:Gs4
sleep 1
end
define :measures_3and4and6 do
play :r
sleep 1
play:E5
play:Gs4
play:B4
sleep 1
play:B4
sleep 1
play:E5
play:Gs4
sleep 1
end
define :measures_5and7 do
play:B4
sleep 0.75
play:As4
sleep 0.25
play:Gs4
play:B4
sleep 0.75
play:Cs5
sleep 0.25
play:B4
sleep 1
play:Gs4
play:E5
sleep 1
end
live_loop:background_notes do
bg_notes 0.25
bg_notes 0.5
bg_notes 0.75
5.times do
bg_notes 1
end
stop
end
# Measure 1
play :r
sleep 1
play:E4
play:Gs4
sleep 2
play:E5
play:Gs4
sleep 1
# Measure 2
measures_2and8
# Measure 3
measures_3and4and6
# Measure 4
measures_3and4and6
# Measure 5
measures_5and7
# Measure 6
measures_3and4and6
# Measure 7
measures_5and7
# Measure 8
measures_2and8