-
Notifications
You must be signed in to change notification settings - Fork 1
/
live_26092018.spi.spi
318 lines (262 loc) · 7.74 KB
/
live_26092018.spi.spi
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
load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/samples.rb"
live_loop(:metro)do
tick;
cue("16") if look % 16.0 == 0.0
cue("24") if look % 24.0 == 0.0
cue("18") if look % 18.0 == 0.0
cue("32") if look % 32.0 == 0.0
cue("64") if look % 64.0 == 0.0
# midi_start if tick == 0
# midi_clock_beat 1.0, port: :iac_bus_1
#smp Mountain[/subkick/,1]
sleep 1.0
end
puts note_inspect(chord(:A2, :sus2))
live_loop :moving, sync: :metro do
sync :music
mega =
(ring
# (ring [:A3,1/8.0], [:D3,1/8.0], [:Cs3,1/8.0]),
# (ring [:A3,1/8.0], [:B2,1/8.0], [:Cs3,1/8.0]),
# (ring [:E3,1/8.0], [:Cs3,1/8.0], [:A3,1/8.0]),
(ring [:Cs3,1/8.0], [:Fs2,1/8.0], [:E2,1/8.0]),
#(ring [:A3,1/8.0], [:D3,1/8.0], [:E3,1/8.0]),
# (ring [:B3,1/8.0], [:Gs3,1/8.0], [:E3,1/8.0]),
# (ring [:Gs3,1/8.0], [:E2,1/8.0], [:Cs3,1/8.0]),
# (ring [:A3,1/8.0], [:D3,1/8.0], [:Cs3,1/8.0])
# (ring [:B2,1/8.0], [:D3,1/8.0], [:Fs3,1/8.0]),
#(ring [:A3,1/8.0], [:D3,1/8.0], [:Cs3,1/8.0]),
#(ring [:A3,1/8.0], [:B2,1/8.0], [:Cs3,1/8.0]),
#(ring [:A3,1/8.0], [:Cs3,1/8.0], [:E3,1/8.0], [:Gs3, 1/8.0])
)
#A C B
sleep 2/4.0
score = mega.tick(:mega)
# puts "SCORE:#{score}, #{score.count}"
midi_cc 5, (ring 2,4).tick(:inside), port: :iac_bus_1, channel: 9
puts "---------------------"
3.times{
#shader :echo, "small","Why?",0,0,256,256,256,256
tick
s2 = ""
zero s2=(knit :D2,24,:Fs2,24,:Gs2,24).look,5
puts s2
s = score.look
dshader :echo, "small", "#{([" "]*rand_i(50)).join} #{s[0]}", 0.0,1600,
rand_i(256), rand_i(256),rand_i(255),255
puts s
zero s,(line 0,100,9).look if s && s[0]
#midi_pitch_bend 0.5, port: :iac_bus_1, channel: 9
#puts score.map{|z| z[-1] }.reduce(:+)
sleep s[-1]
}
end
live_loop :test, sync: :metro do
tick
# use_real_time
# midi_note_on (scale :A2, :major, octaves: 3).shuffle.look, port: "*"
sleep 1/4.0
end
#midi_pitch_bend 0.0, port: :iac_bus_1, channel: 3
module Zero
extend SonicPi::Lang::Midi
extend SonicPi::Lang::Core
extend SonicPi::Lang::Sound
# include SonicPi::Lang::Midi
def self.midi_clock(state)
# midi_cc 114, state ? 1 : 0
end
end
live_loop :bass, sync: :metro do
#sync "16"
tick
sleep 3
end
def harp(n,*args)
begin
if n
velocity = 30
if n.is_a?(Array)
args = args << {sustain: n[1]}
n = n[0]
end
if args && args[0].is_a?(Numeric)
velocity = args[0]
args = args[1..-1]
end
if n && ((n != "_") && n != :_)
args_h = resolve_synth_opts_hash_or_array(args)
harp_cc(args_h)
midi n, velocity, *(args << {port: :iac_bus_1} << {channel: 3})
dshader(:decay, :iHarp, (note(n)/69.0), 0.0041) if n && note(n)
dshader(:iBright, velocity/127.0) if velocity
end
end
rescue
puts $!.backtrace
end
end
live_loop :music, sync: :metro do
tick
#sync "16"
# use_real_time
harp_cc phase: 0.5
harp (ring [:A2,3]#, [:Cs3,3], [:B2, 3],
).look, 30.0, sustain: 3.0#, port: :iac_bus_1, channel: 9
puts (ring [:A2,3], [:Cs3,3], [:B2, 3],
# [:Fs3,3], [:A3,3], [:D3, 3]
).look
#bass :E2, sustain: 3
#harp_cc phase: rand
# bass (ring :E2, :D2, :Fs2).look, sustain: 2.5, cutoff: 0.25
3.times{sleep 1; harp_cc phase: 1*(ring 0.5, 0.5 + rand*0.05).tick(:inits)}
#midi_pitch_bend (line 0,127).look, port: :iac_bus_1, channel: 3
#midi_pitch_bend (line 0.0, 0.5,12).look, port: :iac_bus_1, channel: 9
shader [:iR,:iG,:iB].choose, rand*10
#shader :iMode, (ring 0.0,1.0,2.0,3.0,4.0).look
midi_cc 65, 127*1 # port
#midi_cc 5, 1*4 # port
midi_cc 114, 1
# Zero.midi_clock(true)
#puts @slices["B3/4"].look[:path]
comment do
midi_cc 65, 127*0 # port
midi_cc 5, 127*0 # port
midi_cc 114, 127*1 #midi clock
midi_cc 111, 127.0*0
midi_cc 108, 12.0*0
midi_cc 109, 127.0*0
midi_cc 112, 127.0*0
midi_cc 113, 127.0*0
end
#128.times do
# midi_cc (line 0, 127).look, 127, port: :iac_bus_1, channel: 9
# sleep 0.5
# tick
#end
#midi_cc 1, (line 0, 127).look, port: :iac_bus_1, channel: 9
end
with_fx :none, mix: 0 do
live_loop :pat, sync: :metro do
#sync '18'
tick
#sync "16"
c1 = Dust[/clap/,1]
k2,k1,k3 = Frag[/kick/,9], Mountain[/subkick/,0], (knit Dust[/kick/,24],3, Dust[/kick/,25],3).look
s=(ring *%W{
k2 _ _ _ k1 _ _ _ k2 _ _ _ k1 _ _ _
k2 _ _ _ k1 _ _ _ k2 _ _ _ k1 _ _ _
k2 _ _ _ k1 _ _ _ k2 _ _ _ k1 _ _ _
k2 _ k2 _ k1 _ _ _ k2 _ _ _ k1 _ _ _
k2 _ _ _ k3 _ k2 _
}).look
s=(ring *%W{
k2 _ _ _ _ _ _ _ k1 _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
k2 _ _ _ _ _ _ _ k1 _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
k2 _ _ _ _ _ _ _ k1 _ _ _
_ _ _ _ _ _ _ _ Frag[/kick/,3] _ k2 _
}).look
#2*(line 0.8, 1.0, 12*6).look
smp eval(s), amp: 2*(knit 0.8,4, 0.6,4, 0.7,4, 0.6,4).look , v: 0.2, attack: (knit 0.0,12, 0.02,4, 0.0,8).look
if s!="_" && spread(1,8+4).look
if spread(1,32).look
at do
smp Analog[/17 /].tick(:echo), amp: 0.5
sleep 0.25
smp Analog[/17 /].tick(:echo), amp: 0.3
end
else
smp Analog[/17 /].tick(:echo), amp: 0.5
end
end
p=Dust[/perc/, /conga/] #MagicDust[/perc/,/stone/,[4..8]].look #*Dust[/perc/, [7,7]]
# p= Dust[/perc/, [7,7]]
p=MagicDust[/perc/,/stone/,[4..8]].look
# puts p
s=(ring *%W{
p _ _ _ _ _ p _
_ _ p _
_ _ _ _ _ _ p _
_ _ p _
p _ _ _ _ _ p _
_ _ p _
_ _ _ _ _ _ p _
_ _ p _
}).look
s1=(ring *%W{
p _
p _ _ _
_ p _ _
_ _ p _
_ _ _ p
_ _ p
_ _ p
}).look
if(s=="_")
# zero (knit :A2,24,:E3,24).look,5
# zero (ring :A3,1,:E3,1,:A3,1 ).look,5
end
with_fx :none, mix: (line 0.2,0.3,32).look do
if s!= "_" && spread(1,6).look
#smp MagicDust[:clack, [0,2,3,6]].tick(:insider), amp: 0.5*1, pan: (ring 0.25,-0.25).look(:inside)
end
#smp eval(s), cutoff: (line 110, 115, 6*4).look, attack: (line 0.02, 0.0,6*2).look,
#amp: 0.8*(line 1.0,0.9,6*8).look, rate: (knit 1,(6*4)-4, 0.85,4, 1,(6*4)-4, 0.75,4).look
end
c = MagicDust[/HI_/, [54,55,56,57]].look
if (s=(ring *%W{
_ _ _ _ _ _
c _ _ _ _ _
_ _ _ _ _ _
_ _ _ _ _ _
}).look) != _
# smp eval(s), pan: (ring 0.25,-0.25).look
end
c1 = MagicDust[/HI_/,[0..9]].look#, Dust[/clap/].look
s=(ring *%W{
_ _ _ _ c1 _ _ _ _ _ _ _ c1 _ _ _
_ _ _ _ c1 _ _ _ _ _ _ _ c1 _ _ _
_ _ _ _ c1 _ _ _ _ _ _ _ c1 _ _ _
_ _ _ _ c1 _ _ _ _ _ _ _ c1 _ _ _
}).look
# smp eval(s), amp: 0.25
# = spread(7,11).map{|s| s ? :hit : :miss}
s=(ring *%W{_ _ _ _ c1 _ _ _}).look
# smp eval(s), cutoff: (line 80, 120, 128).look
h,h2 = MagicDust[/_HI/,18],Dust[/hat/,4]
s=(ring *%W{
_ _ h _ _ _ h _
_ _ h _ _ _ h _
_ _ h _ _ _ h {path:h,amp:0.4}
_ _ h _ _ _ h _
}).look
amp = if ((v=eval(s)) != _)
v.is_a?(String) ? 0.5 : (v[:amp] || 0.5)
else
0
end
#smp eval(s), cutoff: (line 110, 127,32).look, attack: (line 0.02,0.0,64).look, sustain: (knit 0.01,4,0.02,4,0.025,4).look, amp: amp
sleep 1/8.0
end
end
live_loop :bells, sync: :metro do
stop
tick
# h,h2 = MagicDust[/MD_BELL_RES/,5],Frag[/hat/,7]
# smp MagicDust[/hi/,/chimes/,/_A\./].look, amp: 0.5
sleep 32
end
live_loop :vocals, sync: :metro do
tick
with_fx :gverb, room: 600, mix: (ring 0,0,0,1.0).look, room_slide: 0.5 do |g_fx|
hz1,hz2 = (knit @slices["A3/4"][1],2).look, @slices["B3/4"][1]
hat2 = (ring *%w{_ _ hz1 _
_ _ hz1 {path:hz2,amp:0.25}
_ _ hz1 _
_ _ hz1 _})
smp eval(hat2.look)#, amp: 2, rate: [-1,1].choose
8.times{sleep 1/4.0; control g_fx, room: rand_i(400)}
end
end