-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrapefruit-honey.rb
179 lines (166 loc) · 4.15 KB
/
grapefruit-honey.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# Grapefruit Honey (v.0.2)
# Procedural dub techno soundtrack for drinking light beer during the summer, by lectronice.
# Live coded while brewing a grapefruit honey flavored beer, refined in a sunny garden.
# Shared under a Creative Commons Attribution-ShareAlike 4.0 International license (CC BY-SA 4.0).
# http://creativecommons.org/licenses/by-sa/4.0/
# http://twitter.com/lectronice
$v = 0 # initialize a variable for varying various stuff
$l = 1 # 1 loop = 64 variations
$d = 3 # track duration, in loops
live_loop :beat do
$s = choose([1, 2, 3, 4]) # choose the duration of release and sleep values across the whole track
puts "///// release/sleep", $s
sleep $s
$v += 1
if $v > 64
$l += 1
$v = 0
end
puts "///// loop ", $l, "/ variation", $v
puts "/////", vt, "seconds"
if vt > 60 then puts "/////", vt/60, "minutes" end
end
live_loop :beer do
if $l <= $d
with_fx :reverb do
with_fx :echo,
phase: choose([0.25, 0.5, 0.75]),
mix: rrand(0.6, 1) do
with_fx :wobble,
smooth: rrand(0, 0.5),
probability: 0.5,
prob_pos: 0.5,
mix: rrand(0.5, 1) do
use_synth :fm
play_pattern_timed [
(chord choose([:c3, :g3]), :major),
(chord choose([:d3, :f3]), :major),
(chord choose([:e3, :e3]), :major),
(chord choose([:f3, :d3]), :major),
(chord :c4, :major),
:r],
choose([[$s , $s/2, $s+$s/2, $s],
[$s/2, $s*2, $s/2 , $s],
[$s*2, $s*2]]),
release:
choose([$s , $s , $s*2 , $s*4]),
pan: rrand(-0.4, 0.4),
cutoff: rrand(80, 100),
depth: rrand(1, 2)
end
end
end
else
sleep 8
end
end
live_loop :bass do
if $v >= 16 and $l <= $d
with_fx :slicer,
phase: choose([0.25, 0.5, 0.75]),
mix: rrand(0.3, 0.5) do
with_fx :echo,
phase: choose([0.25, 0.5, 0.75, 1]),
mix: choose([0, 0.25, 0.5]) do
use_synth :fm
if one_in(2)
play_pattern_timed [
:e2, :f2, :g2, :e2, :f2, :r],[
1 , 1 , 2.5, 0.5, 1 , 2]
else
play_pattern_timed [
:e2, :f2, :g2, :e2, :g2, :f2],[
1 , 1 , 2.5, 0.5, 1.5, 0.5]
end
end
end
else
sleep 8
end
end
live_loop :drums do
if $v >= 4 and $l <= $d
with_fx :echo,
phase: choose([0.25, 0.5]),
mix: choose([0, 0, 0, 0.25]) do
sample :bd_fat,
amp: 2
sleep 1
sample :bd_fat
sleep 1
sample :bd_fat,
amp: 2
sleep 1
if one_in(4)
sleep $s
else
sample :bd_fat
sleep 0.75
sample :bd_fat
sleep 0.25
end
end
end
sleep 8
end
live_loop :cymbals do
if $v >= 8 and $l <= $d
if one_in(8)
sleep $s
else
if one_in(3)
4.times do
with_fx :echo,
phase: choose([0.25, 0.5, 0.75]),
mix: choose([0, 0.25, 0.5]) do
sleep 0.5
sample :drum_cymbal_closed,
attack: choose([0.03, 0.05, 0.1]),
release: 0.1,
pan: rrand(-0.4, 0.4),
amp: rrand(0.5, 1.5)
sleep 0.5
end
end
else
4.times do
with_fx :echo,
phase: choose([0.25, 0.5, 0.75]),
mix: choose([0, 0.25, 0.5]) do
sleep 1.5
sample :drum_cymbal_closed,
attack: choose([0.03, 0.05, 0.1]),
pan: rrand(-0.4, 0.4),
amp: rrand(0.5, 1.5)
sleep 1.5
end
end
end
end
else
sleep 8
end
end
live_loop :snare do
if $v >= 32 and $l <= $d
with_fx :echo,
phase: choose([0.25, 0.5, 0.75]),
decay: $s,
mix: choose([0.25, 0.5, 1]) do
if one_in(4)
sample :elec_lo_snare,
amp: rrand(0.1, 0.4),
pan: rrand(-0.2, 0.2)
if one_in(2)
sleep $s/2
sample :elec_lo_snare,
amp: rrand(0.1, 0.4),
pan: rrand(-0.2, 0.2)
end
end
sleep 8
end
else
sleep 8
end
end