/
sonicpiscript
42 lines (33 loc) · 1.15 KB
/
sonicpiscript
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
# arpeggiate semi-randomly over switchable chord progression
# with help from tedward
# plus, voices + reverb
cmaj = scale(:c2,:major,num_octaves: 5) # list of 36 notes
dmaj = scale(:d2,:major,num_octaves: 5)
emin = scale(:e2,:minor,num_octaves: 5)
fmaj = scale(:f2,:major,num_octaves: 5)
fmin = scale(:f2,:minor,num_octaves: 5)
gmaj = scale(:g2,:major,num_octaves: 5)
amin = scale(:a2,:minor,num_octaves: 5)
bmaj = scale(:b2,:major,num_octaves: 5)
revtrag = [cmaj, amin, emin, gmaj]
lotr = [emin, cmaj, gmaj, dmaj]
glass = [emin, cmaj, gmaj, bmaj]
wagon = [gmaj, dmaj, emin, cmaj]
purty = [cmaj, emin, fmaj, fmin]
arp = [0,2,4,7,9,11,14,16,18,21,23,25,28,30,32,35] # note values for arpeggiation, 0-indexed
arrayin = sync "/osc*/trigger/prophet" # incoming data, normalized to those 16 values
# use_synth :blade
iter = 1
frame = 0
live_loop :test do
notein = arrayin[iter]
puts notein
mynote = arp[notein] # select note from arp list, by datain value
# myrand = arp[rand_i(16)] # random value from the arp
if ((iter % 16) == 0) # at the end of the sequence
frame = frame+1
end
play (revtrag[(frame % 4)])[mynote]
iter = iter+1
sleep 0.2
end