                 response-id)))
 
 (defn server-info
-  "Fetches a bunch of useful server info. Has to trigger and poll a synth to
-  fetch data. See #'server-num-output-buses, #'server-num-input-buses,
-  #'server-num-audio-buses and #'sever-num-buffers for fast cached versions
-  of the static values in this info map. Note, the number of running synths
-  will also include the synth used to obtain this information."
+  "Fetches a bunch of useful server info. Has to trigger and poll a
+  synth to fetch data. See #'server-num-output-buses,
+  #'server-num-input-buses, #'server-num-audio-buses and
+  #'server-num-buffers #'server-sample-rate, #'server-sample-dur,
+  #'server-control-rate, #'server-control-dur for fast cached versions
+  of the static values in this info map. Note, the number of running
+  synths will also include the synth used to obtain this information."
   []
   (ensure-connected!)
   (let [prom        (promise)

        [overtone.sc.machinery.allocator]
        [overtone.helpers lib]))

(defonce output-bus-count* (atom nil))
(defonce input-bus-count*  (atom nil))
(defonce audio-bus-count*  (atom nil))
(defonce buffer-count*     (atom nil))
(defonce sample-rate*      (atom nil))

(defonce __SERVER-INFO__
  (defsynth snd-server-info

    (let [info (server-info)]
      (reset! buffer-count*  (:num-buffers info)))))

(defn server-radians-per-sample
  "Returns the number of radians per sample on the server. This number
  may change depending on host architecture but is cached for a given
  running server for the duration of boot."
  []
  (if-let [num @radians-per-sample*]
    num
    (let [info (server-info)]
      (reset! radians-per-sample* (:radians-per-sample info)))))


(on-sync-event :shutdown (fn [event-info]
                           (reset! output-bus-count* nil)
                           (reset! input-bus-count* nil)
                           (reset! audio-bus-count* nil)
                           (reset! buffer-count* nil)
                           (reset! sample-rate* nil)
                           (reset! sample-dur* nil)
                           (reset! control-rate* nil)
                           (reset! control-dur* nil)
                           (reset! radians-per-sample* nil))
               ::reset-cached-server-info)
