          :timeout))))
 
 (defn await-promise!
-  "Read the reply received from the server, waiting for timeout ms if the message hasn't yet been received. Raises an exception if the message hasn't been received within timeout ms"
+  "Read the reply received from the server, waiting for timeout ms if the
+  message hasn't yet been received. Raises an exception if the message hasn't
+  been received within timeout ms"
   ([prom] (await-promise prom REPLY-TIMEOUT))
   ([prom timeout]
      (.get (future @prom) timeout TimeUnit/MILLISECONDS)))


(defn notify
  "Turn on notification messages from the audio server.  This lets us free
  synth IDs when they are automatically freed with envelope triggers.  It also lets
  us receive custom messages from various trigger ugens."
  [notify?]
  (snd "/notify" (if (false? notify?) 0 1)))

(defn connect-jack-ports
  "Connect the jack input and output ports as best we can.  If jack ports are always different
  names with different drivers or hardware then we need to find a better strategy to auto-connect."
  ([] (connect-jack-ports 2))
  ([n-channels]
     (let [port-list (sh "jack_lsp")


;; TODO: setup an error-handler in the case that we can't connect to the server
(defn connect
  "Connect to an running SC audio server. Either an external server if host and
  port are passed or an internal server in the case of no args."
  ([] (connect-internal))
  ([host port] (.run (Thread. #(connect-external host port)))))

