Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Steve Reich's Piano Phase - Sonic Pi vs Overtone
(ns overtone.examples.compositions.piano-phase
(:use overtone.live
overtone.inst.sampled-piano))
;; Steve Reich's Piano Phase
(def piece [:E4 :F#4 :B4 :C#5 :D5 :F#4 :E4 :C#5 :B4 :F#4 :D5 :C#5])
(defn player
[t speed notes]
(let [n (first notes)
notes (next notes)
t-next (+ t speed)]
(when n
(at t
(sampled-piano (note n)))
(apply-by t-next #'player [t-next speed notes]))))
(def num-notes 1000)
(do
(player (now) 338 (take num-notes (cycle piece)))
(player (now) 335 (take num-notes (cycle piece))))
;;(stop)
# Steve Reich's Piano Phase
# Requires Sonic Pi v2.6
notes = (ring :E4, :Fs4, :B4, :Cs5, :D5, :Fs4, :E4, :Cs5, :B4, :Fs4, :D5, :Cs5)
live_loop :slow do
play notes.tick, release: 0.1
sleep 0.3
end
live_loop :faster do
play notes.tick, release: 0.1
sleep 0.295
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment