-
Notifications
You must be signed in to change notification settings - Fork 1
/
workspace_two.spi
141 lines (131 loc) · 3.75 KB
/
workspace_two.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
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
tick
s = nil
3.times{
s = (knit [:Fs3, 1],3, [:Cs3,1],3, [:B2,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"][0]
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
}).look) != "0"
#zero :A0
smp eval(args), cutoff: 90
end
if spread(4,12).look
smp MagicDust[/_HI/,24], amp: 0.25, pan: (ring 0.25,-0.25).tick(:pan)
end
hat = (ring *%w{_ _ _ _ h2 _ _ _})
hat2 = (ring *%w{_ _ _ _ h1 _ _ _
_ _ _ _ h1 _ {path:h2,amp:0.9} _
_ _ _ _ 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 1 0 0 0}).look) != "0"
#smp MagicDust[/snare/,0], amp: 1
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
smp eval(hat.look), amp: 0.3#, rpitch: 0
smp eval(hat2.look),amp: 0.5
sleep 1/8.0
end
#end