 
   (let [mesg-p (recv "/b_info")
         _   (snd "/b_query" (buffer-id buf))
-        msg (await-promise mesg-p)
+        msg (await-promise! mesg-p)
         [buf-id n-frames n-channels rate] (:args msg)]
     {:n-frames n-frames
      :n-channels n-channels

    (loop [recvd 0]
      (if (= recvd len)
        samples
        (let [msg @(recv "/b_setn")
              ;_ (println "b_setn msg: " (take 3 (:args msg)))
              [buf-id bstart blen & samps] (:args msg)]
          (loop [idx bstart


(defn await-promise
    "Read the reply received from the server, waiting for timeout ms if the message hasn't yet been received. Returns :timeout if a timeout occurs."
    ([prom] (await-promise prom REPLY-TIMEOUT))
    ([prom timeout]
       (try
         (.get (future @prom) timeout TimeUnit/MILLISECONDS)
         (catch TimeoutException t
           :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"
    ([prom] (await-promise prom REPLY-TIMEOUT))
    ([prom timeout]
       (.get (future @prom) timeout TimeUnit/MILLISECONDS)))

(defn- parse-status [args]
  (let [[_ ugens synths groups loaded avg peak nominal actual] args]
