-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy path12-Tone Serialism
59 lines (57 loc) · 1.42 KB
/
12-Tone Serialism
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
#12-Tone Serialism
#Coded by Davids Fiddle
source = (note_range :c4, :c5)
with_random_seed 334567 do
#This block creates the tone row and it's inverse
notes = source.shuffle
s = notes[0]
rnotes = [s]
#Go through the tonerow and invert it
12.times do
tick
rnotes[look + 1] = notes[look + 1] - (notes[look + 1] - s)*2
end
#play the tone row or some variation
in_thread do
sl = (ring 0.25,0.5,0.75,1).stretch(24).shuffle
use_synth :piano
8.times do
#Randomly choose what variation to play
i = rand_i(3)
12.times do
tick
#Original
play notes.look if i == 0
#Reverse
play notes.reverse.look if i == 1
#Inverse
play rnotes.ring.look if i == 2
#Inverse-Reverse
play rnotes.ring.reverse.look if i == 3
sleep sl.look
end
end
end
comment do #uncomment to play second voice
in_thread do
sl = (ring 0.25,0.5,0.75,1).stretch(24).shuffle
use_synth :piano
8.times do
#Randomly choose what variation to play
i = rand_i(3)
12.times do
tick
#Original
play notes.look if i == 0
#Reverse
play notes.reverse.look if i == 1
#Inverse
play rnotes.ring.look if i == 2
#Inverse-Reverse
play rnotes.ring.reverse.look if i == 3
sleep sl.look
end
end
end
end
end