          (log/debug "Booting SuperCollider internal server (scsynth)...")
          (.start sc-thread)
          (dosync (ref-set server-thread* sc-thread))
-         (connect-internal)
+         (connect)
          :booting))))
 
 (defn- sc-log 

  (if (not @running?*)
    (let [port (if (nil? port) (+ (rand-int 50000) 2000) port)
          cmd (into-array String (concat [(SC-PATHS (@config* :os)) "-u" (str port)] (SC-ARGS (@config* :os))))
          sc-thread (Thread. #(boot-thread cmd))]
      (.setDaemon sc-thread true)
      (log/debug "Booting SuperCollider server (scsynth)...")
      (.start sc-thread)
      (dosync (ref-set server-thread* sc-thread))
      (.run (Thread. #(wait-for-boot host port)))
      :booting))))

(defn boot
  "Boot either the internal or external audio server."
  ([] (boot (get @config :server :internal) SERVER-HOST SERVER-PORT))
  ([which & [host port]]
     (cond 
       (= :internal which) (boot-internal)

      (let [buffer (java.nio.ByteBuffer/allocate 8129)]
        (World_SendPacket @world* (.limit buffer) buffer
                          (callback reply-cb (fn [addr buf size] (println "reply!"))))
      (nil? @server*) (throw (Exception. "Not connected to a SuperCollider server.")))))

(defmacro at
  "Schedule the messages sent in body at a single time."
