   )
 )
 
-;; Is there a \default synthesizer in Overtone?
-(defsynth s [freq 440]
-  (let [src (* 0.3 (sin-osc freq))]
-    (out 0 src)))
-
 ;; Is there a better way?
 (do
   (def cont (atom 0))


(go)
(go)

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

;; This is the default synth. Is it accessible from Overtone?
(comment
                SynthDef(\default, { arg out=0, freq=440, amp=0.1, pan=0, gate=1;
                                var z;
                                z = LPF.ar(
                                                Mix.new(VarSaw.ar(freq + [0, Rand(-0.4,0.0), Rand(0.0,0.4)], 0, 0.3, 0.3)),
                                                XLine.kr(Rand(4000,5000), Rand(2500,3200), 1)
                                        ) * Linen.kr(gate, 0.01, 0.7, 0.3, 2);
                                OffsetOut.ar(out, Pan2.ar(z, pan, amp));
                }, [\ir])
)

(defsynth s [out 0 freq 440 amp 0.1 pan 0 gate 1]
  (let [z (* (lpf (mix (var-saw [freq (+ freq (ranged-rand -0.4 0.0)) (+ freq (ranged-rand 0.0 0.4))] 0 0.3 0.3))
                  (x-line:kr (ranged-rand 4000 5000) (ranged-rand 2500 3200) 1))
             (linen:kr gate 0.01 0.7 0.3 2))]
    (offset-out out (pan2 z pan amp))))

(defn release [x releaseTime]
  (ctl x :gate (- releaseTime)))

;; Page 83
;; "foo" repeats every second
