This is a tribute to the early music of Steve Reich. It was realized on the Sonic Pi, using the Bohlen-Pierce scale, equal tempered as MIDI notes.
Source code:
# Reichish Phase
tritave = 19.02 # a 3/2 tritave is 1902 cents, or 19.02 in MIDI
half = tritave / 13 # size of the BP half step in MIDI
whole = half * 2
a3 = 69 # MIDI 69 is A440
b3 = a3 + whole
c3 = b3 + half
d3 = c3 + whole
e3 = d3 + half
f3 = e3 + half
g3 = f3 + whole
h3 = g3 + half
j3 = h3 + whole
a4 = a3 + tritave
a2 = a3 - tritave
b2 = b3 - tritave
c2 = c3 - tritave
d2 = d3 - tritave
e2 = e3 - tritave
f2 = f3 - tritave
g2 = g3 - tritave
h2 = h3 - tritave
j2 = j3 - tritave
notes = (ring a2, a3, f2, c2, c3, h2, e2, e3, b2, g2, g3, d2, j2)
in_thread(name: :slower) do
use_synth :pretty_bell
for i in 0..326
print i
n = notes.tick
np = n / a4
play n, amp: 1.0 - np, pan: -np / 2
sleep rrand(0.298,0.302)
i +=1
end
end
in_thread(name: :faster) do
use_synth :pretty_bell
for i in 0..329
print i
n = notes.tick
np = n / a4
play n, amp: 1.0 - np, pan: np / 2
sleep rrand(0.294,0.3)
i +=1
end
end