-
Notifications
You must be signed in to change notification settings - Fork 1
/
workspace_three.spi
193 lines (174 loc) · 5.82 KB
/
workspace_three.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
def bass_one
(ring
[:E2,3], [:D2,3],[:B1,3],
[:FS2,3],
[:A2,3],
[:Gs2,1],
[:D2,3],
[:Cs2,2],
[:B1,1],
[_,1.0],
[:E2,3], [:D2,3],[:Fs2,3],
[:GS2,3],
[:A2,3],
[:E2,1],
[:D2,2],
[:Cs2, 0.5, 80],[:E2, 0.5,100],
[[:A1, :A2], 1+1+1+1.0, 70])
end
def melody_one
(knit #[:A3, 1],3, [:Cs3,1],3, [:B2,2/4.0],3,
[:Fs3,3/4.0],1, [:A3,1],1, [:D3,2/4.0],1,
[:A3, 3/4.0],1, [:D3,1],1, [:E3,2/4.0],1,
[:E3, 3/4.0],1, [:Fs3,1],1,[:D3,2/4.0], 1,
[_, 3/4.0],1, [:A2,1],1, [:B2,2/4.0 + (3-3/4.0) - 0.25],1,
[:A3, 3/4.0],3, [:D3,1],3, [:Fs3,2/4.0],3,
[:Fs3,3/4.0],1, [:B3,1],1, [:A3,2/4.0],1,
[:A3, 3/4.0],1, [:D3,1],1, [:E3,2/4.0],1,
[:E3, 3/4.0],1, [:Fs3,1],1,[:D3,2/4.0], 1,
[_, 3/4.0],1, [:A2,1],1, [:B2,2/4.0 + 3-(3/4.0) - 0.25],1)
end
#live_audio :moog, input: 2
live_loop :metro do
tick
#midi (ring :Gs3,32, :Cs3, 32, :E3, 32).look, 120, port: :iac_bus_1, channel: 2, sustain: 0.8
sleep 1
end
live_loop :iter, sync: :metro do
#stop
tick
s = (ring 1/4.0, 1/4.0, # 1
1/4.0, 1/4.0,
1/4.0, 1/4.0, # 1
1/4.0, 1/4.0,
1/4.0, 1/4.0).look
shader :decay, :iR, rand*2
#midi (knit :E2,128, :A2, 128, :B2, 128).look, 1*(line 100, 127,128/1).look, port: :iac_bus_1, channel: 1, sustain: s*2.0
sleep s #1/4.0 #7=> 2 beats
end
live_loop :high, sync: :metro do
tick
#harp (ring :A3), (ring 20,30,30).look, channel: 8, sustain: 6, port: :iac_bus_1
sleep 12
end
live_loop :melody2 do
tick
s = nil
3.times{
s = (knit [:A3,12],1, [:Cs4,12],1, [:E4,12],1, [_,12],1, [_,12],1).tick(:no)
#sharp s, (ring 30).look
sleep s[1]
}
end
live_loop :harmony, sync: :metro do
tick
note = (ring [:A2,3], [:D2,3], [:E2,3]).look
#puts note_inspect(note[0])
#if note[0] && note[0][0] == :A2
#bass note, 100, port: :iac_bus_1, channel: 5#, sustain: 3
# end
play_midi note[0], note.length > 2 ? note[-1] : 127, port: :iac_bus_1, channel: (note[0] && note[0][0] == :A1) ? 6 : 5, sustain: note[1]
sleep note[1]
@t2+= note[1]
puts "harm:#{@t2}"
end
@t2 = 0
@notes = 0
live_loop :melody, sync: :metro do
sync :bass
tick
s = nil
3.times{
s = (knit
[:Fs3,3/4.0],1, [:A3,1],1, [:D3,2/4.0],1,
[:A3, 3/4.0],1, [:D3,1],1, [:E3,2/4.0],1,
#[:Fs3, 1],3, [:A3,1],3, [:D3,1],3,
# [:Fs3,3/4.0],1, [:A3,1],1, [:D3,2/4.0],1,
).tick(:no)
#harp s, (ring 20,20,20, 30,40,40, 40,60,80).look
@notes += s[1]
sleep s[1]
}
sleep 3/4.0;@notes += 3/4.0
puts "mel:#{@notes}"
end
#with_fx :reverb, mix: 0.4, room: 0.1 do
live_loop :beat, sync: :metro do
tick
k1,k2 = Mountain[/subkick/,0], Frag[/kick/,9]
h1,h2 = (knit @slices["Fs3/4"][8],1, @slices["A3/4"][1],2).look, @slices["B3/4"][1] #@slices["Cs4/4"][3]
if(args=(ring *%W{k1 0 {path:k1,amp:0.1} 0 0 0 0 0 k2 0 0 0 0 0 0 0
k2 0 0 0 0 0 0 0
k1 0 {path:k1,amp:0.1} 0 0 0 0 0 k2 0 0 0 0 0 0 0
k2 0 0 0 0 0 0 0
k1 0 {path:k1,amp:0.1} 0 0 0 0 0 k2 0 0 0 0 0 0 0
k2 0 0 0 0 0 0 0
k2 0 {path:k2,amp:0.2} 0 0 0 0 0 k1 0 0 0 0 0 0 0
k1 0 0 0 0 0 0 0
}).look) != "0"
#zero :A0
smp eval(args), cutoff: 90
end
#puts h2
i1,i2 = MagicDust[/_HI/,[6,7]]
# m1,m2,m3 = Mountain[/microperc/,[5,13]]
with_fx :echo, mix: 1 do
perc = (ring *%w{_ _ _ _ i1 _ i1 _ _ _ _ _
_ _ _ i2 _ _ _ _ i1 _ _ _
})
smp eval(perc.look), amp: 0.125+rand*0.1, pan: (ring 0.25,-0.25).tick(:pan)
end
h3 = "/Users/josephwilk/Workspace/music/samples/soprano/Samples/Phrases/Latin/A/vor_sopr_phrase_latin_a_18.wav"
h3 = "/Users/josephwilk/Workspace/music/samples/soprano/Samples/Phrases/Latin/D/vor_sopr_phrase_latin_d_08.wav"
h3 = "/Users/josephwilk/Workspace/music/samples/soprano/Samples/Phrases/Latin/A/vor_sopr_phrase_latin_a_18.wav"
h3 = "/Users/josephwilk/Workspace/music/samples/soprano/Samples/Phrases/Latin/A/vor_sopr_phrase_latin_a_21.wav"
h3 = "/Users/josephwilk/Workspace/music/samples/soprano/Samples/Phrases/Latin/F/vor_sopr_phrase_latin_f_18.wav"
perc = (ring *%w{_ _ _ @slices["B4/2"][31]
_ _ @slices["B4/4"][30] _
_ @slices["B4/4"][32] _ _
@slices["B4/4"][34] _ _ _})
# smp eval(perc.look), amp: 1.25, pan: (ring 0.25,-0.25).tick(:pan)
#h3 = @slices["Cs4/4"][3]
hat = (ring *%w{_ _ _ _ h2 _ _ _})
hat2 = (ring *%w{_ _ _ _ h1 _ _ _
_ _ _ _ h1 _ {path:h2,amp:0.9} _
_ _ _ _ h1 _ _ _
_ _ _ _ h1 _ _ _
_ _ _ _ h1 _ _ _
_ _ _ _ h1 _ {path:h2,amp:0.9} _
_ _ _ _ h1 _ _ _
_ _ _ _ h1 _ _ _
_ _ _ _ h1 _ _ _
_ _ _ _ h1 _ {path:h2,amp:0.9} _
_ _ _ _ h1 _ _ _
_ _ _ _ h1 _ _ _
_ _ _ _ h1 _ _ _
_ _ _ _ h1 _ h3 _
_ _ _ _ h1 _ _ _
_ _ _ _ h1 _ _ _
})
if (args=(ring *%W{0 0 0 0 0 0 1 0.25 0 0 0 0 0 0 1 0
}).look) != "0"
#smp MagicDust[/_HI/,23], amp: args =="1" ? 0.5 : args
end
if (args=(ring *%W{
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1}).look) != "0"
#smp MagicDust[/_MI/,48], amp: args =="1" ? 0.5 : args
end
if (args=(ring *%W{0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0}).look) != "0"
smp Dust[/snare/,11], amp: 0.8
end
if (ring *%W{1 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0}).look == "1"
#smp MagicDust[/HI_/,52..69].look, amp: 0.3+rand*0.1
end
if (hat2.look) == h3
smp eval(hat2.look),amp: 0.5, rate: (ring -1,-1,1).look, start: 0.0, finish: 1.5
else
smp eval(hat2.look),amp: 0.5, rate: (ring -1,-1,1).look
end
sleep 1/8.0
end
#end