 (def FPS 10)
 (def scopes* (atom {}))
 (def scope-pool* (atom nil))
+(def scopes-running?* (atom false))
 (def WIDTH 600)
 (def HEIGHT 400)
 (def X-PADDING 5)

  (let [buf (buffer SCOPE-BUF-SIZE)
        _ (wait-for-buffer buf)
        bus-synth (bus->buf :target 0 :position :tail (:num s) buf)]

    (apply-at (+ (now) 1000) update-scope [])
    (assoc s
      :size SCOPE-BUF-SIZE
      :bus-synth bus-synth


(defn scopes-start
  []
  (if-not @scopes-running?*
    (do
      (create-pool-if-necessary)
      (start-scopes-runner)
      (reset! scopes-running?* true))))

;;  (.cancel (:runner @scope*) true)
(defn scopes-stop
  []
  (stop-and-reset-pool! scope-pool*)
  (reset! scopes-running?* false))


(defn- scope-bus
  "Set a bus to view in the scope."
