   (def t (atom 1))
 
   (defn go1 []
-   (loop []
-     (when (not (nil? @x)) (release @x 0.1))
-     (when @cont
-       (reset! x (s :freq (midi->hz 61) :amp 0.2))
-       (Thread/sleep (/ 200 @t))
-       (release @x 0.1)
-       (reset! x (s :freq (midi->hz 67) :amp 0.2))
-       (Thread/sleep (/ (ranged-rand 75 250) @t))
-       (recur))))
+    (when @x (release @x 0.1))
+    (when @cont
+      (reset! x (s :freq (midi->hz 61) :amp 0.2))
+      (after-delay
+       (/ 200 @t)
+       #(do
+          (release @x 0.1)
+          (reset! x (s :freq (midi->hz 67) :amp 0.2))
+          (after-delay
+           (/ (ranged-rand 75 250) @t)
+           #'go1)))))
 
   (defn go2 []
     (reset! y (s :freq (midi->hz 73) :amp 0.3)))
 
   (defn go3 []
-    (when (not (nil? @y)) (release @y 0.1))
+    (release @y 0.1)
     (reset! y (s :freq (midi->hz 79) :amp 0.3))
     (reset! t 2))
 
   (defn go4 []
-    (when (not (nil? @y)) (release @y 0.1))
+    (release @y 0.1)
     (reset! cont false))
+
+  (def go (generator go1 go2 go3 go4))
 )
-
-(go1)
-(go2)
-(go3)
-(go4)
+(go)
+(go)
+(go)
+(go)

(ns sc-three
  (:use [overtone.live]))

;; This is the default synth. Is it accessible from Overtone?
(comment

  )
)

(def go
  (let [y (atom nil)]
   (generator
    (fn []
      (let [x (s :freq (midi->hz 76))]
        (after-delay
         1000
         #(do
            (release x 0.1)
            (reset! y (s :freq (midi->hz 73)))))))
    (fn []
      (wait-release y 0.1)
      (let [z (s :freq (midi->hz 69))]
        (after-delay
         2000
         #(release z)))))))
(go)
(go)

