-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfor_nomad.rb
345 lines (304 loc) · 7.29 KB
/
for_nomad.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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# Path definitions
oboe = "~/devel/musicode/samples/Oboe"
flutes = "~/devel/musicode/samples/Flutes"
violins = "~/devel/musicode/samples/Violins"
piccolo = "~/devel/musicode/samples/Piccolo"
basses = "~/devel/musicode/samples/Basses"
bass_trombone = "~/devel/musicode/samples/BassTrombone"
# Initial tempo - faster base tempo
use_bpm 96
# Movement 1: "Allegro con Spirito"
define :movement_one do
puts "Movement 1: Allegro con Spirito begins"
# Opening - Majestic and bold
in_thread do
with_fx :reverb, room: 0.7, mix: 0.4 do
# Strong opening statement
2.times do
use_bpm 96
sample bass_trombone, "bass_trombone-e2",
amp: 0.6,
attack: 0.1,
release: 1.0
sample basses, "basses-sus-c2",
amp: 0.5
sleep 2
end
# Main theme - Violins with bass support
4.times do |i|
use_bpm(i < 2 ? 96 : 102) # Subtle acceleration
# Principal theme
["violin-e4", "violin-g4", "violin-c5", "violin-a4"].each do |note|
sample violins, note,
amp: 0.5,
attack: 0.1,
release: 0.8
# Bass accompaniment
sample basses, "basses-piz-rr1-c2",
amp: 0.4,
release: 0.5 if i % 2 == 0
sleep 2
end
# Response with increased energy
use_bpm(i < 2 ? 98 : 104)
["violin-c5", "violin-e5", "violin-g4", "violin-e4"].each do |note|
sample violins, note,
amp: 0.45 + (i * 0.1),
attack: 0.1,
release: 0.6
sleep 1
end
end
end
end
# Bass trombone counterpoint
in_thread do
sleep 16 # Wait for main theme
use_bpm 98
4.times do
sample bass_trombone, "bass_trombone-g2",
amp: 0.4,
attack: 0.2,
release: 2.0
sleep 4
sample bass_trombone, "bass_trombone-c3",
amp: 0.45,
attack: 0.2,
release: 1.5
sleep 4
end
end
# Flute counterpoint with dramatic changes
in_thread do
use_bpm 96
with_fx :reverb, room: 0.8 do
8.times do |i|
# Sudden piano section
use_bpm(i == 4 ? 80 : 96) # Dramatic slowdown in middle
sample flutes, "flutes-stc-rr1-c4",
amp: i == 4 ? 0.3 : 0.4, # Softer in middle
attack: 0.1,
release: 0.8
sleep 2
# Return to tempo
use_bpm 96
sample flutes, "flutes-stc-rr1-e4",
amp: 0.4,
attack: 0.2,
release: 1.5
sleep 4
end
end
end
sleep 48
end
# Movement 2: "Andante con Brio"
define :movement_two do
puts "Movement 2: Andante con Brio begins"
use_bpm 88
# Bass introduction
in_thread do
with_fx :reverb, room: 0.9 do
sample basses, "basses-sus-c2",
amp: 0.5,
attack: 0.3,
release: 3.0
sleep 4
end
end
# Main theme - Oboe with bass support
in_thread do
with_fx :reverb, room: 0.8, mix: 0.5 do
3.times do |i|
use_bpm(88 + (i * 2)) # Gradual acceleration
2.times do
sample oboe, "oboe-e4",
amp: 0.5,
attack: 0.2,
release: 2.0
sample basses, "basses-sus-c2",
amp: 0.4
sleep 4
sample oboe, "oboes-c4",
amp: 0.45,
attack: 0.2,
release: 1.8
sleep 4
end
# Dramatic bridge passage
use_bpm 85 # Slight ritardando
sample oboe, "oboe-e5",
amp: 0.4,
attack: 0.3,
release: 2.5
sample bass_trombone, "bass_trombone-e2",
amp: 0.5
sleep 4
end
end
end
# Violin accompaniment
in_thread do
6.times do
["violin-c4", "violin-g4", "violin-e4", "violin-a4"].each do |note|
sample violins, note,
amp: 0.35,
attack: 0.1,
release: 1.5
sleep 4
end
end
end
# Flute ornaments
in_thread do
sleep 16 # Wait before entering
4.times do
if one_in(2)
sample flutes, "flutes-stc-rr1-a4",
attack: 0.1,
release: 0.6
end
sleep 4
end
end
sleep 64
end
# Movement 3: "Presto giocoso"
define :movement_three do
puts "Movement 3: Presto giocoso begins"
use_bpm 112
# Energetic bass foundation
in_thread do
8.times do |i|
use_bpm(112 + (i * 2)) # Gradually getting faster
sample basses, "basses-stc-rr1-c2",
amp: 0.5,
attack: 0.1,
release: 0.4
sleep 1
sample bass_trombone, "bass_trombone-g2",
amp: 0.45
sleep 2
end
end
# Main theme - Violins and Piccolo
in_thread do
4.times do |i|
with_fx :reverb, room: 0.7 do
# Violin theme
["violin-e4", "violin-c5", "violin-g4", "violin-a4"].each do |note|
sample violins, note,
amp: 0.5,
attack: 0.1,
release: 0.6
# Piccolo doubles an octave higher occasionally
if i > 1 # Only in later repetitions
sample piccolo, ["piccolo-c5", "piccolo-f#5"].choose,
amp: 0.3,
attack: 0.1,
release: 0.4
end
sleep 2
end
end
end
end
# Flute countermelody
in_thread do
8.times do
with_fx :reverb, room: 0.8 do
sample flutes, ["flutes-stc-rr1-e4", "flutes-stc-rr1-a4"].choose,
amp: 0.4,
attack: 0.2,
release: 1.0
sleep 2
end
end
end
# Oboe interjections
in_thread do
16.times do
sleep 2
if one_in(3)
sample oboe, ["oboe-e4", "oboes-c5"].choose,
amp: 0.4,
attack: 0.1,
release: 0.8
end
sleep 2
end
end
sleep 64
end
# Finale: "Prestissimo con Fuoco"
define :finale do
puts "Finale: Prestissimo con Fuoco begins"
use_bpm 120
# Dramatic bass opening
in_thread do
with_fx :reverb, room: 0.9 do
sample basses, "basses-stc-rr1-c2",
amp: 0.7,
attack: 0.1,
release: 1.0
sample bass_trombone, "bass_trombone-c2",
amp: 0.6
sleep 4
end
end
# Dramatic violin crescendo
in_thread do
with_fx :reverb, room: 0.9, mix: 0.6 do
4.times do |i|
["violin-c5", "violin-e5", "violin-g5", "violin-c6"].each do |note|
sample violins, note,
amp: 0.4 + (i * 0.1),
attack: 0.1,
release: 0.8
sleep 1
end
end
end
end
# Flute and Piccolo flourishes
in_thread do
sleep 8
4.times do
sample flutes, "flutes-sus-c5",
amp: 0.5,
attack: 0.1,
release: 1.0
sample piccolo, "piccolo-c6",
amp: 0.3,
attack: 0.1,
release: 0.8
sleep 4
end
end
# Final oboe statement
in_thread do
sleep 16
sample oboe, "oboe-e5",
amp: 0.6,
attack: 0.2,
release: 2.0
sleep 4
sample oboe, "oboes-c5",
amp: 0.5,
attack: 0.1,
release: 3.0
end
sleep 24
end
# Main composition control
define :conduct_symphony do
movement_one
sleep 4
movement_two
sleep 4
movement_three
sleep 2
finale
end
# Start the symphony
conduct_symphony