-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelpmusic.rb
111 lines (92 loc) · 2.21 KB
/
helpmusic.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
106
107
108
109
110
111
set :bpm, 140
set :beats, 4
set :sub_beat, 2
set :start_beats, true
set :chords, [
(chord :B, :minor7), (chord :B, :minor7),
(chord :Fs,:minor7), (chord :Fs,:minor7),
(chord :E, :minor7), (chord :E, :minor7),
(chord :G, :major7), (chord :Fs,:dom7),
(chord :B, :minor7), (chord :B, :minor7),
(chord :Fs,:minor7), (chord :Fs,:minor7),
(chord :E, :minor7), (chord :E, :minor7),
(chord :G, :major7), (chord :Fs,:dom7),
(chord :B, :minor7), (chord :B, :minor7),
(chord :G, :major7), (chord :G, :major7),
(chord :E, :minor7), (chord :Fs,:dom7),
(chord :B, :minor7), (chord :Fs,:dom7)
].ring
# ---- instruments
# latin clave on 2 bars
define :keys_latin_2_bar_4 do | ch, br, am=1, sy=:fm |
use_synth sy
if br % 2 == 0 then
play ch, amp: am, release: 0.2
sleep 1
play ch, amp: am, release: 0.2
sleep 1.5
play ch, amp: am, release: 0.2
sleep 1
play ch, amp: am, release: 0.2
else
sleep 0.5
play ch, amp: am, release: 0.2
sleep 1
play ch, amp: am, release: 0.2
end
end
# latin bass, 4 beats per bar
define :bass_latin_beat_4 do | ch, am=1, sy=:blade |
use_synth sy
use_octave -2
play ch[0], release:0.2, amp: 2 * am
sleep 1.5
play ch[2], release:0.2, amp: am
sleep 0.5
play ch[2], release:0.2, amp: am
sleep 1.5
play ch[2], release:0.2, amp: am
#sleep 0.5
end
# hi hat on sub beat
define :drums_cymbals_sub_beat do | sb=4, am=1|
sample :drum_cymbal_closed, amp: 0.5 * am
(sb - 1).times do
sleep 1/Float(sb)
sample :drum_cymbal_closed, amp: 0.25 * am
end
#sleep 1/sb
end
# binary beat, 4 beats per bar
define :drums_binary_beat_4 do | am=1|
sample :drum_bass_hard, amp: am
sleep 1
sample :drum_snare_hard, amp: am
sleep 0.5
sample :drum_bass_hard, amp: am
sleep 0.5
sample :drum_bass_hard, amp: am
sleep 1
sample :drum_snare_hard, amp: am
#sleep 1
end
# ---- live loops
use_bpm get(:bpm)
live_loop :keys do
br, ch = (sync :bar)
keys_latin_2_bar_4 ch, br
end
live_loop :bass do
ch = (sync :bar)[1]
bass_latin_beat_4 ch, 1.25
end
live_loop :cymbals do
sync :beat
drums_cymbals_sub_beat sb = get(:sub_beat), 0.5
end
live_loop :drums do
sync :bar
drums_binary_beat_4 0.1
end
# ---- cues
cue :start