     id))
 
 (defn node-free
-  "Instantly remove a node from the graph."
+  "Remove a synth node"
   [& node-ids]
   (doseq [id node-ids] (free-id :node id))
   (apply snd "/n_free" node-ids))
 
 (defn node-run
-  "Start a stopped node."
+  "Start a stopped synth node."
   [node-id]
   (snd "/n_run" node-id 1))
 
 (defn node-stop
-  "Stop a running node."
+  "Stop a running synth node."
   [node-id]
   (snd "/n_run" node-id 0))
 

(if (= :linux (@config* :os))
  (add-boot-handler connect-jack-ports))

; TODO: setup an error-handler in the case that we can't connect to the server
(defn- wait-for-boot 
  ([cnt]
    (when (and (< cnt 100)
               (= @status* :booting))
      (snd "/status")
      (when (recv "status.reply" REPLY-TIMEOUT)
        (dosync (ref-set status* :booted))
        (notify true) ; turn on notifications now that we can communicate
        (run-boot-handlers))
      (recur (inc cnt))))
  ([host port] 
    (dosync (ref-set status* :booting))
    (Thread/sleep 1000)
    (connect host port)
    (wait-for-boot 0)))

(defn booti
  ([] (booti nil))
  ([port]
     (if (not @running?*)
       (let [port (if (nil? port) (+ (rand-int 50000) 2000) port)
             boot-thread (fn []
                           (let [opts (sc-jna-startoptions-byref)]
                             (set! (. opts udp-port-num) port)
                             (set! (. opts tcp-port-num) -1)
                             (set! (. opts verbosity) 1)
                             (set! (. opts lib-scsynth-path) (str (find-scsynth-lib-path)))
                             (set! (. opts plugin-path) (str (find-synthdefs-lib-path)))
                             
                             (dosync (ref-set world* (ScJnaStart opts)))
                             
                             (World_WaitForQuit @world*)
                             (ScJnaCleanup)))
             sc-thread (Thread. boot-thread)]
         (.setDaemon sc-thread true)
         (log/debug "Booting SuperCollider internal server (scsynth)...")
         (.start sc-thread)
         (dosync (ref-set server-thread* sc-thread))
         (.run (Thread. #(wait-for-boot "127.0.0.1" port)))
         :booting))))

(defn boot
  ([] (boot SERVER-HOST SERVER-PORT))
  ([host port]
  (if (not @running?*)
    (let [port (if (nil? port) (+ (rand-int 50000) 2000) port)

  (free-id :audio-buffer (:id buf))
  (snd "/b_free" (:id buf)))

; TODO: Test me...
(defn buffer-read 
  "Read a section of an audio buffer."
  [buf start len]
  (assert (buffer? buf))
  (loop [reqd 0]
    (when (< reqd len)
